mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 21:43:06 +01:00
51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
#coding:utf-8
|
|
|
|
"""
|
|
ID: issue-4297
|
|
ISSUE: 4297
|
|
TITLE: It is not possible to create a ddl-trigger with "any DDL statement" clause
|
|
DESCRIPTION:
|
|
JIRA: CORE-3964
|
|
"""
|
|
|
|
import pytest
|
|
from firebird.qa import *
|
|
|
|
db = db_factory()
|
|
|
|
test_script = """
|
|
create table mp$modified_tables (relation_name char(31));
|
|
commit;
|
|
create index mp$modified_tables_idx on mp$modified_tables (relation_name);
|
|
commit;
|
|
|
|
set term ^;
|
|
create trigger taa_sql1
|
|
active after any ddl statement position 0 as
|
|
begin
|
|
if (
|
|
rdb$get_context('DDL_TRIGGER', 'OBJECT_TYPE') = 'TABLE'
|
|
and
|
|
(
|
|
rdb$get_context('DDL_TRIGGER', 'EVENT_TYPE') in ('CREATE', 'DROP')
|
|
or
|
|
rdb$get_context('DDL_TRIGGER', 'SQL_SOURCE') containing 'FIELD'
|
|
)
|
|
) then
|
|
insert into mp$modified_tables (relation_name)
|
|
values (rdb$get_context('DDL_TRIGGER', 'OBJECT_NAME'));
|
|
end
|
|
^
|
|
set term ;^
|
|
commit;
|
|
"""
|
|
|
|
act = isql_act('db', test_script)
|
|
|
|
@pytest.mark.version('>=3.0')
|
|
def test_1(act: Action):
|
|
try:
|
|
act.execute()
|
|
except ExecutionError as e:
|
|
pytest.fail("Test script execution failed", pytrace=False)
|