1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# - Check SHOW CREATE statement;
--echo
--echo
SHOW CREATE TRIGGER trg1|
--echo
SHOW CREATE TRIGGER trg2|
--echo
SHOW CREATE TRIGGER mysqltest2.trg3|
--echo
SHOW CREATE TRIGGER mysqltest2.trg4|
# - Check SHOW statement;
--echo
--echo
SHOW TRIGGERS|
--echo
use mysqltest2|
--echo
SHOW TRIGGERS|
use mysqltest1|
# - Check INFORMATION_SCHEMA;
--echo
--echo
--replace_column 17 CREATED
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
--echo
--replace_column 17 CREATED
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
--echo
--replace_column 17 CREATED
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
--echo
--replace_column 17 CREATED
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
# - Initialize the used variables (actual values don't matter);
--echo
--echo
SET @a1 = '1'|
SET @a2 = '1'|
SET @a3 = '1'|
SET @b1 = '2'|
SET @b2 = '2'|
SET @b3 = '2'|
# - Execute the triggers;
--echo
--echo
INSERT INTO t1 VALUES(1)|
--echo
--echo ---> Log:
SELECT msg FROM log|
--echo
SELECT
COLLATION(@a1) AS ca1,
COLLATION(@a2) AS ca2,
COLLATION(@a3) AS ca3,
COLLATION(@b1) AS cb1,
COLLATION(@b2) AS cb2,
COLLATION(@b3) AS cb3|
--echo
DELETE FROM log|
--echo
--echo
INSERT INTO mysqltest2.t1 VALUES(1)|
--echo
--echo ---> Log:
SELECT msg FROM mysqltest2.log|
--echo
SELECT
COLLATION(@a1) AS ca1,
COLLATION(@a2) AS ca2,
COLLATION(@a3) AS ca3,
COLLATION(@b1) AS cb1,
COLLATION(@b2) AS cb2,
COLLATION(@b3) AS cb3|
--echo
DELETE FROM mysqltest2.log|
|