mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-02-02 02:40:42 +01:00
57 lines
1.5 KiB
Python
57 lines
1.5 KiB
Python
#coding:utf-8
|
|
|
|
"""
|
|
ID: issue-3322
|
|
ISSUE: 3322
|
|
TITLE: Trace output could contain garbage data left from filtered out statements
|
|
DESCRIPTION:
|
|
JIRA: CORE-2940
|
|
"""
|
|
|
|
import pytest
|
|
from firebird.qa import *
|
|
|
|
db = db_factory()
|
|
|
|
act = python_act('db', substitutions=[('^((?!records fetched).)*$', '')])
|
|
|
|
expected_stdout = """
|
|
1 records fetched
|
|
"""
|
|
|
|
test_script = """
|
|
set list on;
|
|
-- statistics for this statement SHOULD appear in trace log:
|
|
select 1 k1 from rdb$database;
|
|
commit;
|
|
-- statistics for this statement should NOT appear in trace log:
|
|
select 2 k2 from rdb$types rows 2 /* no_trace*/;
|
|
-- statistics for this statement should NOT appear in trace log:
|
|
select 3 no_trace from rdb$types rows 3;
|
|
-- statistics for this statement should NOT appear in trace log:
|
|
set term ^;
|
|
execute block returns(k4 int) as
|
|
begin
|
|
for select 4 from rdb$types rows 4 into k4 do suspend;
|
|
end -- no_trace
|
|
^
|
|
set term ;^
|
|
"""
|
|
|
|
trace = ['log_connections = true',
|
|
'log_transactions = true',
|
|
'log_statement_finish = true',
|
|
'print_plan = true',
|
|
'print_perf = true',
|
|
'time_threshold = 0',
|
|
'exclude_filter = %no_trace%',
|
|
]
|
|
|
|
@pytest.mark.version('>=3.0')
|
|
def test_1(act: Action):
|
|
with act.trace(db_events=trace):
|
|
act.isql(switches=['-n'], input=test_script)
|
|
act.expected_stdout = expected_stdout
|
|
act.trace_to_stdout()
|
|
assert act.clean_stdout == act.clean_expected_stdout
|