6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_2573_test.py

40 lines
841 B
Python

#coding:utf-8
"""
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
"""
import pytest
from firebird.qa import *
db = db_factory()
act = python_act('db')
@pytest.mark.version('>=3')
def test_1(act: Action):
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
"""
with act.db.connect() as con:
c = con.cursor()
c.execute(sql)
con.commit()
# The server should could be crashed at this point
with act.db.connect() as con:
c = con.cursor()
c.execute('DROP TRIGGER DIST')
con.commit()