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

Added/Updated tests\bugs\gh_7687_test.py: Added substitution to suppress output of BLOB_ID values because access_path type now is BLOB.

This commit is contained in:
pavel-zotov 2023-09-29 21:01:09 +03:00
parent d80cd70470
commit 4686b4400e

View File

@ -46,6 +46,10 @@ NOTES:
5. Initial discussion: https://groups.google.com/g/firebird-devel/c/dWIgSIemys4/m/TzUWYwmVAQAJ?pli=1 5. Initial discussion: https://groups.google.com/g/firebird-devel/c/dWIgSIemys4/m/TzUWYwmVAQAJ?pli=1
Checked on 5.0.0.1169. Checked on 5.0.0.1169.
[29.09.2023] pzotov
Replaces expected output to be matched to current FB 5.x and 6.x snapshots.
Added substitution to suppress output of BLOB_ID values because access_path type now is BLOB.
""" """
import os import os
@ -53,7 +57,7 @@ import pytest
from firebird.qa import * from firebird.qa import *
db = db_factory() db = db_factory()
act = python_act('db') #, substitutions=[('[ \t]+', ' ')]) act = python_act('db', substitutions=[('=', ''), ('ACCESS_PATH_BLOB_ID.*', '')])
@pytest.mark.version('>=5.0') @pytest.mark.version('>=5.0')
def test_1(act: Action, capsys): def test_1(act: Action, capsys):
@ -71,7 +75,7 @@ def test_1(act: Action, capsys):
set statistics index tdetl_fk; set statistics index tdetl_fk;
commit; commit;
out nul; out {os.devnull};
-- This is needed in order to create view based on snapshot 'plg$prof_*' tables: -- This is needed in order to create view based on snapshot 'plg$prof_*' tables:
select rdb$profiler.start_session('profile session 0') from rdb$database; select rdb$profiler.start_session('profile session 0') from rdb$database;
out; out;
@ -106,7 +110,7 @@ def test_1(act: Action, capsys):
) d4 ) d4
where exists(select count(*) from tdetl dy group by dy.pid having count(*) > 2); where exists(select count(*) from tdetl dy group by dy.pid having count(*) > 2);
out nul; out {os.devnull};
select rdb$profiler.start_session('profile session 1') from rdb$database; select rdb$profiler.start_session('profile session 1') from rdb$database;
-- Test query for which we want to see data in the profiler tables: -- Test query for which we want to see data in the profiler tables:
-- ########## -- ##########
@ -117,8 +121,7 @@ def test_1(act: Action, capsys):
set transaction read committed; set transaction read committed;
set count on; set count on;
set list off; set list on;
set heading off;
-- ############################################## -- ##############################################
-- Output data from profiler. -- Output data from profiler.
@ -139,27 +142,26 @@ def test_1(act: Action, capsys):
from vp_rec_stats t from vp_rec_stats t
join r on t.sttm_id = r.sttm_id and t.ranked_level = r.ranked_level + 1 and r.rec_id = t.par_id join r on t.sttm_id = r.sttm_id and t.ranked_level = r.ranked_level + 1 and r.rec_id = t.par_id
) )
select acc_path from r; select acc_path as access_path_blob_id from r;
""" """
act.expected_stdout = f""" act.expected_stdout = f"""
#Select Expression #Select Expression
# -> Filter (preliminary) # -> Filter (preliminary)
# -> Nested Loop Join (inner) # -> Nested Loop Join (inner)
# -> Table "TMAIN" as "V_TEST M4" Full Scan # -> Table "TMAIN" as "V_TEST M4" Full Scan
# -> Filter # -> Filter
# -> Table "TDETL" as "V_TEST D4 DX" Access By ID # -> Table "TDETL" as "V_TEST D4 DX" Access By ID
# -> Bitmap And # -> Bitmap And
# -> Bitmap # -> Bitmap
# -> Index "TDETL_FK" Range Scan (full match) # -> Index "TDETL_FK" Range Scan (full match)
# -> Bitmap # -> Bitmap
# -> Index "TDETL_Y" Range Scan (upper bound: 1/1) # -> Index "TDETL_Y" Range Scan (upper bound: 1/1)
#Sub-query (invariant) #Sub-query (invariant)
# -> Filter # -> Filter
# -> Aggregate # -> Aggregate
# -> Table "TDETL" as "V_TEST DY" Access By ID # -> Table "TDETL" as "V_TEST DY" Access By ID
# -> Index "TDETL_FK" Full Scan # -> Index "TDETL_FK" Full Scan
Records affected: 10 Records affected: 10
""" """
act.isql(input = test_sql, combine_output = True) act.isql(input = test_sql, combine_output = True)