@@ -5,12 +5,6 @@ call mtr.add_suppression("table or database name 't-1'");
5
5
# Check some special create statements.
6
6
#
7
7
8
- --disable_warnings
9
- drop table if exists t1,t2,t3,t4,t5;
10
- drop database if exists mysqltest;
11
- drop view if exists v1;
12
- --enable_warnings
13
-
14
8
create table t1 (b char(0));
15
9
insert into t1 values (""),(null);
16
10
select * from t1;
@@ -29,30 +23,30 @@ drop table t1;
29
23
# Test of some CREATE TABLE'S that should fail
30
24
#
31
25
32
- --error 1146
26
+ --error ER_NO_SUCH_TABLE
33
27
create table t2 engine=heap select * from t1;
34
- --error 1146
28
+ --error ER_NO_SUCH_TABLE
35
29
create table t2 select auto+1 from t1;
36
30
drop table if exists t1,t2;
37
- --error 1167
31
+ --error ER_WRONG_KEY_COLUMN
38
32
create table t1 (b char(0) not null, index(b));
39
- --error 1163
33
+ --error ER_TABLE_CANT_HANDLE_BLOB
40
34
create table t1 (a int not null,b text) engine=heap;
41
35
drop table if exists t1;
42
36
43
- --error 1075
37
+ --error ER_WRONG_AUTO_KEY
44
38
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
45
39
46
- -- error 1049
40
+ --error ER_BAD_DB_ERROR
47
41
create table not_existing_database.test (a int);
48
42
create table `a/a` (a int);
49
43
show create table `a/a`;
50
44
create table t1 like `a/a`;
51
45
drop table `a/a`;
52
46
drop table `t1`;
53
- --error 1103
47
+ --error ER_WRONG_TABLE_NAME
54
48
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
55
- --error 1059
49
+ --error ER_TOO_LONG_IDENT
56
50
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
57
51
58
52
#
@@ -62,17 +56,17 @@ create table t1 (a datetime default now());
62
56
drop table t1;
63
57
create table t1 (a datetime on update now());
64
58
drop table t1;
65
- --error 1067
59
+ --error ER_INVALID_DEFAULT
66
60
create table t1 (a int default 100 auto_increment);
67
- --error 1067
61
+ --error ER_INVALID_DEFAULT
68
62
create table t1 (a tinyint default 1000);
69
- --error 1067
63
+ --error ER_INVALID_DEFAULT
70
64
create table t1 (a varchar(5) default 'abcdef');
71
65
72
66
create table t1 (a varchar(5) default 'abcde');
73
67
insert into t1 values();
74
68
select * from t1;
75
- --error 1067
69
+ --error ER_INVALID_DEFAULT
76
70
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
77
71
alter table t1 alter column a set default 'abcdef';
78
72
drop table t1;
@@ -97,13 +91,13 @@ create table mysqltest.test2$ (a int);
97
91
drop table mysqltest.test2$;
98
92
drop database mysqltest;
99
93
100
- --error 1103
94
+ --error ER_WRONG_TABLE_NAME
101
95
create table `` (a int);
102
- --error 1103
96
+ --error ER_WRONG_TABLE_NAME
103
97
drop table if exists ``;
104
- --error 1166
98
+ --error ER_WRONG_COLUMN_NAME
105
99
create table t1 (`` int);
106
- --error 1280
100
+ --error ER_WRONG_NAME_FOR_INDEX
107
101
create table t1 (i int, index `` (i));
108
102
109
103
#
@@ -158,13 +152,13 @@ create table t2 (a int) select * from t1;
158
152
describe t1;
159
153
describe t2;
160
154
drop table if exists t2;
161
- --error 1060
155
+ --error ER_DUP_FIELDNAME
162
156
create table t2 (a int, a float) select * from t1;
163
157
drop table if exists t2;
164
- --error 1060
158
+ --error ER_DUP_FIELDNAME
165
159
create table t2 (a int) select a as b, a+1 as b from t1;
166
160
drop table if exists t2;
167
- --error 1060
161
+ --error ER_DUP_FIELDNAME
168
162
create table t2 (b int) select a as b, a+1 as b from t1;
169
163
drop table if exists t1,t2;
170
164
@@ -176,7 +170,7 @@ CREATE TABLE t1 (a int not null);
176
170
INSERT INTO t1 values (1),(2),(1);
177
171
--error ER_DUP_ENTRY
178
172
CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
179
- --error 1146
173
+ --error ER_NO_SUCH_TABLE
180
174
SELECT * from t2;
181
175
DROP TABLE t1;
182
176
DROP TABLE IF EXISTS t2;
@@ -202,7 +196,7 @@ SELECT @@storage_engine;
202
196
CREATE TABLE t1 (a int not null);
203
197
show create table t1;
204
198
drop table t1;
205
- --error 1286
199
+ --error ER_UNKNOWN_STORAGE_ENGINE
206
200
SET SESSION storage_engine="gemini";
207
201
SELECT @@storage_engine;
208
202
CREATE TABLE t1 (a int not null);
@@ -216,11 +210,11 @@ drop table t1;
216
210
#
217
211
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
218
212
insert into t1 values ("a", 1), ("b", 2);
219
- --error 1048
213
+ --error ER_BAD_NULL_ERROR
220
214
insert into t1 values ("c", NULL);
221
- --error 1048
215
+ --error ER_BAD_NULL_ERROR
222
216
insert into t1 values (NULL, 3);
223
- --error 1048
217
+ --error ER_BAD_NULL_ERROR
224
218
insert into t1 values (NULL, NULL);
225
219
drop table t1;
226
220
@@ -262,23 +256,23 @@ drop table t1;
262
256
# "Table truncated when creating another table name with Spaces"
263
257
#
264
258
265
- --error 1103
259
+ --error ER_WRONG_TABLE_NAME
266
260
create table `t1 `(a int);
267
- --error 1102
261
+ --error ER_WRONG_DB_NAME
268
262
create database `db1 `;
269
- --error 1166
263
+ --error ER_WRONG_COLUMN_NAME
270
264
create table t1(`a ` int);
271
265
272
266
#
273
267
# Test for Bug #3481
274
268
# "Parser permits multiple commas without syntax error"
275
269
#
276
270
277
- --error 1064
271
+ --error ER_PARSE_ERROR
278
272
create table t1 (a int,);
279
- --error 1064
273
+ --error ER_PARSE_ERROR
280
274
create table t1 (a int,,b int);
281
- --error 1064
275
+ --error ER_PARSE_ERROR
282
276
create table t1 (,b int);
283
277
284
278
#
@@ -320,13 +314,13 @@ create table t2 like t3;
320
314
show create table t2;
321
315
select * from t2;
322
316
create table t3 like t1;
323
- --error 1050
317
+ --error ER_TABLE_EXISTS_ERROR
324
318
create table t3 like mysqltest.t3;
325
- --error 1049
319
+ --error ER_BAD_DB_ERROR
326
320
create table non_existing_database.t1 like t1;
327
321
--error ER_NO_SUCH_TABLE
328
322
create table t3 like non_existing_table;
329
- --error 1050
323
+ --error ER_TABLE_EXISTS_ERROR
330
324
create temporary table t3 like t1;
331
325
drop table t1, t2, t3;
332
326
drop table t3;
@@ -360,7 +354,7 @@ SELECT @@storage_engine;
360
354
CREATE TABLE t1 (a int not null);
361
355
show create table t1;
362
356
drop table t1;
363
- --error 1286
357
+ --error ER_UNKNOWN_STORAGE_ENGINE
364
358
SET SESSION storage_engine="gemini";
365
359
SELECT @@storage_engine;
366
360
CREATE TABLE t1 (a int not null);
@@ -464,9 +458,9 @@ use test;
464
458
# Test for Bug 856 'Naming a key "Primary" causes trouble'
465
459
#
466
460
467
- --error 1280
461
+ --error ER_WRONG_NAME_FOR_INDEX
468
462
create table t1 (a int, index `primary` (a));
469
- --error 1280
463
+ --error ER_WRONG_NAME_FOR_INDEX
470
464
create table t1 (a int, index `PRIMARY` (a));
471
465
472
466
create table t1 (`primary` int, index(`primary`));
@@ -475,9 +469,9 @@ create table t2 (`PRIMARY` int, index(`PRIMARY`));
475
469
show create table t2;
476
470
477
471
create table t3 (a int);
478
- --error 1280
472
+ --error ER_WRONG_NAME_FOR_INDEX
479
473
alter table t3 add index `primary` (a);
480
- --error 1280
474
+ --error ER_WRONG_NAME_FOR_INDEX
481
475
alter table t3 add index `PRIMARY` (a);
482
476
483
477
create table t4 (`primary` int);
@@ -532,11 +526,11 @@ drop table t1;
532
526
#
533
527
# Bug#10413: Invalid column name is not rejected
534
528
#
535
- --error 1103
529
+ --error ER_WRONG_TABLE_NAME
536
530
create table t1(column.name int);
537
- --error 1103
531
+ --error ER_WRONG_TABLE_NAME
538
532
create table t1(test.column.name int);
539
- --error 1102
533
+ --error ER_WRONG_DB_NAME
540
534
create table t1(xyz.t1.name int);
541
535
create table t1(t1.name int);
542
536
create table t2(test.t2.name int);
@@ -575,7 +569,7 @@ drop table if exists test.t1;
575
569
create database mysqltest;
576
570
use mysqltest;
577
571
create view v1 as select 'foo' from dual;
578
- --error 1347
572
+ --error ER_WRONG_OBJECT
579
573
create table t1 like v1;
580
574
drop view v1;
581
575
drop database mysqltest;
@@ -696,7 +690,7 @@ drop table t1, t2;
696
690
#
697
691
# Bug #15316 SET value having comma not correctly handled
698
692
#
699
- --error 1367
693
+ --error ER_ILLEGAL_VALUE_FOR_TYPE
700
694
create table t1(a set("a,b","c,d") not null);
701
695
702
696
# End of 4.1 tests
@@ -894,9 +888,9 @@ INSERT IGNORE INTO t1 (b) VALUES (5);
894
888
895
889
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
896
890
SELECT a FROM t1;
897
- --error 1062
891
+ --error ER_DUP_ENTRY
898
892
INSERT INTO t2 SELECT a FROM t1;
899
- --error 1062
893
+ --error ER_DUP_ENTRY
900
894
INSERT INTO t2 SELECT a FROM t1;
901
895
902
896
DROP TABLE t1, t2;
@@ -956,24 +950,24 @@ drop table t1,t2;
956
950
# Test incorrect database names
957
951
#
958
952
959
- --error 1102
953
+ --error ER_WRONG_DB_NAME
960
954
CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
961
- --error 1102
955
+ --error ER_WRONG_DB_NAME
962
956
DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
963
957
964
958
# TODO: enable these tests when RENAME DATABASE is implemented.
965
- # --error 1049
959
+ # --error ER_BAD_DB_ERROR
966
960
# RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a;
967
- # --error 1102
961
+ # --error ER_WRONG_DB_NAME
968
962
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
969
963
# create database mysqltest;
970
- # --error 1102
964
+ # --error ER_WRONG_DB_NAME
971
965
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
972
966
# drop database mysqltest;
973
967
974
- --error 1102
968
+ --error ER_WRONG_DB_NAME
975
969
USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
976
- --error 1102
970
+ --error ER_WRONG_DB_NAME
977
971
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
978
972
979
973
#
@@ -1025,11 +1019,11 @@ before insert on имя_таблицы_в_кодировке_утф8_длино
1025
1019
select TRIGGER_NAME from information_schema.triggers where
1026
1020
trigger_schema='test';
1027
1021
drop trigger имя_триггера_в_кодировке_утф8_длиной_больше_чем_49;
1028
- --error 1059
1022
+ --error ER_TOO_LONG_IDENT
1029
1023
create trigger
1030
1024
очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66
1031
1025
before insert on имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1;
1032
- --error 1059
1026
+ --error ER_TOO_LONG_IDENT
1033
1027
drop trigger очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66;
1034
1028
1035
1029
create procedure имя_процедуры_в_кодировке_утф8_длиной_больше_чем_50()
@@ -1038,7 +1032,7 @@ end;
1038
1032
select ROUTINE_NAME from information_schema.routines where
1039
1033
routine_schema='test';
1040
1034
drop procedure имя_процедуры_в_кодировке_утф8_длиной_больше_чем_50;
1041
- --error 1059
1035
+ --error ER_TOO_LONG_IDENT
1042
1036
create procedure очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66()
1043
1037
begin
1044
1038
end;
@@ -1049,7 +1043,7 @@ return 0;
1049
1043
select ROUTINE_NAME from information_schema.routines where
1050
1044
routine_schema='test';
1051
1045
drop function имя_функции_в_кодировке_утф8_длиной_больше_чем_49;
1052
- --error 1059
1046
+ --error ER_TOO_LONG_IDENT
1053
1047
create function очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66()
1054
1048
returns int
1055
1049
return 0;
@@ -1917,16 +1911,22 @@ alter table t1 add
1917
1911
key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0064 (f64) comment 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy';
1918
1912
drop table t1;
1919
1913
1920
- --echo End of 5.5 tests
1914
+ --echo #
1915
+ --echo # End of 5.5 tests
1916
+ --echo #
1921
1917
1922
- #
1923
- # MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS
1924
- #
1918
+ --echo #
1919
+ --echo # MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS
1920
+ --echo #
1925
1921
--error ER_TABLE_MUST_HAVE_COLUMNS
1926
1922
create table t1;
1927
1923
1928
- #
1929
- # MDEV-11231 Server crashes in check_duplicate_key on CREATE TABLE ... SELECT
1930
- #
1924
+ --echo #
1925
+ --echo # MDEV-11231 Server crashes in check_duplicate_key on CREATE TABLE ... SELECT
1926
+ --echo #
1931
1927
create table t1 (i int, j int, key(i), key(i)) as select 1 as i, 2 as j;
1932
1928
drop table t1;
1929
+
1930
+ --echo #
1931
+ --echo # End of 10.0 tests
1932
+ --echo #
0 commit comments