6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 14:03:06 +01:00
firebird-qa/tests/bugs/core_2573_test.py

40 lines
841 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-2983
ISSUE: 2983
TITLE: The server crashes when selecting from the MON$ tables in the ON DISCONNECT trigger
DESCRIPTION:
JIRA: CORE-2573
FBTEST: bugs.core_2573
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
2021-11-16 19:44:53 +01:00
sql = """CREATE OR ALTER TRIGGER DIST
ON DISCONNECT POSITION 0
AS
declare variable i integer;
begin
select mon$stat_id from mon$attachments rows 1 into :i;
end
2022-01-21 18:49:26 +01:00
"""
with act.db.connect() as con:
2021-11-16 19:44:53 +01:00
c = con.cursor()
c.execute(sql)
con.commit()
# The server should could be crashed at this point
2022-01-21 18:49:26 +01:00
with act.db.connect() as con:
2021-11-16 19:44:53 +01:00
c = con.cursor()
c.execute('DROP TRIGGER DIST')
con.commit()
2021-04-26 20:07:00 +02:00