2 @message |
firebird.driver.types.DatabaseError: SQL error code = -104
-Datatypes are not comparable in expression
LOG DETAILS:
2024-11-23 10:02:08.174
2024-11-23 10:02:08.179 act = <firebird.qa.plugin.Action object at [hex]>
2024-11-23 10:02:08.184 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-11-23 10:02:08.189
2024-11-23 10:02:08.194 @pytest.mark.version('>=2.5')
2024-11-23 10:02:08.200 def test_1(act: Action, capsys):
2024-11-23 10:02:08.205 with act.db.connect() as con:
2024-11-23 10:02:08.210 con.execute_immediate(proc_ddl)
2024-11-23 10:02:08.215 con.commit()
2024-11-23 10:02:08.220 c = con.cursor()
2024-11-23 10:02:08.225 > for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
2024-11-23 10:02:08.231
2024-11-23 10:02:08.237 tests/bugs/core_6108_test.py:37:
2024-11-23 10:02:08.241 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-11-23 10:02:08.246
2024-11-23 10:02:08.250 self = <firebird.driver.core.Cursor object at [hex]>
2024-11-23 10:02:08.255 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-11-23 10:02:08.261 parameters = [3]
2024-11-23 10:02:08.265
2024-11-23 10:02:08.272 def execute(self, operation: Union[str, Statement], parameters: Sequence[Any]=None) -> Cursor:
2024-11-23 10:02:08.281 """Executes SQL command or prepared `Statement`.
2024-11-23 10:02:08.288
2024-11-23 10:02:08.293 Starts new transaction if transaction manager associated with cursor is not active.
2024-11-23 10:02:08.298
2024-11-23 10:02:08.303 Arguments:
2024-11-23 10:02:08.308 operation: SQL command or prepared `Statement`.
2024-11-23 10:02:08.316 parameters: Sequence of parameters. Must contain one entry for each argument
2024-11-23 10:02:08.326 that the operation expects.
2024-11-23 10:02:08.331
2024-11-23 10:02:08.336 Returns:
2024-11-23 10:02:08.343 `self` so call to execute could be used as iterator over returned rows.
2024-11-23 10:02:08.352
2024-11-23 10:02:08.358 Note:
2024-11-23 10:02:08.364 If `operation` is a string with SQL command that is exactly the same as the
2024-11-23 10:02:08.369 last executed command, the internally prepared `Statement` from last execution
2024-11-23 10:02:08.374 is reused.
2024-11-23 10:02:08.379
2024-11-23 10:02:08.383 If cursor is open, it's closed before new statement is executed.
2024-11-23 10:02:08.388 """
2024-11-23 10:02:08.395 > self._execute(operation, parameters)
2024-11-23 10:02:08.402
2024-11-23 10:02:08.409 ../lib/python3.11/site-packages/firebird/driver/core.py:3755:
2024-11-23 10:02:08.413 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-11-23 10:02:08.419
2024-11-23 10:02:08.427 self = <firebird.driver.core.Cursor object at [hex]>
2024-11-23 10:02:08.432 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-11-23 10:02:08.438 parameters = [3], flags = <CursorFlag.NONE: 0>
2024-11-23 10:02:08.443
2024-11-23 10:02:08.448 def _execute(self, operation: Union[str, Statement],
2024-11-23 10:02:08.453 parameters: Sequence=None, flags: CursorFlag=CursorFlag.NONE) -> None:
2024-11-23 10:02:08.459 if not self._transaction.is_active():
2024-11-23 10:02:08.469 self._transaction.begin()
2024-11-23 10:02:08.477 if isinstance(operation, Statement):
2024-11-23 10:02:08.482 if operation._connection() is not self._connection:
2024-11-23 10:02:08.487 raise InterfaceError('Cannot execute Statement that was created by different Connection.')
2024-11-23 10:02:08.493 self.close()
2024-11-23 10:02:08.500 self._stmt = operation
2024-11-23 10:02:08.505 self.__internal = False
2024-11-23 10:02:08.512 elif self._stmt is not None and self._stmt.sql == operation:
2024-11-23 10:02:08.520 # We should execute the same SQL string again
2024-11-23 10:02:08.526 self._clear()
2024-11-23 10:02:08.531 else:
2024-11-23 10:02:08.536 self.close()
2024-11-23 10:02:08.541 > self._stmt = self._connection._prepare(operation, self._transaction)
2024-11-23 10:02:08.547
2024-11-23 10:02:08.553 ../lib/python3.11/site-packages/firebird/driver/core.py:3625:
2024-11-23 10:02:08.559 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-11-23 10:02:08.564
2024-11-23 10:02:08.570 self = Connection[4311]
2024-11-23 10:02:08.575 sql = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-11-23 10:02:08.580 tra = <firebird.driver.core.TransactionManager object at [hex]>
2024-11-23 10:02:08.585
2024-11-23 10:02:08.591 def _prepare(self, sql: str, tra: TransactionManager) -> Statement:
2024-11-23 10:02:08.601 if _commit := not tra.is_active():
2024-11-23 10:02:08.607 tra.begin()
2024-11-23 10:02:08.613 > stmt = self._att.prepare(tra._tra, sql, self.__sql_dialect)
2024-11-23 10:02:08.618
2024-11-23 10:02:08.625 ../lib/python3.11/site-packages/firebird/driver/core.py:1713:
2024-11-23 10:02:08.630 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-11-23 10:02:08.635
2024-11-23 10:02:08.640 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2024-11-23 10:02:08.645 transaction = <firebird.driver.interfaces.iTransaction_v3 object at [hex]>
2024-11-23 10:02:08.650 stmt = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-11-23 10:02:08.655 dialect = 3, flags = <PreparePrefetchFlag.METADATA: 71>
2024-11-23 10:02:08.660
2024-11-23 10:02:08.666 def prepare(self, transaction: iTransaction, stmt: str, dialect: int,
2024-11-23 10:02:08.673 flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement:
2024-11-23 10:02:08.679 """Replaces `isc_dsql_prepare()`. Additional parameter flags makes it
2024-11-23 10:02:08.683 possible to control what information will be preloaded from engine at once
2024-11-23 10:02:08.688 (i.e. in single network packet for remote operation)."""
2024-11-23 10:02:08.693 b_stmt: bytes = stmt.encode(self.encoding)
2024-11-23 10:02:08.698 result = self.vtable.prepare(self, self.status, transaction, len(b_stmt), b_stmt,
2024-11-23 10:02:08.702 dialect, flags)
2024-11-23 10:02:08.707 > self._check()
2024-11-23 10:02:08.712
2024-11-23 10:02:08.717 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:1134:
2024-11-23 10:02:08.723 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-11-23 10:02:08.729
2024-11-23 10:02:08.734 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2024-11-23 10:02:08.739
2024-11-23 10:02:08.744 def _check(self) -> None:
2024-11-23 10:02:08.748 state = self.status.get_state()
2024-11-23 10:02:08.757 if StateFlag.ERRORS in state:
2024-11-23 10:02:08.765 > raise self.__report(DatabaseError, self.status.get_errors())
2024-11-23 10:02:08.773 E firebird.driver.types.DatabaseError: SQL error code = -104
2024-11-23 10:02:08.780 E -Datatypes are not comparable in expression
2024-11-23 10:02:08.791
2024-11-23 10:02:08.796 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
2024-11-23 10:02:08.801 ---------------------------- Captured stdout setup -----------------------------
2024-11-23 10:02:08.806 Creating db: localhost:/var/tmp/qa_2024/test_11210/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:3755:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:3625:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:1713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:1134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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
|