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

36 lines
839 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-02-04 19:05:19 +01:00
"""
ID: gtcs.trigger-variable-assignment
TITLE: Variable in the AFTER-trigger must be allowed for assignment OLD value in it
DESCRIPTION:
::: 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
FBTEST: functional.gtcs.trigger_variable_assignment
"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
create table u(a int);
set term ^;
2022-02-04 19:05:19 +01:00
create trigger trg_u_aid for u after insert or update or delete as
2021-04-26 20:07:00 +02:00
declare i int;
begin
2022-02-04 19:05:19 +01:00
i = old.a;
2021-04-26 20:07:00 +02:00
end^
commit^
"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
act_1 = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
@pytest.mark.version('>=3')
2021-04-28 12:42:11 +02:00
def test_1(act_1: Action):
2021-04-26 20:07:00 +02:00
act_1.execute()