File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ #coding:utf-8
2
+
3
+ """
4
+ ID: issue-517
5
+ ISSUE: 517
6
+ TITLE: Trigger with except-s on view with union
7
+ DESCRIPTION:
8
+ JIRA: CORE-190
9
+ FBTEST: bugs.core_0190
10
+ """
11
+
12
+ import pytest
13
+ from firebird .qa import *
14
+
15
+ db = db_factory ()
16
+
17
+ test_script = """
18
+ create table a (id integer);
19
+
20
+ create view v1 (vid) as
21
+ select id from a
22
+ union all
23
+ select id from a;
24
+
25
+ create exception exa 'foo!..';
26
+ create exception exb 'bar!..';
27
+ commit;
28
+
29
+ set term ^;
30
+ create trigger tv1 for v1 active before update as
31
+ begin
32
+ if (new.vid = 0) then
33
+ exception exa;
34
+ else
35
+ exception exb;
36
+ end
37
+ ^
38
+ set term ;^
39
+ commit;
40
+ """
41
+
42
+ act = isql_act ('db' , test_script )
43
+
44
+ expected_stdout = """
45
+ """
46
+
47
+ expected_stderr = """
48
+ """
49
+
50
+ @pytest .mark .version ('>=3.0' )
51
+ def test_1 (act : Action ):
52
+ act .expected_stdout = expected_stdout
53
+ act .expected_stderr = expected_stderr
54
+ act .execute ()
55
+ assert act .clean_stdout == act .clean_expected_stdout
56
+ assert act .clean_stderr == act .clean_expected_stderr
You can’t perform that action at this time.
0 commit comments