~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/suite/funcs_1/r/ndb_trig_09.result.moved

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
USE test;
2
2
drop table if exists tb3 ;
3
3
create table tb3 (
4
 
f118 char not null DEFAULT 'a', 
5
 
f119 char binary not null DEFAULT b'101', 
6
 
f120 char ascii not null DEFAULT b'101', 
7
 
f121 tinytext, 
8
 
f122 text, 
9
 
f123 mediumtext, 
10
 
f124 longtext unicode, 
11
 
f125 tinyblob, 
12
 
f126 blob, 
13
 
f127 mediumblob, 
14
 
f128 longblob, 
15
 
f129 binary not null DEFAULT b'101', 
16
 
f130 tinyint not null DEFAULT 99, 
17
 
f131 tinyint unsigned not null DEFAULT 99, 
18
 
f132 tinyint zerofill not null DEFAULT 99, 
19
 
f133 tinyint unsigned zerofill not null DEFAULT 99, 
20
 
f134 smallint not null DEFAULT 999, 
21
 
f135 smallint unsigned not null DEFAULT 999, 
22
 
f136 smallint zerofill not null DEFAULT 999,  
23
 
f137 smallint unsigned zerofill not null DEFAULT 999, 
24
 
f138 mediumint not null DEFAULT 9999, 
25
 
f139 mediumint unsigned not null DEFAULT 9999, 
26
 
f140 mediumint zerofill not null DEFAULT 9999, 
27
 
f141 mediumint unsigned zerofill not null DEFAULT 9999, 
28
 
f142 int not null DEFAULT 99999, 
29
 
f143 int unsigned not null DEFAULT 99999, 
30
 
f144 int zerofill not null DEFAULT 99999, 
31
 
f145 int unsigned zerofill not null DEFAULT 99999, 
32
 
f146 bigint not null DEFAULT 999999, 
33
 
f147 bigint unsigned not null DEFAULT 999999, 
34
 
f148 bigint zerofill not null DEFAULT 999999, 
35
 
f149 bigint unsigned zerofill not null DEFAULT 999999, 
36
 
f150 decimal not null DEFAULT 999.999, 
37
 
f151 decimal unsigned not null DEFAULT 999.17, 
38
 
f152 decimal zerofill not null DEFAULT 999.999, 
39
 
f153 decimal unsigned zerofill, 
40
 
f154 decimal (0), 
41
 
f155 decimal (64), 
42
 
f156 decimal (0) unsigned, 
43
 
f157 decimal (64) unsigned, 
44
 
f158 decimal (0) zerofill, 
45
 
f159 decimal (64) zerofill, 
46
 
f160 decimal (0) unsigned zerofill, 
47
 
f161 decimal (64) unsigned zerofill, 
48
 
f162 decimal (0,0), 
49
 
f163 decimal (63,30), 
50
 
f164 decimal (0,0) unsigned, 
51
 
f165 decimal (63,30) unsigned, 
52
 
f166 decimal (0,0) zerofill, 
53
 
f167 decimal (63,30) zerofill, 
54
 
f168 decimal (0,0) unsigned zerofill, 
55
 
f169 decimal (63,30) unsigned zerofill, 
56
 
f170 numeric, 
57
 
f171 numeric unsigned, 
58
 
f172 numeric zerofill, 
59
 
f173 numeric unsigned zerofill, 
60
 
f174 numeric (0), 
61
 
f175 numeric (64) 
 
4
f118 char not null DEFAULT 'a',
 
5
f119 char binary not null DEFAULT b'101',
 
6
f120 char ascii not null DEFAULT b'101',
 
7
f121 tinytext,
 
8
f122 text,
 
9
f123 mediumtext,
 
10
f124 longtext unicode,
 
11
f125 tinyblob,
 
12
f126 blob,
 
13
f127 mediumblob,
 
14
f128 longblob,
 
15
f129 binary not null DEFAULT b'101',
 
16
f130 tinyint not null DEFAULT 99,
 
17
f131 tinyint unsigned not null DEFAULT 99,
 
18
f132 tinyint zerofill not null DEFAULT 99,
 
19
f133 tinyint unsigned zerofill not null DEFAULT 99,
 
20
f134 smallint not null DEFAULT 999,
 
21
f135 smallint unsigned not null DEFAULT 999,
 
22
f136 smallint zerofill not null DEFAULT 999,
 
23
f137 smallint unsigned zerofill not null DEFAULT 999,
 
24
f138 mediumint not null DEFAULT 9999,
 
25
f139 mediumint unsigned not null DEFAULT 9999,
 
26
f140 mediumint zerofill not null DEFAULT 9999,
 
27
f141 mediumint unsigned zerofill not null DEFAULT 9999,
 
28
f142 int not null DEFAULT 99999,
 
29
f143 int unsigned not null DEFAULT 99999,
 
30
f144 int zerofill not null DEFAULT 99999,
 
31
f145 int unsigned zerofill not null DEFAULT 99999,
 
32
f146 bigint not null DEFAULT 999999,
 
33
f147 bigint unsigned not null DEFAULT 999999,
 
34
f148 bigint zerofill not null DEFAULT 999999,
 
35
f149 bigint unsigned zerofill not null DEFAULT 999999,
 
36
f150 decimal not null DEFAULT 999.999,
 
37
f151 decimal unsigned not null DEFAULT 999.17,
 
38
f152 decimal zerofill not null DEFAULT 999.999,
 
39
f153 decimal unsigned zerofill,
 
40
f154 decimal (0),
 
41
f155 decimal (64),
 
42
f156 decimal (0) unsigned,
 
43
f157 decimal (64) unsigned,
 
44
f158 decimal (0) zerofill,
 
45
f159 decimal (64) zerofill,
 
46
f160 decimal (0) unsigned zerofill,
 
47
f161 decimal (64) unsigned zerofill,
 
48
f162 decimal (0,0),
 
49
f163 decimal (63,30),
 
50
f164 decimal (0,0) unsigned,
 
51
f165 decimal (63,30) unsigned,
 
52
f166 decimal (0,0) zerofill,
 
53
f167 decimal (63,30) zerofill,
 
54
f168 decimal (0,0) unsigned zerofill,
 
55
f169 decimal (63,30) unsigned zerofill,
 
56
f170 numeric,
 
57
f171 numeric unsigned,
 
58
f172 numeric zerofill,
 
59
f173 numeric unsigned zerofill,
 
60
f174 numeric (0),
 
61
f175 numeric (64)
62
62
) engine = ndb;
63
63
Warnings:
64
64
Note    1265    Data truncated for column 'f150' at row 1
65
65
Note    1265    Data truncated for column 'f151' at row 1
66
66
Note    1265    Data truncated for column 'f152' at row 1
67
67
Error   1478    Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
68
 
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ;
 
