2 @message |
firebird.driver.types.DatabaseError: SQL error code = -104
-Datatypes are not comparable in expression
LOG DETAILS:
2025-07-02 18:48:25.877
2025-07-02 18:48:25.889 act = <firebird.qa.plugin.Action object at [hex]>
2025-07-02 18:48:25.899 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-07-02 18:48:25.905
2025-07-02 18:48:25.916 @pytest.mark.version('>=2.5')
2025-07-02 18:48:25.925 def test_1(act: Action, capsys):
2025-07-02 18:48:25.937 with act.db.connect() as con:
2025-07-02 18:48:25.949 con.execute_immediate(proc_ddl)
2025-07-02 18:48:25.958 con.commit()
2025-07-02 18:48:25.969 c = con.cursor()
2025-07-02 18:48:25.979 > for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
2025-07-02 18:48:25.987
2025-07-02 18:48:25.994 tests/bugs/core_6108_test.py:37:
2025-07-02 18:48:26.001 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-07-02 18:48:26.007
2025-07-02 18:48:26.015 self = <firebird.driver.core.Cursor object at [hex]>
2025-07-02 18:48:26.026 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-07-02 18:48:26.035 parameters = [3]
2025-07-02 18:48:26.043
2025-07-02 18:48:26.051 def execute(self, operation: Union[str, Statement], parameters: Sequence[Any]=None) -> Cursor:
2025-07-02 18:48:26.061 """Executes SQL command or prepared `Statement`.
2025-07-02 18:48:26.069
2025-07-02 18:48:26.076 Starts new transaction if transaction manager associated with cursor is not active.
2025-07-02 18:48:26.082
2025-07-02 18:48:26.088 Arguments:
2025-07-02 18:48:26.094 operation: SQL command or prepared `Statement`.
2025-07-02 18:48:26.105 parameters: Sequence of parameters. Must contain one entry for each argument
2025-07-02 18:48:26.115 that the operation expects.
2025-07-02 18:48:26.124
2025-07-02 18:48:26.133 Returns:
2025-07-02 18:48:26.142 `self` so call to execute could be used as iterator over returned rows.
2025-07-02 18:48:26.153
2025-07-02 18:48:26.164 Note:
2025-07-02 18:48:26.173 If `operation` is a string with SQL command that is exactly the same as the
2025-07-02 18:48:26.180 last executed command, the internally prepared `Statement` from last execution
2025-07-02 18:48:26.187 is reused.
2025-07-02 18:48:26.193
2025-07-02 18:48:26.199 If cursor is open, it's closed before new statement is executed.
2025-07-02 18:48:26.205 """
2025-07-02 18:48:26.210 > self._execute(operation, parameters)
2025-07-02 18:48:26.221
2025-07-02 18:48:26.230 ../lib/python3.11/site-packages/firebird/driver/core.py:3861:
2025-07-02 18:48:26.242 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-07-02 18:48:26.252
2025-07-02 18:48:26.263 self = <firebird.driver.core.Cursor object at [hex]>
2025-07-02 18:48:26.273 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-07-02 18:48:26.283 parameters = [3], flags = <CursorFlag.NONE: 0>
2025-07-02 18:48:26.297
2025-07-02 18:48:26.310 def _execute(self, operation: Union[str, Statement],
2025-07-02 18:48:26.322 parameters: Sequence=None, flags: CursorFlag=CursorFlag.NONE) -> None:
2025-07-02 18:48:26.334 if not self._transaction.is_active():
2025-07-02 18:48:26.345 self._transaction.begin()
2025-07-02 18:48:26.357 if isinstance(operation, Statement):
2025-07-02 18:48:26.364 if operation._connection() is not self._connection:
2025-07-02 18:48:26.372 raise InterfaceError('Cannot execute Statement that was created by different Connection.')
2025-07-02 18:48:26.379 self.close()
2025-07-02 18:48:26.385 self._stmt = operation
2025-07-02 18:48:26.398 self.__internal = False
2025-07-02 18:48:26.407 elif self._stmt is not None and self._stmt.sql == operation:
2025-07-02 18:48:26.418 # We should execute the same SQL string again
2025-07-02 18:48:26.426 self._clear()
2025-07-02 18:48:26.435 else:
2025-07-02 18:48:26.444 self.close()
2025-07-02 18:48:26.451 > self._stmt = self._connection._prepare(operation, self._transaction)
2025-07-02 18:48:26.458
2025-07-02 18:48:26.464 ../lib/python3.11/site-packages/firebird/driver/core.py:3731:
2025-07-02 18:48:26.470 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-07-02 18:48:26.475
2025-07-02 18:48:26.480 self = Connection[4313]
2025-07-02 18:48:26.485 sql = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-07-02 18:48:26.490 tra = <firebird.driver.core.TransactionManager object at [hex]>
2025-07-02 18:48:26.495
2025-07-02 18:48:26.500 def _prepare(self, sql: str, tra: TransactionManager) -> Statement:
2025-07-02 18:48:26.512 if _commit := not tra.is_active():
2025-07-02 18:48:26.524 tra.begin()
2025-07-02 18:48:26.536 > stmt = self._att.prepare(tra._tra, sql, self.__sql_dialect)
2025-07-02 18:48:26.547
2025-07-02 18:48:26.562 ../lib/python3.11/site-packages/firebird/driver/core.py:1723:
2025-07-02 18:48:26.573 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-07-02 18:48:26.580
2025-07-02 18:48:26.586 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2025-07-02 18:48:26.592 transaction = <firebird.driver.interfaces.iTransaction_v3 object at [hex]>
2025-07-02 18:48:26.598 stmt = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-07-02 18:48:26.609 dialect = 3, flags = <PreparePrefetchFlag.METADATA: 71>
2025-07-02 18:48:26.619
2025-07-02 18:48:26.628 def prepare(self, transaction: iTransaction, stmt: str, dialect: int,
2025-07-02 18:48:26.635 flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement:
2025-07-02 18:48:26.641 """Replaces `isc_dsql_prepare()`. Additional parameter flags makes it
2025-07-02 18:48:26.649 possible to control what information will be preloaded from engine at once
2025-07-02 18:48:26.655 (i.e. in single network packet for remote operation)."""
2025-07-02 18:48:26.661 b_stmt: bytes = stmt.encode(self.encoding)
2025-07-02 18:48:26.667 result = self.vtable.prepare(self, self.status, transaction, len(b_stmt), b_stmt,
2025-07-02 18:48:26.673 dialect, flags)
2025-07-02 18:48:26.679 > self._check()
2025-07-02 18:48:26.685
2025-07-02 18:48:26.694 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:1139:
2025-07-02 18:48:26.707 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-07-02 18:48:26.715
2025-07-02 18:48:26.725 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2025-07-02 18:48:26.737
2025-07-02 18:48:26.747 def _check(self) -> None:
2025-07-02 18:48:26.754 state = self.status.get_state()
2025-07-02 18:48:26.760 if StateFlag.ERRORS in state:
2025-07-02 18:48:26.767 > raise self.__report(DatabaseError, self.status.get_errors())
2025-07-02 18:48:26.776 E firebird.driver.types.DatabaseError: SQL error code = -104
2025-07-02 18:48:26.785 E -Datatypes are not comparable in expression
2025-07-02 18:48:26.795
2025-07-02 18:48:26.805 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
2025-07-02 18:48:26.813 ---------------------------- Captured stdout setup -----------------------------
2025-07-02 18:48:26.819 Creating db: localhost:/var/tmp/qa_2024/test_11197/test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=2.5')
def test_1(act: Action, capsys):
with act.db.connect() as con:
con.execute_immediate(proc_ddl)
con.commit()
c = con.cursor()
> for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
tests/bugs/core_6108_test.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.core.Cursor pytest object at [hex]>
operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
parameters = [3]
def execute(self, operation: Union[str, Statement], parameters: Sequence[Any]=None) -> Cursor:
"""Executes SQL command or prepared `Statement`.
Starts new transaction if transaction manager associated with cursor is not active.
Arguments:
operation: SQL command or prepared `Statement`.
parameters: Sequence of parameters. Must contain one entry for each argument
that the operation expects.
Returns:
`self` so call to execute could be used as iterator over returned rows.
Note:
If `operation` is a string with SQL command that is exactly the same as the
last executed command, the internally prepared `Statement` from last execution
is reused.
If cursor is open, it's closed before new statement is executed.
"""
> self._execute(operation, parameters)
../lib/python3.11/site-packages/firebird/driver/core.py:3861:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.core.Cursor pytest object at [hex]>
operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
parameters = [3], flags = <CursorFlag.NONE: 0>
def _execute(self, operation: Union[str, Statement],
parameters: Sequence=None, flags: CursorFlag=CursorFlag.NONE) -> None:
if not self._transaction.is_active():
self._transaction.begin()
if isinstance(operation, Statement):
if operation._connection() is not self._connection:
raise InterfaceError('Cannot execute Statement that was created by different Connection.')
self.close()
self._stmt = operation
self.__internal = False
elif self._stmt is not None and self._stmt.sql == operation:
# We should execute the same SQL string again
self._clear()
else:
self.close()
> self._stmt = self._connection._prepare(operation, self._transaction)
../lib/python3.11/site-packages/firebird/driver/core.py:3731:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Connection[4313]
sql = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
tra = <firebird.driver.core.TransactionManager pytest object at [hex]>
def _prepare(self, sql: str, tra: TransactionManager) -> Statement:
if _commit := not tra.is_active():
tra.begin()
> stmt = self._att.prepare(tra._tra, sql, self.__sql_dialect)
../lib/python3.11/site-packages/firebird/driver/core.py:1723:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.interfaces.iAttachment_v3 pytest object at [hex]>
transaction = <firebird.driver.interfaces.iTransaction_v3 pytest object at [hex]>
stmt = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
dialect = 3, flags = <PreparePrefetchFlag.METADATA: 71>
def prepare(self, transaction: iTransaction, stmt: str, dialect: int,
flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement:
"""Replaces `isc_dsql_prepare()`. Additional parameter flags makes it
possible to control what information will be preloaded from engine at once
(i.e. in single network packet for remote operation)."""
b_stmt: bytes = stmt.encode(self.encoding)
result = self.vtable.prepare(self, self.status, transaction, len(b_stmt), b_stmt,
dialect, flags)
> self._check()
../lib/python3.11/site-packages/firebird/driver/interfaces.py:1139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.interfaces.iAttachment_v3 pytest object at [hex]>
def _check(self) -> None:
state = self.status.get_state()
if StateFlag.ERRORS in state:
> raise self.__report(DatabaseError, self.status.get_errors())
E firebird.driver.types.DatabaseError: SQL error code = -104
E -Datatypes are not comparable in expression
../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
|