Skip to content

Commit dfc1c08

Browse files
committed
Added/Updated tests\bugs\gh_7208_test.py: Adjusted patterns: one need to take in account SCHEMA prefix that presents for each table in the trace for FB since 6.0.0.834.
1 parent 957b63a commit dfc1c08

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tests/bugs/gh_7208_test.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,19 @@
1616
Only one line with statistics is taken in account for one DDL (because their quantity can differ between FB versions).
1717
Concrete values of NR, IR, Inserts are ignored because they can change, so each line from statistics looks just like
1818
short prefix: 'RDB' (in expected output).
19-
2019
NOTES:
2120
[24.02.2023] pzotov
22-
Checked on 5.0.0.958, 4.0.3.2903 -- all fine.
21+
Checked on 5.0.0.958, 4.0.3.2903 -- all fine.
22+
[13.07.2025] pzotov
23+
Adjusted patterns: one need to take in account SCHEMA prefix that presents for each table
24+
in the trace (since 6.0.0.834), e.g.:
25+
Table Natural Index
26+
****************************************************
27+
"SYSTEM"."RDB$DATABASE" 10
28+
"SYSTEM"."RDB$RELATIONS" 10
29+
"SYSTEM"."RDB$SCHEMAS" 20 10
30+
See 'p_rdb_table_with_stat'.
31+
Checked on 6.0.0.970; 5.0.3.1683; 4.0.6.3221
2332
"""
2433

2534
import locale
@@ -114,7 +123,7 @@
114123

115124
db = db_factory()
116125

117-
act = python_act('db', substitutions = [(r'RDB\$\S+\s+\d+(\s+\d+)*', 'RDB')])
126+
act = python_act('db', substitutions = [('[ \t]+', ' '), (r'("SYSTEM"\.)?(")?RDB\$\S+\s+\d+(\s+\d+)*', 'RDB'), (r'RDB\$\S+\s+\d+(\s+\d+)*', 'RDB')])
118127

119128
expected_stdout_trace = """
120129
SET TRANSACTION
@@ -286,24 +295,25 @@ def test_1(act: Action, capsys):
286295
with act.trace(db_events = trace_cfg_items, encoding=locale.getpreferredencoding()):
287296
act.isql(input = test_sql, combine_output = True)
288297

298+
p_rdb_table_with_stat = re.compile( r'^("SYSTEM"\.)?(")?RDB\$\S+\s+\d+(\s+\d+)*' )
299+
289300
allowed_patterns = \
290301
(
291302
'(SET TRANSACTION)'
292303
,'DDL_(BEG|END)'
293304
,'0 records fetched'
294305
,r'\s+\d+\s+ms(,)?'
295306
,r'Table\s+Natural\s+Index\s+Update\s+Insert\s+Delete\s+Backout\s+Purge\s+Expunge'
296-
,r'^RDB\$\S+\s+\d+'
307+
,p_rdb_table_with_stat.pattern # r'^("SYSTEM"\.)?(")?RDB\$\S+\s+\d+'
297308
,'^commit$'
298309
)
299310
allowed_patterns = [ re.compile(p, re.IGNORECASE) for p in allowed_patterns ]
300311

301312
rdb_tables_found_for_this_ddl = False
302313
for line in act.trace_log:
303314
if line.strip():
304-
#print(line.strip())
305315
if act.match_any(line.strip(), allowed_patterns):
306-
if line.startswith('RDB$'):
316+
if p_rdb_table_with_stat.search(line):
307317
if not rdb_tables_found_for_this_ddl:
308318
print(line.strip())
309319
rdb_tables_found_for_this_ddl = True

0 commit comments

Comments
 (0)