68
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/ndb_tb3.txt'
 
69
into table tb3;
69
70
 
70
71
Testcase 3.5.9.1/2:
71
72
-------------------
72
 
Create trigger trg1 BEFORE UPDATE on tb3 for each row 
 
73
Create trigger trg1 BEFORE UPDATE on tb3 for each row
73
74
set new.f142 = 94087, @counter=@counter+1;
74
75
TotalRows
75
76
10
81
82
0
82
83
set @counter=0;
83
84
Update tb3 Set f142='1' where f130<100;
84
 
select count(*) as ExpectedChanged, @counter as TrigCounter 
 
85
select count(*) as ExpectedChanged, @counter as TrigCounter
85
86
from tb3 where f142=94087;
86
87
ExpectedChanged TrigCounter
87
88
8       8
88
 
select count(*) as ExpectedNotChange from tb3 
 
89
select count(*) as ExpectedNotChange from tb3
89
90
where f130<100 and f142<>94087;
90
91
ExpectedNotChange
91
92
0
92
 
select count(*) as NonExpectedChanged from tb3 
 
93
select count(*) as NonExpectedChanged from tb3
93
94
where f130>=130 and f142=94087;
94
95
NonExpectedChanged
95
96
0
117
118
0       0       0       0       0
118
119
@tr_var_af_118  @tr_var_af_121  @tr_var_af_122  @tr_var_af_136  @tr_var_af_163
119
120
0       0       0       0       0
120
 
Insert into tb3 (f122, f136, f163) 
 
