@@ -56,29 +56,29 @@ select * from t1;
56
56
57
57
-- echo # INSERT INTO tbl_name (<non_gcol_list>) VALUES...
58
58
insert into t1 (a) values (1 ), (2 );
59
- select * from t1;
59
+ select * from t1 order by a ;
60
60
delete from t1;
61
61
select * from t1;
62
62
63
63
-- echo # INSERT INTO tbl_name (<normal+gcols>) VALUES... DEFAULT is specified
64
64
-- echo # against gcols
65
65
insert into t1 (a,b) values (1 ,default), (2 ,default);
66
- select * from t1;
66
+ select * from t1 order by a ;
67
67
delete from t1;
68
68
select * from t1;
69
69
70
70
-- echo # INSERT INTO tbl_name (<normal+gcols>) VALUES... NULL is specified against gcols
71
71
-- error ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
72
72
insert into t1 (a,b) values (1 ,null ), (2 ,null );
73
- select * from t1;
73
+ select * from t1 order by a ;
74
74
delete from t1;
75
75
select * from t1;
76
76
77
77
-- echo # INSERT INTO tbl_name (<normal+gcols>) VALUES... a non-NULL value is specified
78
78
-- echo # against gcols
79
79
-- error ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
80
80
insert into t1 (a,b) values (1 ,3 ), (2 ,4 );
81
- select * from t1;
81
+ select * from t1 order by a ;
82
82
delete from t1;
83
83
select * from t1;
84
84
drop table t1;
@@ -89,7 +89,7 @@ eval $create2;
89
89
insert into t1 values (1 ,default,default);
90
90
insert into t1 values (1 ,default,default)
91
91
on duplicate key update a= 2 , b= default;
92
- select a,b,c from t1;
92
+ select a,b,c from t1 order by a ;
93
93
delete from t1 where b in (1 ,2 );
94
94
select * from t1;
95
95
drop table t1;
@@ -100,15 +100,15 @@ eval $create3;
100
100
insert into t1 values (1 ,default,default);
101
101
insert into t1 values (1 ,default,default)
102
102
on duplicate key update a= 2 , b= default;
103
- select a,b,c from t1;
103
+ select a,b,c from t1 order by a ;
104
104
105
105
-- echo # CREATE new_table ... LIKE old_table
106
106
-- echo # INSERT INTO new_table SELECT * from old_table
107
107
create table t2 like t1;
108
108
-- error ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
109
109
insert into t2 select * from t1;
110
110
insert into t2(a) select a from t1;
111
- select * from t1 ;
111
+ select * from t2 order by a ;
112
112
drop table t2;
113
113
114
114
-- echo # CREATE new_table ... LIKE old_table INSERT INTO new_table (<non-gcols>, <gcols>)
@@ -119,7 +119,7 @@ create table t2 like t1;
119
119
-- error ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
120
120
insert into t2 (a,b) select a,b from t1;
121
121
insert into t2 (a) select a from t1;
122
- select * from t2;
122
+ select * from t2 order by a ;
123
123
drop table t2;
124
124
drop table t1;
125
125
@@ -130,44 +130,44 @@ drop table t1;
130
130
-- echo # UPDATE tbl_name SET non-gcol=expr WHERE non-gcol=expr
131
131
eval $create1;
132
132
insert into t1 (a) values (1 ), (2 );
133
- select * from t1;
133
+ select * from t1 order by a ;
134
134
update t1 set a= 3 where a= 2 ;
135
- select * from t1;
135
+ select * from t1 order by a ;
136
136
delete from t1;
137
137
select * from t1;
138
138
139
139
-- echo # UPDATE tbl_name SET gcol=expr WHERE non-gcol=expr
140
140
insert into t1 (a) values (1 ), (2 );
141
- select * from t1;
141
+ select * from t1 order by a ;
142
142
-- error ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
143
143
update t1 set c= 3 where a= 2 ;
144
- select * from t1;
144
+ select * from t1 order by a ;
145
145
delete from t1;
146
146
select * from t1;
147
147
148
148
-- echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=expr
149
149
insert into t1 (a) values (1 ), (2 );
150
- select * from t1;
150
+ select * from t1 order by a ;
151
151
update t1 set a= 3 where b= - 2 ;
152
- select * from t1;
152
+ select * from t1 order by a ;
153
153
delete from t1;
154
154
select * from t1;
155
155
156
156
-- echo # UPDATE tbl_name SET gcol=expr WHERE gcol=expr
157
157
insert into t1 (a) values (1 ), (2 );
158
- select * from t1;
158
+ select * from t1 order by a ;
159
159
-- error ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
160
160
update t1 set c= 3 where b= - 2 ;
161
- select * from t1;
161
+ select * from t1 order by a ;
162
162
delete from t1;
163
- select * from t1;
163
+ select * from t1 order by a ;
164
164
drop table t1;
165
165
166
166
-- echo # INDEX created on gcol
167
167
-- echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=const
168
168
eval $create3;
169
169
insert into t1 (a) values (1 ), (2 );
170
- select * from t1;
170
+ select * from t1 order by a ;
171
171
update t1 set a= 3 where c= - 2 ;
172
172
select * from t1;
173
173
delete from t1;
@@ -177,61 +177,61 @@ select * from t1;
177
177
-- echo # INDEX created on gcol
178
178
-- echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2
179
179
insert into t1 (a) values (1 ), (2 );
180
- select * from t1;
180
+ select * from t1 order by a ;
181
181
update t1 set a= 3 where c between - 3 and - 2 ;
182
- select * from t1;
182
+ select * from t1 order by a ;
183
183
delete from t1;
184
184
select * from t1;
185
185
186
186
-- echo # No INDEX created on gcol
187
187
-- echo # UPDATE tbl_name SET non-gcol=expr WHERE gcol=between const1 and const2
188
188
insert into t1 (a) values (1 ), (2 );
189
- select * from t1;
189
+ select * from t1 order by a ;
190
190
update t1 set a= 3 where b between - 3 and - 2 ;
191
- select * from t1;
191
+ select * from t1 order by a ;
192
192
delete from t1;
193
193
select * from t1;
194
194
195
195
-- echo # INDEX created on gcol
196
196
-- echo # UPDATE tbl_name SET non-gcol=expr
197
197
-- echo # WHERE gcol=between const1 and const2 ORDER BY gcol
198
198
insert into t1 (a) values (1 ), (2 ), (3 ), (4 ), (5 );
199
- select * from t1;
199
+ select * from t1 order by a ;
200
200
update t1 set a= 6 where c between - 1 and 0
201
201
order by c;
202
- select * from t1;
202
+ select * from t1 order by a ;
203
203
delete from t1 where c between - 6 and 0 ;
204
- select * from t1;
204
+ select * from t1 order by a ;
205
205
206
206
-- echo # INDEX created on gcol
207
207
-- echo # UPDATE tbl_name SET non-gcol=expr
208
208
-- echo # WHERE gcol=between const1 and const2 ORDER BY gcol LIMIT 2
209
209
insert into t1 (a) values (1 ), (2 ), (3 ), (4 ), (5 );
210
- select * from t1;
210
+ select * from t1 order by a ;
211
211
update t1 set a= 6 where c between - 1 and 0
212
212
order by c limit 2 ;
213
- select * from t1;
213
+ select * from t1 order by a ;
214
214
delete from t1 where c between - 2 and 0 order by c;
215
- select * from t1;
215
+ select * from t1 order by a ;
216
216
delete from t1;
217
217
218
218
-- echo # INDEX created on gcol
219
219
-- echo # UPDATE tbl_name SET non-gcol=expr
220
220
-- echo # WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3
221
221
insert into t1 (a) values (1 ), (2 ), (3 ), (4 ), (5 );
222
- select * from t1;
222
+ select * from t1 order by a ;
223
223
update t1 set a= 6 where (c between - 2 and 0 ) and (b= - 1 );
224
- select * from t1;
224
+ select * from t1 order by a ;
225
225
delete from t1;
226
226
227
227
-- echo # INDEX created on gcol
228
228
-- echo # UPDATE tbl_name SET non-gcol=expr
229
229
-- echo # WHERE indexed gcol=between const1 and const2 and non-indexed gcol=const3
230
230
-- echo # ORDER BY indexed gcol
231
231
insert into t1 (a) values (1 ), (2 ), (3 ), (4 ), (5 );
232
- select * from t1;
232
+ select * from t1 order by a ;
233
233
update t1 set a= 6 where (c between - 2 and 0 ) and (b= - 1 ) order by c;
234
- select * from t1;
234
+ select * from t1 order by a ;
235
235
delete from t1;
236
236
drop table t1;
237
237
@@ -244,9 +244,9 @@ if ($innodb_engine)
244
244
create table t1 (a int primary key , b int generated always as (a % 10 ) stored);
245
245
insert into t2 values (1 , ' value1' ), (2 ,' value2' ), (3 ,' value3' );
246
246
insert into t1 (a) values (1 ),(2 ),(3 );
247
- select * from t1;
248
- select * from t2;
249
- select t1 .a , t1 .b , t2 .name from t1,t2 where t1 .b = t2 .a ;
247
+ select * from t1 order by a ;
248
+ select * from t2 order by a ;
249
+ select t1 .a , t1 .b , t2 .name from t1,t2 where t1 .b = t2 .a order by t1 . a ;
250
250
251
251
-- echo # - ON UPDATE RESTRICT
252
252
alter table t1 add foreign key (b) references t2(a) on update restrict;
@@ -284,9 +284,9 @@ if ($innodb_engine)
284
284
-- echo # REPLACE tbl_name (non-gcols) VALUES (non-gcols);
285
285
eval $create4;
286
286
insert into t1 (a,d) values (1 ,' a' ), (2 ,' b' );
287
- select * from t1;
287
+ select * from t1 order by a ;
288
288
replace t1 (a,d) values (1 ,' c' );
289
- select * from t1;
289
+ select * from t1 order by a ;
290
290
delete from t1;
291
291
select * from t1;
292
292
0 commit comments