6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 05:53:06 +01:00
firebird-qa/tests/functional/gtcs/test_trigger_variable_assignment.py

49 lines
1.3 KiB
Python

#coding:utf-8
#
# id: functional.gtcs.trigger_variable_assignment
# title: GTCS/tests/CF_ISQL_21. Variable in the AFTER-trigger must be allowed for assignment OLD value in it.
# decription:
# ::: NB :::
# ### Name of original test has no any relation with actual task of this test: ###
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/CF_ISQL_21.script
#
# AP,2005 - can't assign old.* fields in triggers
#
# Checked on: 4.0.0.1803 SS; 3.0.6.33265 SS; 2.5.9.27149 SC.
#
# tracker_id:
# min_versions: ['2.5.0']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
# resources: None
substitutions_1 = [('=', ''), ('[ \t]+', ' ')]
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """
create table u(a int);
set term ^;
create trigger trg_u_aid for u after insert or update or delete as
declare i int;
begin
i = old.a;
end^
commit^
"""
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
@pytest.mark.version('>=2.5')
def test_1(act_1: Action):
act_1.execute()