2 @message |
firebird.driver.types.DatabaseError: SQL error code = -104
-Datatypes are not comparable in expression
LOG DETAILS:
2025-06-30 17:18:32.655
2025-06-30 17:18:32.665 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-30 17:18:32.675 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-30 17:18:32.683
2025-06-30 17:18:32.691 @pytest.mark.version('>=2.5')
2025-06-30 17:18:32.698 def test_1(act: Action, capsys):
2025-06-30 17:18:32.708 with act.db.connect() as con:
2025-06-30 17:18:32.719 con.execute_immediate(proc_ddl)
2025-06-30 17:18:32.727 con.commit()
2025-06-30 17:18:32.734 c = con.cursor()
2025-06-30 17:18:32.745 > for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
2025-06-30 17:18:32.757
2025-06-30 17:18:32.768 tests/bugs/core_6108_test.py:37:
2025-06-30 17:18:32.781 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 17:18:32.794
2025-06-30 17:18:32.804 self = <firebird.driver.core.Cursor object at [hex]>
2025-06-30 17:18:32.813 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 17:18:32.826 parameters = [3]
2025-06-30 17:18:32.835
2025-06-30 17:18:32.844 def execute(self, operation: Union[str, Statement], parameters: Sequence[Any]=None) -> Cursor:
2025-06-30 17:18:32.852 """Executes SQL command or prepared `Statement`.
2025-06-30 17:18:32.859
2025-06-30 17:18:32.866 Starts new transaction if transaction manager associated with cursor is not active.
2025-06-30 17:18:32.872
2025-06-30 17:18:32.877 Arguments:
2025-06-30 17:18:32.882 operation: SQL command or prepared `Statement`.
2025-06-30 17:18:32.891 parameters: Sequence of parameters. Must contain one entry for each argument
2025-06-30 17:18:32.898 that the operation expects.
2025-06-30 17:18:32.905
2025-06-30 17:18:32.912 Returns:
2025-06-30 17:18:32.920 `self` so call to execute could be used as iterator over returned rows.
2025-06-30 17:18:32.928
2025-06-30 17:18:32.935 Note:
2025-06-30 17:18:32.943 If `operation` is a string with SQL command that is exactly the same as the
2025-06-30 17:18:32.955 last executed command, the internally prepared `Statement` from last execution
2025-06-30 17:18:32.964 is reused.
2025-06-30 17:18:32.973
2025-06-30 17:18:32.979 If cursor is open, it's closed before new statement is executed.
2025-06-30 17:18:32.986 """
2025-06-30 17:18:32.993 > self._execute(operation, parameters)
2025-06-30 17:18:33.000
2025-06-30 17:18:33.007 ../lib/python3.11/site-packages/firebird/driver/core.py:3861:
2025-06-30 17:18:33.014 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 17:18:33.020
2025-06-30 17:18:33.027 self = <firebird.driver.core.Cursor object at [hex]>
2025-06-30 17:18:33.035 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 17:18:33.041 parameters = [3], flags = <CursorFlag.NONE: 0>
2025-06-30 17:18:33.046
2025-06-30 17:18:33.051 def _execute(self, operation: Union[str, Statement],
2025-06-30 17:18:33.057 parameters: Sequence=None, flags: CursorFlag=CursorFlag.NONE) -> None:
2025-06-30 17:18:33.062 if not self._transaction.is_active():
2025-06-30 17:18:33.068 self._transaction.begin()
2025-06-30 17:18:33.075 if isinstance(operation, Statement):
2025-06-30 17:18:33.083 if operation._connection() is not self._connection:
2025-06-30 17:18:33.091 raise InterfaceError('Cannot execute Statement that was created by different Connection.')
2025-06-30 17:18:33.100 self.close()
2025-06-30 17:18:33.111 self._stmt = operation
2025-06-30 17:18:33.120 self.__internal = False
2025-06-30 17:18:33.127 elif self._stmt is not None and self._stmt.sql == operation:
2025-06-30 17:18:33.133 # We should execute the same SQL string again
2025-06-30 17:18:33.140 self._clear()
2025-06-30 17:18:33.147 else:
2025-06-30 17:18:33.155 self.close()
2025-06-30 17:18:33.165 > self._stmt = self._connection._prepare(operation, self._transaction)
2025-06-30 17:18:33.173
2025-06-30 17:18:33.181 ../lib/python3.11/site-packages/firebird/driver/core.py:3731:
2025-06-30 17:18:33.188 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 17:18:33.196
2025-06-30 17:18:33.204 self = Connection[4313]
2025-06-30 17:18:33.212 sql = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 17:18:33.219 tra = <firebird.driver.core.TransactionManager object at [hex]>
2025-06-30 17:18:33.226
2025-06-30 17:18:33.235 def _prepare(self, sql: str, tra: TransactionManager) -> Statement:
2025-06-30 17:18:33.247 if _commit := not tra.is_active():
2025-06-30 17:18:33.256 tra.begin()
2025-06-30 17:18:33.262 > stmt = self._att.prepare(tra._tra, sql, self.__sql_dialect)
2025-06-30 17:18:33.268
2025-06-30 17:18:33.274 ../lib/python3.11/site-packages/firebird/driver/core.py:1723:
2025-06-30 17:18:33.280 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 17:18:33.286
2025-06-30 17:18:33.293 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2025-06-30 17:18:33.300 transaction = <firebird.driver.interfaces.iTransaction_v3 object at [hex]>
2025-06-30 17:18:33.306 stmt = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2025-06-30 17:18:33.315 dialect = 3, flags = <PreparePrefetchFlag.METADATA: 71>
2025-06-30 17:18:33.322
2025-06-30 17:18:33.329 def prepare(self, transaction: iTransaction, stmt: str, dialect: int,
2025-06-30 17:18:33.336 flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement:
2025-06-30 17:18:33.343 """Replaces `isc_dsql_prepare()`. Additional parameter flags makes it
2025-06-30 17:18:33.351 possible to control what information will be preloaded from engine at once
2025-06-30 17:18:33.363 (i.e. in single network packet for remote operation)."""
2025-06-30 17:18:33.370 b_stmt: bytes = stmt.encode(self.encoding)
2025-06-30 17:18:33.376 result = self.vtable.prepare(self, self.status, transaction, len(b_stmt), b_stmt,
2025-06-30 17:18:33.382 dialect, flags)
2025-06-30 17:18:33.388 > self._check()
2025-06-30 17:18:33.393
2025-06-30 17:18:33.398 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:1139:
2025-06-30 17:18:33.403 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-06-30 17:18:33.409
2025-06-30 17:18:33.414 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2025-06-30 17:18:33.419
2025-06-30 17:18:33.425 def _check(self) -> None:
2025-06-30 17:18:33.431 state = self.status.get_state()
2025-06-30 17:18:33.443 if StateFlag.ERRORS in state:
2025-06-30 17:18:33.451 > raise self.__report(DatabaseError, self.status.get_errors())
2025-06-30 17:18:33.459 E firebird.driver.types.DatabaseError: SQL error code = -104
2025-06-30 17:18:33.467 E -Datatypes are not comparable in expression
2025-06-30 17:18:33.474
2025-06-30 17:18:33.480 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
2025-06-30 17:18:33.486 ---------------------------- Captured stdout setup -----------------------------
2025-06-30 17:18:33.492 Creating db: localhost:/var/tmp/qa_2024/test_11200/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
|