2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
"""
|
|
|
|
ID: issue-1330
|
|
|
|
ISSUE: 1330
|
|
|
|
TITLE: Bug in DSQL parameter
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-336
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_0929
|
2022-01-18 20:45:21 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
init_script = """CREATE TABLE TEST (MYDATE DATE NOT NULL PRIMARY KEY);
|
2021-04-26 20:07:00 +02:00
|
|
|
COMMIT;
|
|
|
|
|
|
|
|
INSERT INTO TEST VALUES (CURRENT_DATE);
|
|
|
|
INSERT INTO TEST VALUES (CURRENT_DATE + 1);
|
|
|
|
INSERT INTO TEST VALUES (CURRENT_DATE + 2);
|
|
|
|
INSERT INTO TEST VALUES (CURRENT_DATE + 3);
|
|
|
|
COMMIT;
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
db = db_factory(init=init_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
act = python_act('db')
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-18 20:45:21 +01:00
|
|
|
@pytest.mark.version('>=3')
|
|
|
|
def test_1(act: Action):
|
|
|
|
with act.db.connect() as con:
|
2021-11-10 19:02:05 +01:00
|
|
|
c = con.cursor()
|
|
|
|
try:
|
|
|
|
c.prepare('SELECT * FROM TEST WHERE MYDATE + CAST(? AS INTEGER) >= ?')
|
|
|
|
except:
|
|
|
|
pytest.fail("Test FAILED")
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|