121
Insert into tb3 (f122, f136, f163)
121
122
values ('Test 3.5.9.3', 7, 123.17);
122
123
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
123
124
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
124
125
f118    f121    f122    f136    f163
125
126
a       NULL    Test 3.5.9.3    00008   123.170000000000000000000000000000
126
 
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
 
127
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
127
128
@tr_var_b4_136, @tr_var_b4_163;
128
129
@tr_var_b4_118  @tr_var_b4_121  @tr_var_b4_122  @tr_var_b4_136  @tr_var_b4_163
129
130
a       NULL    Test 3.5.9.3    7       123.170000000000000000000000000000
130
 
select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122, 
 
131
select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
131
132
@tr_var_af_136, @tr_var_af_163;
132
133
@tr_var_af_118  @tr_var_af_121  @tr_var_af_122  @tr_var_af_136  @tr_var_af_163
133
134
a       NULL    Test 3.5.9.3    7       123.170000000000000000000000000000
138
139
delete from tb3 where f122='Test 3.5.9.3';
139
140
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
140
141
f118    f121    f122    f136    f163
141
 
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
 
142
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
142
143
@tr_var_b4_136, @tr_var_b4_163;
143
144
@tr_var_b4_118  @tr_var_b4_121  @tr_var_b4_122  @tr_var_b4_136  @tr_var_b4_163
144
145
a       NULL    Test 3.5.9.3    8       123.170000000000000000000000000000
169
170
0       0       0       0       0       0
170
171
@tr_var_af_118  @tr_var_af_121  @tr_var_af_122  @tr_var_af_136  @tr_var_af_151  @tr_var_af_163
171
172
0       0       0       0       0       0
172
 
Insert into tb3 (f122, f136, f151, f163) 
 
173
Insert into tb3 (f122, f136, f151, f163)
173
174
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
174
 
select f118, f121, f122, f136, f151, f163 from tb3 
 
175
select f118, f121, f122, f136, f151, f163 from tb3
175
176
where f122 like 'Test 3.5.9.4%' order by f163;
176
177
f118    f121    f122    f136    f151    f163
177
178
a       NULL    Test 3.5.9.4    00007   999     995.240000000000000000000000000000
178
 
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
 
179
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
179
180
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
180
181
@tr_var_b4_118  @tr_var_b4_121  @tr_var_b4_122  @tr_var_b4_136  @tr_var_b4_151  @tr_var_b4_163
181
182
a       NULL    Test 3.5.9.4    7       999     995.240000000000000000000000000000
182
 
select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122, 
 
183
select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
183
184
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
184
185
@tr_var_af_118  @tr_var_af_121  @tr_var_af_122  @tr_var_af_136  @tr_var_af_151  @tr_var_af_163
185
186
a       NULL    Test 3.5.9.4    7       999     995.240000000000000000000000000000
192
193
ERROR 23000: Column 'f136' cannot be null
193
194
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
194
195
where f122='Test 3.5.9.4';
195
 
select f118, f121, f122, f136, f151, f163 from tb3 
 
196
select f118, f121, f122, f136, f151, f163 from tb3
196
197
where f122 like 'Test 3.5.9.4-trig' order by f163;
197
198
f118    f121    f122    f136    f151    f163
198
199
a       NULL    Test 3.5.9.4-trig       00000   999     NULL
199
 
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
 
200
select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
200
201
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
201
202
@tr_var_b4_118  @tr_var_b4_121  @tr_var_b4_122  @tr_var_b4_136  @tr_var_b4_151  @tr_var_b4_163
202
203
a       NULL    Test 3.5.9.4-trig       0       999     NULL
203
 
select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122, 
 
204
select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
204
205
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
205
206
@tr_var_af_118  @tr_var_af_121  @tr_var_af_122  @tr_var_af_136  @tr_var_af_151  @tr_var_af_163
206
207
a       NULL    Test 3.5.9.4-trig       0       999     NULL
238
239
create trigger trg5b after DELETE on tb3 for each row
239
240
set new.f122='test';
240
241
ERROR HY000: There is no NEW row in on DELETE trigger
 
242
drop trigger trg5a;
241
243
drop trigger trg5b;
242
244
 
243
245
Testcase 3.5.9.10: (implied in previous tests)