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

73 lines
1.6 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-25 22:55:48 +01:00
"""
ID: issue-5740-A
ISSUE: 5740-A
TITLE: Trace INCLUDE_FILTER with [[:WHITESPACE:]]+ does not work when statement contains newline is issued
DESCRIPTION:
We create a list of several DDLs which all contain NEWLINE character(s) between keyword and name of DB object.
Then we launch trace session and execute all these DDLs.
Finally we check whether trace log contains every DDL or not.
Expected result: text of every DDL should be FOUND in the trace log.
JIRA: CORE-5470
FBTEST: bugs.core_5470
2022-01-25 22:55:48 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
act = python_act('db')
ddl_lst = ["""recreate
table
t_test(x int)
""",
"""comment on
table
2021-04-26 20:07:00 +02:00
t_test is
'foo
bar'
""",
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
create
or
alter
view
v_rio
as
select *
from
rdb$database
"""]
2022-01-25 22:55:48 +01:00
trace = ['time_threshold = 0',
'log_initfini = false',
'log_errors = true',
'log_statement_finish = true',
'include_filter = "%(recreate|create|alter|drop|comment on)[[:WHITESPACE:]]+(domain|generator|sequence|exception|procedure|function|table|index|view|trigger|role|filter|external function)%"',
]
2022-01-25 22:55:48 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
with act.trace(db_events=trace), act.db.connect() as con:
for cmd in ddl_lst:
con.execute_immediate(cmd)
con.commit()
# Check
2022-01-25 22:55:48 +01:00
act.trace_to_stdout()
for cmd in ddl_lst:
2022-01-25 22:55:48 +01:00
assert act.stdout.find(cmd) > 0