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_3732_test.py

43 lines
1.1 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-4078
ISSUE: 4078
TITLE: Segfault when closing attachment to database
DESCRIPTION:
JIRA: CORE-3732
FBTEST: bugs.core_3732
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
import pytest
2021-11-17 19:43:06 +01:00
from difflib import unified_diff
2022-01-22 21:59:15 +01:00
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
act = python_act('db', substitutions=[('STATEMENT FAILED, SQLSTATE = HY000', ''),
('RECORD NOT FOUND FOR USER: TMP\\$C3732', ''),
('AFTER LINE.*', '')])
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
test_script = """
2021-11-17 19:43:06 +01:00
create role REPL_ADMIN;
create user tmp$c3732 password '12345';
grant repl_admin to tmp$c3732;
revoke all on all from tmp$c3732;
drop user tmp$c3732;
drop role REPL_ADMIN;
exit;
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
with act.connect_server() as srv:
2021-11-17 19:43:06 +01:00
srv.info.get_log()
log_before = srv.readlines()
2022-01-22 21:59:15 +01:00
act.isql(switches=['-q'], input=test_script)
with act.connect_server() as srv:
2021-11-17 19:43:06 +01:00
srv.info.get_log()
log_after = srv.readlines()
assert list(unified_diff(log_before, log_after)) == []
2021-04-26 20:07:00 +02:00