6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00

Added/Updated tests\bugs\core_4318_test.py: Splitted expected out because of changed explained_plan in FB 5.x. Added substitutions because plan in FB 5.x contains concrete numbers of line and column

This commit is contained in:
pavel-zotov 2023-03-04 19:28:05 +03:00
parent eca54af2eb
commit 1b150c8f1f

View File

@ -60,17 +60,13 @@ test_script = """
set planonly; set planonly;
set term ^; set term ^;
execute block execute block returns (s integer) as
returns ( declare v integer = 1;
s integer
)
as
declare variable v integer = 1;
begin begin
with t as ( with t as (
select t1_id as t1_id, sum(id) as s select t1_id as t1_id, sum(id) as s -- FB 5.x: "Select Expression (line NNN, column MMM)"
from t2 from t2
group by 1 group by 1
) )
select s select s
from t from t
@ -91,9 +87,9 @@ test_script = """
-- (i.e. there was NO "Filter" between "Aggregate" and "Table "T T2" Access By ID") -- (i.e. there was NO "Filter" between "Aggregate" and "Table "T T2" Access By ID")
""" """
act = isql_act('db', test_script) act = isql_act('db', test_script, substitutions = [('line \\d+, col(umn)? \\d+', 'line, col')])
expected_stdout = """ fb3x_expected_out = """
Select Expression Select Expression
-> Singularity Check -> Singularity Check
-> Filter -> Filter
@ -103,9 +99,20 @@ expected_stdout = """
-> Index "FK_T2_REF_T1" Range Scan (full match) -> Index "FK_T2_REF_T1" Range Scan (full match)
""" """
fb5x_expected_out = """
Select Expression (line 8, column 7)
-> Singularity Check
-> Filter
-> Aggregate
-> Filter
-> Table "T2" as "T T2" Access By ID
-> Index "FK_T2_REF_T1" Range Scan (full match)
"""
@pytest.mark.version('>=3.0') @pytest.mark.version('>=3.0')
def test_1(act: Action): def test_1(act: Action):
act.expected_stdout = expected_stdout act.expected_stdout = fb3x_expected_out if act.is_version('<5') else fb5x_expected_out
act.execute() act.execute()
#assert act.stdout == act.clean_expected_stdout
assert act.clean_stdout == act.clean_expected_stdout assert act.clean_stdout == act.clean_expected_stdout