2 @message |
firebird.driver.types.DatabaseError: SQL error code = -104
-Datatypes are not comparable in expression
LOG DETAILS:
2024-05-12 18:17:14.106
2024-05-12 18:17:14.110 act = <firebird.qa.plugin.Action object at [hex]>
2024-05-12 18:17:14.115 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-05-12 18:17:14.120
2024-05-12 18:17:14.124 @pytest.mark.version('>=2.5')
2024-05-12 18:17:14.129 def test_1(act: Action, capsys):
2024-05-12 18:17:14.134 with act.db.connect() as con:
2024-05-12 18:17:14.138 con.execute_immediate(proc_ddl)
2024-05-12 18:17:14.143 con.commit()
2024-05-12 18:17:14.148 c = con.cursor()
2024-05-12 18:17:14.152 > for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
2024-05-12 18:17:14.157
2024-05-12 18:17:14.161 tests/bugs/core_6108_test.py:37:
2024-05-12 18:17:14.166 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 18:17:14.170
2024-05-12 18:17:14.175 self = <firebird.driver.core.Cursor object at [hex]>
2024-05-12 18:17:14.180 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-05-12 18:17:14.184 parameters = [3]
2024-05-12 18:17:14.189
2024-05-12 18:17:14.193 def execute(self, operation: Union[str, Statement], parameters: Sequence[Any]=None) -> Cursor:
2024-05-12 18:17:14.198 """Executes SQL command or prepared `Statement`.
2024-05-12 18:17:14.203
2024-05-12 18:17:14.207 Starts new transaction if transaction manager associated with cursor is not active.
2024-05-12 18:17:14.212
2024-05-12 18:17:14.216 Arguments:
2024-05-12 18:17:14.221 operation: SQL command or prepared `Statement`.
2024-05-12 18:17:14.225 parameters: Sequence of parameters. Must contain one entry for each argument
2024-05-12 18:17:14.230 that the operation expects.
2024-05-12 18:17:14.235
2024-05-12 18:17:14.240 Returns:
2024-05-12 18:17:14.244 `self` so call to execute could be used as iterator over returned rows.
2024-05-12 18:17:14.249
2024-05-12 18:17:14.253 Note:
2024-05-12 18:17:14.258 If `operation` is a string with SQL command that is exactly the same as the
2024-05-12 18:17:14.263 last executed command, the internally prepared `Statement` from last execution
2024-05-12 18:17:14.267 is reused.
2024-05-12 18:17:14.272
2024-05-12 18:17:14.278 If cursor is open, it's closed before new statement is executed.
2024-05-12 18:17:14.284 """
2024-05-12 18:17:14.289 > self._execute(operation, parameters)
2024-05-12 18:17:14.294
2024-05-12 18:17:14.299 ../lib/python3.11/site-packages/firebird/driver/core.py:3754:
2024-05-12 18:17:14.304 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 18:17:14.309
2024-05-12 18:17:14.314 self = <firebird.driver.core.Cursor object at [hex]>
2024-05-12 18:17:14.319 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-05-12 18:17:14.324 parameters = [3], flags = <CursorFlag.NONE: 0>
2024-05-12 18:17:14.328
2024-05-12 18:17:14.333 def _execute(self, operation: Union[str, Statement],
2024-05-12 18:17:14.337 parameters: Sequence=None, flags: CursorFlag=CursorFlag.NONE) -> None:
2024-05-12 18:17:14.342 if not self._transaction.is_active():
2024-05-12 18:17:14.347 self._transaction.begin()
2024-05-12 18:17:14.352 if isinstance(operation, Statement):
2024-05-12 18:17:14.357 if operation._connection() is not self._connection:
2024-05-12 18:17:14.361 raise InterfaceError('Cannot execute Statement that was created by different Connection.')
2024-05-12 18:17:14.367 self.close()
2024-05-12 18:17:14.372 self._stmt = operation
2024-05-12 18:17:14.377 self.__internal = False
2024-05-12 18:17:14.381 elif self._stmt is not None and self._stmt.sql == operation:
2024-05-12 18:17:14.386 # We should execute the same SQL string again
2024-05-12 18:17:14.391 self._clear()
2024-05-12 18:17:14.395 else:
2024-05-12 18:17:14.400 self.close()
2024-05-12 18:17:14.404 > self._stmt = self._connection._prepare(operation, self._transaction)
2024-05-12 18:17:14.409
2024-05-12 18:17:14.413 ../lib/python3.11/site-packages/firebird/driver/core.py:3624:
2024-05-12 18:17:14.418 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 18:17:14.422
2024-05-12 18:17:14.427 self = Connection[3160]
2024-05-12 18:17:14.432 sql = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-05-12 18:17:14.436 tra = <firebird.driver.core.TransactionManager object at [hex]>
2024-05-12 18:17:14.440
2024-05-12 18:17:14.447 def _prepare(self, sql: str, tra: TransactionManager) -> Statement:
2024-05-12 18:17:14.451 if _commit := not tra.is_active():
2024-05-12 18:17:14.457 tra.begin()
2024-05-12 18:17:14.463 > stmt = self._att.prepare(tra._tra, sql, self.__sql_dialect)
2024-05-12 18:17:14.468
2024-05-12 18:17:14.473 ../lib/python3.11/site-packages/firebird/driver/core.py:1713:
2024-05-12 18:17:14.477 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 18:17:14.482
2024-05-12 18:17:14.487 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2024-05-12 18:17:14.492 transaction = <firebird.driver.interfaces.iTransaction_v3 object at [hex]>
2024-05-12 18:17:14.496 stmt = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-05-12 18:17:14.501 dialect = 3, flags = <PreparePrefetchFlag.METADATA: 71>
2024-05-12 18:17:14.505
2024-05-12 18:17:14.512 def prepare(self, transaction: iTransaction, stmt: str, dialect: int,
2024-05-12 18:17:14.519 flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement:
2024-05-12 18:17:14.526 """Replaces `isc_dsql_prepare()`. Additional parameter flags makes it
2024-05-12 18:17:14.532 possible to control what information will be preloaded from engine at once
2024-05-12 18:17:14.539 (i.e. in single network packet for remote operation)."""
2024-05-12 18:17:14.545 b_stmt: bytes = stmt.encode(self.encoding)
2024-05-12 18:17:14.550 result = self.vtable.prepare(self, self.status, transaction, len(b_stmt), b_stmt,
2024-05-12 18:17:14.555 dialect, flags)
2024-05-12 18:17:14.560 > self._check()
2024-05-12 18:17:14.564
2024-05-12 18:17:14.569 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:1134:
2024-05-12 18:17:14.573 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 18:17:14.578
2024-05-12 18:17:14.584 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2024-05-12 18:17:14.588
2024-05-12 18:17:14.592 def _check(self) -> None:
2024-05-12 18:17:14.597 state = self.status.get_state()
2024-05-12 18:17:14.602 if StateFlag.ERRORS in state:
2024-05-12 18:17:14.608 > raise self.__report(DatabaseError, self.status.get_errors())
2024-05-12 18:17:14.614 E firebird.driver.types.DatabaseError: SQL error code = -104
2024-05-12 18:17:14.620 E -Datatypes are not comparable in expression
2024-05-12 18:17:14.625
2024-05-12 18:17:14.629 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
2024-05-12 18:17:14.634 ---------------------------- Captured stdout setup -----------------------------
2024-05-12 18:17:14.638 Cached db: db-12.0-None-None-NONE.fdb [page_size=None, sql_dialect=None, charset='NONE'
|
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:3754:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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:3624:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Connection[3160]
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
|