2 @message |
firebird.driver.types.DatabaseError: SQL error code = -104
-Datatypes are not comparable in expression
LOG DETAILS:
2025-06-30 18:21:27.534
2025-06-30 18:21:27.540 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-30 18:21:27.545 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-30 18:21:27.550
2025-06-30 18:21:27.556 @pytest.mark.version('>=2.5')
2025-06-30 18:21:27.561 def test_1(act: Action, capsys):
2025-06-30 18:21:27.566 with act.db.connect() as con:
2025-06-30 18:21:27.571 con.execute_immediate(proc_ddl)
2025-06-30 18:21:27.577 con.commit()
2025-06-30 18:21:27.583 c = con.cursor()
2025-06-30 18:21:27.589 > for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
2025-06-30 18:21:27.594
2025-06-30 18:21:27.600 tests/bugs/core_6108_test.py:37:
2025-06-30 18:21:27.610 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 18:21:27.624
2025-06-30 18:21:27.636 self = <firebird.driver.core.Cursor object at [hex]>
2025-06-30 18:21:27.647 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 18:21:27.656 parameters = [3]
2025-06-30 18:21:27.670
2025-06-30 18:21:27.681 def execute(self, operation: Union[str, Statement], parameters: Sequence[Any]=None) -> Cursor:
2025-06-30 18:21:27.694 """Executes SQL command or prepared `Statement`.
2025-06-30 18:21:27.706
2025-06-30 18:21:27.718 Starts new transaction if transaction manager associated with cursor is not active.
2025-06-30 18:21:27.731
2025-06-30 18:21:27.740 Arguments:
2025-06-30 18:21:27.748 operation: SQL command or prepared `Statement`.
2025-06-30 18:21:27.756 parameters: Sequence of parameters. Must contain one entry for each argument
2025-06-30 18:21:27.762 that the operation expects.
2025-06-30 18:21:27.769
2025-06-30 18:21:27.776 Returns:
2025-06-30 18:21:27.783 `self` so call to execute could be used as iterator over returned rows.
2025-06-30 18:21:27.789
2025-06-30 18:21:27.802 Note:
2025-06-30 18:21:27.812 If `operation` is a string with SQL command that is exactly the same as the
2025-06-30 18:21:27.820 last executed command, the internally prepared `Statement` from last execution
2025-06-30 18:21:27.827 is reused.
2025-06-30 18:21:27.835
2025-06-30 18:21:27.841 If cursor is open, it's closed before new statement is executed.
2025-06-30 18:21:27.847 """
2025-06-30 18:21:27.854 > self._execute(operation, parameters)
2025-06-30 18:21:27.860
2025-06-30 18:21:27.867 ../lib/python3.11/site-packages/firebird/driver/core.py:3861:
2025-06-30 18:21:27.874 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 18:21:27.886
2025-06-30 18:21:27.898 self = <firebird.driver.core.Cursor object at [hex]>
2025-06-30 18:21:27.908 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 18:21:27.915 parameters = [3], flags = <CursorFlag.NONE: 0>
2025-06-30 18:21:27.921
2025-06-30 18:21:27.932 def _execute(self, operation: Union[str, Statement],
2025-06-30 18:21:27.942 parameters: Sequence=None, flags: CursorFlag=CursorFlag.NONE) -> None:
2025-06-30 18:21:27.949 if not self._transaction.is_active():
2025-06-30 18:21:27.955 self._transaction.begin()
2025-06-30 18:21:27.961 if isinstance(operation, Statement):
2025-06-30 18:21:27.968 if operation._connection() is not self._connection:
2025-06-30 18:21:27.975 raise InterfaceError('Cannot execute Statement that was created by different Connection.')
2025-06-30 18:21:27.983 self.close()
2025-06-30 18:21:27.993 self._stmt = operation
2025-06-30 18:21:28.007 self.__internal = False
2025-06-30 18:21:28.016 elif self._stmt is not None and self._stmt.sql == operation:
2025-06-30 18:21:28.024 # We should execute the same SQL string again
2025-06-30 18:21:28.031 self._clear()
2025-06-30 18:21:28.037 else:
2025-06-30 18:21:28.042 self.close()
2025-06-30 18:21:28.047 > self._stmt = self._connection._prepare(operation, self._transaction)
2025-06-30 18:21:28.052
2025-06-30 18:21:28.058 ../lib/python3.11/site-packages/firebird/driver/core.py:3731:
2025-06-30 18:21:28.067 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 18:21:28.080
2025-06-30 18:21:28.089 self = Connection[4311]
2025-06-30 18:21:28.098 sql = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 18:21:28.109 tra = <firebird.driver.core.TransactionManager object at [hex]>
2025-06-30 18:21:28.118
2025-06-30 18:21:28.131 def _prepare(self, sql: str, tra: TransactionManager) -> Statement:
2025-06-30 18:21:28.142 if _commit := not tra.is_active():
2025-06-30 18:21:28.152 tra.begin()
2025-06-30 18:21:28.161 > stmt = self._att.prepare(tra._tra, sql, self.__sql_dialect)
2025-06-30 18:21:28.167
2025-06-30 18:21:28.173 ../lib/python3.11/site-packages/firebird/driver/core.py:1723:
2025-06-30 18:21:28.179 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 18:21:28.185
2025-06-30 18:21:28.191 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2025-06-30 18:21:28.197 transaction = <firebird.driver.interfaces.iTransaction_v3 object at [hex]>
2025-06-30 18:21:28.204 stmt = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 18:21:28.210 dialect = 3, flags = <PreparePrefetchFlag.METADATA: 71>
2025-06-30 18:21:28.215
2025-06-30 18:21:28.224 def prepare(self, transaction: iTransaction, stmt: str, dialect: int,
2025-06-30 18:21:28.234 flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement:
2025-06-30 18:21:28.242 """Replaces `isc_dsql_prepare()`. Additional parameter flags makes it
2025-06-30 18:21:28.248 possible to control what information will be preloaded from engine at once
2025-06-30 18:21:28.254 (i.e. in single network packet for remote operation)."""
2025-06-30 18:21:28.266 b_stmt: bytes = stmt.encode(self.encoding)
2025-06-30 18:21:28.277 result = self.vtable.prepare(self, self.status, transaction, len(b_stmt), b_stmt,
2025-06-30 18:21:28.287 dialect, flags)
2025-06-30 18:21:28.298 > self._check()
2025-06-30 18:21:28.308
2025-06-30 18:21:28.316 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:1139:
2025-06-30 18:21:28.323 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 18:21:28.328
2025-06-30 18:21:28.334 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2025-06-30 18:21:28.339
2025-06-30 18:21:28.346 def _check(self) -> None:
2025-06-30 18:21:28.357 state = self.status.get_state()
2025-06-30 18:21:28.365 if StateFlag.ERRORS in state:
2025-06-30 18:21:28.372 > raise self.__report(DatabaseError, self.status.get_errors())
2025-06-30 18:21:28.378 E firebird.driver.types.DatabaseError: SQL error code = -104
2025-06-30 18:21:28.385 E -Datatypes are not comparable in expression
2025-06-30 18:21:28.390
2025-06-30 18:21:28.396 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
2025-06-30 18:21:28.402 ---------------------------- Captured stdout setup -----------------------------
2025-06-30 18:21:28.408 Creating db: localhost:/var/tmp/qa_2024/test_11199/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[4311]
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
|