Skip to content

Commit 88738f6

Browse files
committed
wl#9048: add ORDER BY to all table scans in gcol_colum_def_options test
1 parent 688ecb4 commit 88738f6

File tree

3 files changed

+42
-42
lines changed

3 files changed

+42
-42
lines changed

mysql-test/suite/gcol/inc/gcol_column_def_options.inc

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ create table t1 (a int, b int generated always as (a+1) virtual not null);
2424
--error 1048
2525
insert into t1(a) values(null);
2626
insert into t1(a) values(1);
27-
select * from t1;
27+
select * from t1 order by a;
2828
drop table t1;
2929
create table t1 (a int, b int generated always as (a+1) stored not null);
3030
--error 1048
3131
insert into t1(a) values(null);
3232
insert into t1(a) values(1);
33-
select * from t1;
33+
select * from t1 order by a;
3434
drop table t1;
3535
create table t1 (a int);
3636
alter table t1 add column b int generated always as (a+1) virtual not null;
@@ -78,7 +78,7 @@ create table t1 (a int, b int generated always as (a+1) virtual key);
7878
}
7979
create table t1 (a int, b int generated always as (a+1) stored key);
8080
insert into t1 (a) values (3),(1),(2);
81-
select * from t1;
81+
select * from t1 order by b;
8282
drop table t1;
8383
if ($support_virtual_index)
8484
{
@@ -87,7 +87,7 @@ create table t1 (a int, b int generated always as (a+1) virtual primary key);
8787
}
8888
create table t1 (a int, b int generated always as (a+1) stored primary key);
8989
insert into t1 (a) values (3),(1),(2);
90-
select * from t1;
90+
select * from t1 order by b;
9191
drop table t1;
9292
create table t1 (a int);
9393
if ($support_virtual_index)
@@ -121,14 +121,14 @@ describe t1;
121121
insert into t1 (a) values (1);
122122
select * from t1;
123123
insert into t1 values (2,default);
124-
select a,b from t1;
124+
select a,b from t1 order by a;
125125
create table t2 like t1;
126126
show create table t2;
127127
describe t2;
128128
insert into t2 (a) values (1);
129129
select * from t2;
130130
insert into t2 values (2,default);
131-
select a,b from t2;
131+
select a,b from t2 order by a;
132132
drop table t2;
133133
drop table t1;
134134

@@ -138,7 +138,7 @@ describe t1;
138138
insert into t1 (a) values (1);
139139
select * from t1;
140140
insert into t1 values (2,default);
141-
select a,b from t1;
141+
select a,b from t1 order by a;
142142
drop table t1;
143143

144144

@@ -192,11 +192,11 @@ drop table t1;
192192
--echo Test generated columns referencing other generated columns
193193
create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual);
194194
insert into t1 (a) values (1), (2);
195-
select * from t1;
195+
select * from t1 order by c;
196196
insert into t1(a) values (1) on duplicate key update a=3;
197-
select * from t1;
197+
select * from t1 order by a;
198198
update t1 set a=4 where a=2;
199-
select * from t1;
199+
select * from t1 order by a;
200200
drop table t1;
201201

202202
--error ER_GENERATED_COLUMN_NON_PRIOR
@@ -210,8 +210,8 @@ CREATE TABLE t1 (pk INTEGER AUTO_INCREMENT, col_int_nokey INTEGER GENERATED ALWA
210210
create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored);
211211
insert into t1(a) values(1),(2);
212212
create table tt as select * from t1;
213-
select * from t1;
214-
select * from tt;
213+
select * from t1 order by a;
214+
select * from tt order by a;
215215
drop table t1,tt;
216216

217217
if (!$support_virtual_index)

mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result

