8000 Added/Updated tests\bugs\core_3312_test.py: Separated expected output… · FirebirdSQL/firebird-qa@227bb7e · GitHub
[go: up one dir, main page]

Skip to content

Commit 227bb7e

Browse files
committed
Added/Updated tests\bugs\core_3312_test.py: Separated expected output for FB major versions prior/since 6.x. Checked on 6.0.0.876; 5.0.3.1668; 4.0.6.3214; 3.0.13.33813.
1 parent 83f0851 commit 227bb7e

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

tests/bugs/core_3312_test.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,26 @@
33
"""
44
ID: issue-3679
55
ISSUE: 3679
6-
TITLE: Sub-optimal join plan when the slave table depends on the master one via the OR predicate
6+
TITLE: Sub-optimal join plan when the slave table depends on the master via the "OR" predicate
77
DESCRIPTION:
88
JIRA: CORE-3312
99
FBTEST: bugs.core_3312
10+
NOTES:
11+
[27.06.2025] pzotov
12+
Added substitutions in order to suppress digital suffix of indices name (in 'RDB$INDEX_').
13+
Separated expected output for FB major versions prior/since 6.x.
14+
No substitutions are used to suppress schema and quotes. Discussed with dimitr, 24.06.2025 12:39.
15+
16+
Checked on 6.0.0.876; 5.0.3.1668; 4.0.6.3214; 3.0.13.33813.
1017
"""
1118

1219
import pytest
1320
from firebird.qa import *
1421

1522
db = db_factory()
1623

17-
test_script = """SET PLANONLY ON;
24+
test_script = """
25+
SET PLANONLY ON;
1826
select *
1927
from rdb$relations r
2028
join rdb$security_classes sc
@@ -27,16 +35,24 @@
2735
or (r.rdb$default_class = sc.rdb$security_class and r.rdb$relation_id = 1);
2836
"""
2937

30-
act = isql_act('db', test_script)
3138

32-
expected_stdout = """
33-
PLAN JOIN (R NATURAL, SC INDEX (RDB$INDEX_7, RDB$INDEX_7))
34-
PLAN JOIN (R INDEX (RDB$INDEX_1, RDB$INDEX_1), SC INDEX (RDB$INDEX_7, RDB$INDEX_7))
39+
substitutions = [ ('[ \t]+', ' '), ('RDB\\$INDEX_\\d+', 'RDB$INDEX_*') ]
40+
act = isql_act('db', test_script, substitutions = substitutions)
41+
42+
43+
expected_out_5x = """
44+
PLAN JOIN (R NATURAL, SC INDEX (RDB$INDEX_*, RDB$INDEX_*))
45+
PLAN JOIN (R INDEX (RDB$INDEX_*, RDB$INDEX_*), SC INDEX (RDB$INDEX_*, RDB$INDEX_*))
3546
"""
3647

48+
expected_out_6x = """
49+
PLAN JOIN ("R" NATURAL, "SC" INDEX ("SYSTEM"."RDB$INDEX_*", "SYSTEM"."RDB$INDEX_*"))
50+
PLAN JOIN ("R" INDEX ("SYSTEM"."RDB$INDEX_*", "SYSTEM"."RDB$INDEX_*"), "SC" INDEX ("SYSTEM"."RDB$INDEX_*", "SYSTEM"."RDB$INDEX_*"))
51+
"""
52+
53+
@pytest.mark.intl
3754
@pytest.mark.version('>=3')
3855
def test_1(act: Action):
39-
act.expected_stdout = expected_stdout
40-
act.execute()
56+
act.expected_stdout = expected_out_5x if act.is_version('<6') else expected_out_6x
57+
act.execute(combine_output = True)
4158
assert act.clean_stdout == act.clean_expected_stdout
42-

0 commit comments

Comments
 (0)
0