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_0117_test.py

72 lines
1.6 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 20:45:21 +01:00
"""
ID: issue-439
ISSUE: 439
TITLE: Expression evaluation not supported on LEFT JOIN
DESCRIPTION:
JIRA: CORE-117
FBTEST: bugs.core_0117
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
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
-- Output is fine in WI-V1.5.6.5026 and all above.
set list on;
recreate table t1(
id numeric( 18, 0) not null,
id2 numeric( 18,0),
date1 date,
constraint pk_t1 primary key (id)
);
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
recreate table t2(
id numeric( 18, 0) not null,
id2 numeric( 18,0),
date1 date,
constraint pk_t2 primary key (id)
);
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
insert into t1(id, id2, date1) values (1, 1, '10/13/2003');
insert into t1(id, id2, date1) values (2, 2, '09/13/2003');
insert into t2(id, id2, date1) values (1, 1, '09/13/2003');
commit;
2021-12-22 20:23:11 +01:00
2021-04-26 20:07:00 +02:00
--executing the following query in isql returns the error
--message "expression evaluation not supported" after
--retrieving the
--first row.
select t_1.id2, t_1.date1 as d1, t_2.date1 as d2
from t1 t_1
left join t2 t_2 on t_1.id2=t_2.id2
where
extract(month from t_1.date1)
<>
extract(month from t_2.date1)
;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
ID2 1
D1 2003-10-13
D2 2003-09-13
2021-12-22 20:23:11 +01:00
"""
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):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00