6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +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 term ^;
execute block
returns (
s integer
)
as
declare variable v integer = 1;
execute block returns (s integer) as
declare v integer = 1;
begin
with t as (
select t1_id as t1_id, sum(id) as s
from t2
group by 1
select t1_id as t1_id, sum(id) as s -- FB 5.x: "Select Expression (line NNN, column MMM)"
from t2
group by 1
)
select s
from t
@ -91,9 +87,9 @@ test_script = """
-- (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
-> Singularity Check
-> Filter
@ -103,9 +99,20 @@ expected_stdout = """
-> 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')
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()
#assert act.stdout == act.clean_expected_stdout
assert act.clean_stdout == act.clean_expected_stdout