6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_2977_test.py

48 lines
1.2 KiB
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-3359
ISSUE: 3359
TITLE: FB 2.1 incorrectly works with indexed fields of type DATE in OLD ODS (9.1)
DESCRIPTION:
JIRA: CORE-2977
FBTEST: bugs.core_2977
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
db = db_factory(sql_dialect=1)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
recreate table test(id int, opdate timestamp);
insert into test values(1, '31.12.2000');
insert into test values(2, '01.01.2001');
insert into test values(3, '02.01.2001');
insert into test values(4, '03.01.2001');
commit;
create index test_opdate on test(opdate);
commit;
set list on;
2021-10-21 19:29:23 +02:00
-- Following query will have PLAN (TEST INDEX (TEST_OPDATE))
2021-04-26 20:07:00 +02:00
select * from test where opdate <= '1/1/2001';
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
act = isql_act('db', test_script, substitutions=[('01-JAN-', ' 1-JAN-')])
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
expected_stdout = """
2021-10-21 19:29:23 +02:00
ID 1
OPDATE 31-DEC-2000
ID 2
OPDATE 1-JAN-2001
2021-08-03 23:29:08 +02:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00