mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-02-02 02:40:42 +01:00
Put test into proper folder.
This commit is contained in:
parent
5499a5e88a
commit
a2887dbae0
@ -1,30 +1,21 @@
|
|||||||
#coding:utf-8
|
#coding:utf-8
|
||||||
#
|
|
||||||
# id: full_join_push_where_predicate
|
"""
|
||||||
# title: WHERE-filter must be applied after FULL JOIN result
|
ID: issue.full-join-push-where-predicate
|
||||||
# decription:
|
TITLE: WHERE-filter must be applied after FULL JOIN result
|
||||||
# See (rus): https://www.sql.ru/forum/1326682/dva-cte-ih-full-join-i-uslovie-daut-nekorrektnyy-rezultat
|
DESCRIPTION:
|
||||||
# Confirmed bug on 2.5.9.27151.
|
See (rus): https://www.sql.ru/forum/1326682/dva-cte-ih-full-join-i-uslovie-daut-nekorrektnyy-rezultat
|
||||||
# Checked on 3.0.6.33322, 4.0.0.2073 -- all fine.
|
Confirmed bug on 2.5.9.27151.
|
||||||
#
|
Checked on 3.0.6.33322, 4.0.0.2073 -- all fine.
|
||||||
# tracker_id:
|
FBTEST: full_join_push_where_predicate
|
||||||
# min_versions: ['2.5.0']
|
"""
|
||||||
# versions: 2.5
|
|
||||||
# qmid: None
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from firebird.qa import db_factory, isql_act, Action
|
from firebird.qa import *
|
||||||
|
|
||||||
# version: 2.5
|
db = db_factory()
|
||||||
# resources: None
|
|
||||||
|
|
||||||
substitutions_1 = [('[ \t]+', ' ')]
|
test_script = """
|
||||||
|
|
||||||
init_script_1 = """"""
|
|
||||||
|
|
||||||
db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
|
||||||
|
|
||||||
test_script_1 = """
|
|
||||||
set list on;
|
set list on;
|
||||||
|
|
||||||
recreate table t (
|
recreate table t (
|
||||||
@ -51,18 +42,17 @@ test_script_1 = """
|
|||||||
where t1.f1 is null
|
where t1.f1 is null
|
||||||
order by 1,2
|
order by 1,2
|
||||||
;
|
;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
|
||||||
|
|
||||||
expected_stdout_1 = """
|
expected_stdout = """
|
||||||
T1_F1 <null>
|
T1_F1 <null>
|
||||||
T2_F1 d
|
T2_F1 d
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@pytest.mark.version('>=2.5')
|
|
||||||
def test_1(act_1: Action):
|
|
||||||
act_1.expected_stdout = expected_stdout_1
|
|
||||||
act_1.execute()
|
|
||||||
assert act_1.clean_expected_stdout == act_1.clean_stdout
|
|
||||||
|
|
||||||
|
@pytest.mark.version('>=3.0')
|
||||||
|
def test_1(act: Action):
|
||||||
|
act.expected_stdout = expected_stdout
|
||||||
|
act.execute()
|
||||||
|
assert act.clean_stdout == act.clean_expected_stdout
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
#coding:utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
ID: issue.full-join-push-where-predicate
|
|
||||||
TITLE: WHERE-filter must be applied after FULL JOIN result
|
|
||||||
DESCRIPTION:
|
|
||||||
See (rus): https://www.sql.ru/forum/1326682/dva-cte-ih-full-join-i-uslovie-daut-nekorrektnyy-rezultat
|
|
||||||
Confirmed bug on 2.5.9.27151.
|
|
||||||
Checked on 3.0.6.33322, 4.0.0.2073 -- all fine.
|
|
||||||
FBTEST: full_join_push_where_predicate
|
|
||||||
"""
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
from firebird.qa import *
|
|
||||||
|
|
||||||
db = db_factory()
|
|
||||||
|
|
||||||
test_script = """
|
|
||||||
set list on;
|
|
||||||
|
|
||||||
recreate table t (
|
|
||||||
f1 varchar(10),
|
|
||||||
f2 integer
|
|
||||||
);
|
|
||||||
|
|
||||||
insert into t (f1, f2) values ('a', 1);
|
|
||||||
insert into t (f1, f2) values ('b', 1);
|
|
||||||
insert into t (f1, f2) values ('c', 1);
|
|
||||||
insert into t (f1, f2) values ('b', 2);
|
|
||||||
insert into t (f1, f2) values ('c', 2);
|
|
||||||
insert into t (f1, f2) values ('d', 2);
|
|
||||||
commit;
|
|
||||||
|
|
||||||
with
|
|
||||||
t1 as (select f1 from t where f2 = 1)
|
|
||||||
,t2 as (select f1 from t where f2 = 2)
|
|
||||||
select
|
|
||||||
t1.f1 t1_f1,
|
|
||||||
t2.f1 t2_f1
|
|
||||||
from
|
|
||||||
t1 full join t2 on t1.f1 = t2.f1
|
|
||||||
where t1.f1 is null
|
|
||||||
order by 1,2
|
|
||||||
;
|
|
||||||
"""
|
|
||||||
|
|
||||||
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
|
|
||||||
|
|
||||||
expected_stdout = """
|
|
||||||
T1_F1 <null>
|
|
||||||
T2_F1 d
|
|
||||||
"""
|
|
||||||
|
|
||||||
@pytest.mark.version('>=3.0')
|
|
||||||
def test_1(act: Action):
|
|
||||||
act.expected_stdout = expected_stdout
|
|
||||||
act.execute()
|
|
||||||
assert act.clean_stdout == act.clean_expected_stdout
|
|
Loading…
Reference in New Issue
Block a user