+14-14
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ create table t1 (a int, b int generated always as (a+1) virtual not null);
88
insert into t1(a) values(null);
99
ERROR 23000: Column 'b' cannot be null
1010
insert into t1(a) values(1);
11-
select * from t1;
11+
select * from t1 order by a;
1212
a b
1313
1 2
1414
drop table t1;
1515
create table t1 (a int, b int generated always as (a+1) stored not null);
1616
insert into t1(a) values(null);
1717
ERROR 23000: Column 'b' cannot be null
1818
insert into t1(a) values(1);
19-
select * from t1;
19+
select * from t1 order by a;
2020
a b
2121
1 2
2222
drop table t1;
@@ -64,7 +64,7 @@ create table t1 (a int, b int generated always as (a+1) virtual key);
6464
ERROR HY000: 'Defining a virtual generated column as primary key' is not supported for generated columns.
6565
create table t1 (a int, b int generated always as (a+1) stored key);
6666
insert into t1 (a) values (3),(1),(2);
67-
select * from t1;
67+
select * from t1 order by b;
6868
a b
6969
1 2
7070
2 3
@@ -74,7 +74,7 @@ create table t1 (a int, b int generated always as (a+1) virtual primary key);
7474
ERROR HY000: 'Defining a virtual generated column as primary key' is not supported for generated columns.
7575
create table t1 (a int, b int generated always as (a+1) stored primary key);
7676
insert into t1 (a) values (3),(1),(2);
77-
select * from t1;
77+
select * from t1 order by b;
7878
a b
7979
1 2
8080
2 3
@@ -129,7 +129,7 @@ select * from t1;
129129
a b
130130
1 1
131131
insert into t1 values (2,default);
132-
select a,b from t1;
132+
select a,b from t1 order by a;
133133
a b
134134
1 1
135135
2 0
@@ -149,7 +149,7 @@ select * from t2;
149149
a b
150150
1 1
151151
insert into t2 values (2,default);
152-
select a,b from t2;
152+
select a,b from t2 order by a;
153153
a b
154154
1 1
155155
2 0
@@ -171,7 +171,7 @@ select * from t1;
171171
a b
172172
1 1
173173
insert into t1 values (2,default);
174-
select a,b from t1;
174+
select a,b from t1 order by a;
175175
a b
176176
1 1
177177
2 0
@@ -265,17 +265,17 @@ drop table t1;
265265
Test generated columns referencing other generated columns
266266
create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual);
267267
insert into t1 (a) values (1), (2);
268-
select * from t1;
268+
select * from t1 order by c;
269269
a b c
270-
1 -1 0
271270
2 -2 -1
271+
1 -1 0
272272
insert into t1(a) values (1) on duplicate key update a=3;
273-
select * from t1;
273+
select * from t1 order by a;
274274
a b c
275-
3 -3 -2
276275
2 -2 -1
276+
3 -3 -2
277277
update t1 set a=4 where a=2;
278-
select * from t1;
278+
select * from t1 order by a;
279279
a b c
280280
3 -3 -2
281281
4 -4 -3
@@ -290,11 +290,11 @@ ERROR HY000: Generated column 'col_int_nokey' cannot refer to auto-increment col
290290
create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored);
291291
insert into t1(a) values(1),(2);
292292
create table tt as select * from t1;
293-
select * from t1;
293+
select * from t1 order by a;
294294
a b c
295295
1 -1 0
296296
2 -2 -1
297-
select * from tt;
297+
select * from tt order by a;
298298
a b c
299299
1 -1 0
300300
2 -2 -1

mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result

+16-16
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ create table t1 (a int, b int generated always as (a+1) virtual not null);
88
insert into t1(a) values(null);
99
ERROR 23000: Column 'b' cannot be null
1010
insert into t1(a) values(1);
11-
select * from t1;
11+
select * from t1 order by a;
1212
a b
1313
1 2
1414
drop table t1;
1515
create table t1 (a int, b int generated always as (a+1) stored not null);
1616
insert into t1(a) values(null);
1717
ERROR 23000: Column 'b' cannot be null
1818
insert into t1(a) values(1);
19-
select * from t1;
19+
select * from t1 order by a;
2020
a b
2121
1 2
2222
drop table t1;
@@ -62,19 +62,19 @@ drop table t1;
6262
# [PRIMARY] KEY
6363
create table t1 (a int, b int generated always as (a+1) stored key);
6464
insert into t1 (a) values (3),(1),(2);
65-
select * from t1;
65+
select * from t1 order by b;
6666
a b
67-
3 4
6867
1 2
6968
2 3
69+
3 4
7070
drop table t1;
7171
create table t1 (a int, b int generated always as (a+1) stored primary key);
7272
insert into t1 (a) values (3),(1),(2);
73-
select * from t1;
73+
select * from t1 order by b;
7474
a b
75-
3 4
7675
1 2
7776
2 3
77+
3 4
7878
drop table t1;
7979
create table t1 (a int);
8080
alter table t1 add column b int generated always as (a+1) stored key;
@@ -121,7 +121,7 @@ select * from t1;
121121
a b
122122
1 1
123123
insert into t1 values (2,default);
124-
select a,b from t1;
124+
select a,b from t1 order by a;
125125
a b
126126
1 1
127127
2 0
@@ -141,7 +141,7 @@ select * from t2;
141141
a b
142142
1 1
143143
insert into t2 values (2,default);
144-
select a,b from t2;
144+
select a,b from t2 order by a;
145145
a b
146146
1 1
147147
2 0
@@ -163,7 +163,7 @@ select * from t1;
163163
a b
164164
1 1
165165
insert into t1 values (2,default);
166-
select a,b from t1;
166+
select a,b from t1 order by a;
167167
a b
168168
1 1
169169
2 0
@@ -255,17 +255,17 @@ drop table t1;
255255
Test generated columns referencing other generated columns
256256
create table t1 (a int unique, b int generated always as(-a) virtual, c int generated always as (b + 1) virtual);
257257
insert into t1 (a) values (1), (2);
258-
select * from t1;
258+
select * from t1 order by c;
259259
a b c
260-
1 -1 0
261260
2 -2 -1
261+
1 -1 0
262262
insert into t1(a) values (1) on duplicate key update a=3;
263-
select * from t1;
263+
select * from t1 order by a;
264264
a b c
265-
3 -3 -2
266265
2 -2 -1
266+
3 -3 -2
267267
update t1 set a=4 where a=2;
268-
select * from t1;
268+
select * from t1 order by a;
269269
a b c
270270
3 -3 -2
271271
4 -4 -3
@@ -280,11 +280,11 @@ ERROR HY000: Generated column 'col_int_nokey' cannot refer to auto-increment col
280280
create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored);
281281
insert into t1(a) values(1),(2);
282282
create table tt as select * from t1;
283-
select * from t1;
283+
select * from t1 order by a;
284284
a b c
285285
1 -1 0
286286
2 -2 -1
287-
select * from tt;
287+
select * from tt order by a;
288288
a b c
289289
1 -1 0
290290
2 -2 -1

0 commit comments

Comments
 (0)