2 @message |
firebird.driver.types.DatabaseError: SQL error code = -104
-Datatypes are not comparable in expression
LOG DETAILS:
2024-10-14 04:59:01.063
2024-10-14 04:59:01.069 act = <firebird.qa.plugin.Action object at [hex]>
2024-10-14 04:59:01.075 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-10-14 04:59:01.082
2024-10-14 04:59:01.087 @pytest.mark.version('>=2.5')
2024-10-14 04:59:01.092 def test_1(act: Action, capsys):
2024-10-14 04:59:01.097 with act.db.connect() as con:
2024-10-14 04:59:01.103 con.execute_immediate(proc_ddl)
2024-10-14 04:59:01.109 con.commit()
2024-10-14 04:59:01.115 c = con.cursor()
2024-10-14 04:59:01.121 > for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
2024-10-14 04:59:01.126
2024-10-14 04:59:01.131 tests/bugs/core_6108_test.py:37:
2024-10-14 04:59:01.137 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-10-14 04:59:01.142
2024-10-14 04:59:01.148 self = <firebird.driver.core.Cursor object at [hex]>
2024-10-14 04:59:01.153 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-10-14 04:59:01.159 parameters = [3]
2024-10-14 04:59:01.166
2024-10-14 04:59:01.176 def execute(self, operation: Union[str, Statement], parameters: Sequence[Any]=None) -> Cursor:
2024-10-14 04:59:01.183 """Executes SQL command or prepared `Statement`.
2024-10-14 04:59:01.189
2024-10-14 04:59:01.195 Starts new transaction if transaction manager associated with cursor is not active.
2024-10-14 04:59:01.201
2024-10-14 04:59:01.205 Arguments:
2024-10-14 04:59:01.209 operation: SQL command or prepared `Statement`.
2024-10-14 04:59:01.214 parameters: Sequence of parameters. Must contain one entry for each argument
2024-10-14 04:59:01.218 that the operation expects.
2024-10-14 04:59:01.223
2024-10-14 04:59:01.228 Returns:
2024-10-14 04:59:01.233 `self` so call to execute could be used as iterator over returned rows.
2024-10-14 04:59:01.238
2024-10-14 04:59:01.243 Note:
2024-10-14 04:59:01.248 If `operation` is a string with SQL command that is exactly the same as the
2024-10-14 04:59:01.254 last executed command, the internally prepared `Statement` from last execution
2024-10-14 04:59:01.259 is reused.
2024-10-14 04:59:01.264
2024-10-14 04:59:01.269 If cursor is open, it's closed before new statement is executed.
2024-10-14 04:59:01.274 """
2024-10-14 04:59:01.279 > self._execute(operation, parameters)
2024-10-14 04:59:01.284
2024-10-14 04:59:01.289 ../lib/python3.11/site-packages/firebird/driver/core.py:3755:
2024-10-14 04:59:01.294 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-10-14 04:59:01.298
2024-10-14 04:59:01.303 self = <firebird.driver.core.Cursor object at [hex]>
2024-10-14 04:59:01.312 operation = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-10-14 04:59:01.320 parameters = [3], flags = <CursorFlag.NONE: 0>
2024-10-14 04:59:01.325
2024-10-14 04:59:01.335 def _execute(self, operation: Union[str, Statement],
2024-10-14 04:59:01.343 parameters: Sequence=None, flags: CursorFlag=CursorFlag.NONE) -> None:
2024-10-14 04:59:01.349 if not self._transaction.is_active():
2024-10-14 04:59:01.354 self._transaction.begin()
2024-10-14 04:59:01.360 if isinstance(operation, Statement):
2024-10-14 04:59:01.365 if operation._connection() is not self._connection:
2024-10-14 04:59:01.371 raise InterfaceError('Cannot execute Statement that was created by different Connection.')
2024-10-14 04:59:01.377 self.close()
2024-10-14 04:59:01.383 self._stmt = operation
2024-10-14 04:59:01.388 self.__internal = False
2024-10-14 04:59:01.393 elif self._stmt is not None and self._stmt.sql == operation:
2024-10-14 04:59:01.397 # We should execute the same SQL string again
2024-10-14 04:59:01.402 self._clear()
2024-10-14 04:59:01.406 else:
2024-10-14 04:59:01.410 self.close()
2024-10-14 04:59:01.416 > self._stmt = self._connection._prepare(operation, self._transaction)
2024-10-14 04:59:01.420
2024-10-14 04:59:01.425 ../lib/python3.11/site-packages/firebird/driver/core.py:3625:
2024-10-14 04:59:01.431 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-10-14 04:59:01.438
2024-10-14 04:59:01.444 self = Connection[4299]
2024-10-14 04:59:01.451 sql = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-10-14 04:59:01.458 tra = <firebird.driver.core.TransactionManager object at [hex]>
2024-10-14 04:59:01.464
2024-10-14 04:59:01.471 def _prepare(self, sql: str, tra: TransactionManager) -> Statement:
2024-10-14 04:59:01.476 if _commit := not tra.is_active():
2024-10-14 04:59:01.484 tra.begin()
2024-10-14 04:59:01.490 > stmt = self._att.prepare(tra._tra, sql, self.__sql_dialect)
2024-10-14 04:59:01.498
2024-10-14 04:59:01.505 ../lib/python3.11/site-packages/firebird/driver/core.py:1713:
2024-10-14 04:59:01.511 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-10-14 04:59:01.517
2024-10-14 04:59:01.522 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2024-10-14 04:59:01.527 transaction = <firebird.driver.interfaces.iTransaction_v3 object at [hex]>
2024-10-14 04:59:01.534 stmt = "select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
2024-10-14 04:59:01.541 dialect = 3, flags = <PreparePrefetchFlag.METADATA: 71>
2024-10-14 04:59:01.546
2024-10-14 04:59:01.551 def prepare(self, transaction: iTransaction, stmt: str, dialect: int,
2024-10-14 04:59:01.555 flags: PreparePrefetchFlag = PreparePrefetchFlag.METADATA) -> iStatement:
2024-10-14 04:59:01.560 """Replaces `isc_dsql_prepare()`. Additional parameter flags makes it
2024-10-14 04:59:01.566 possible to control what information will be preloaded from engine at once
2024-10-14 04:59:01.573 (i.e. in single network packet for remote operation)."""
2024-10-14 04:59:01.578 b_stmt: bytes = stmt.encode(self.encoding)
2024-10-14 04:59:01.583 result = self.vtable.prepare(self, self.status, transaction, len(b_stmt), b_stmt,
2024-10-14 04:59:01.590 dialect, flags)
2024-10-14 04:59:01.596 > self._check()
2024-10-14 04:59:01.601
2024-10-14 04:59:01.606 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:1134:
2024-10-14 04:59:01.612 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-10-14 04:59:01.617
2024-10-14 04:59:01.625 self = <firebird.driver.interfaces.iAttachment_v3 object at [hex]>
2024-10-14 04:59:01.635
2024-10-14 04:59:01.641 def _check(self) -> None:
2024-10-14 04:59:01.648 state = self.status.get_state()
2024-10-14 04:59:01.655 if StateFlag.ERRORS in state:
2024-10-14 04:59:01.661 > raise self.__report(DatabaseError, self.status.get_errors())
2024-10-14 04:59:01.666 E firebird.driver.types.DatabaseError: SQL error code = -104
2024-10-14 04:59:01.671 E -Datatypes are not comparable in expression
2024-10-14 04:59:01.677
2024-10-14 04:59:01.681 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
2024-10-14 04:59:01.686 ---------------------------- Captured stdout setup -----------------------------
2024-10-14 04:59:01.692 Creating db: localhost:/var/tmp/qa_2024/test_11204/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[4299]
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
|