19
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=MEMORY;
19
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=heap;
21
create temporary table t2 engine=MEMORY select * from t1;
22
ERROR 42S02: Unknown table 'test.t1'
21
create temporary table t2 engine=heap select * from t1;
22
ERROR 42S02: Table 'test.t1' doesn't exist
23
23
create table t2 select auto+1 from t1;
24
ERROR 42S02: Unknown table 'test.t1'
24
ERROR 42S02: Table 'test.t1' doesn't exist
25
25
drop table if exists t1,t2;
27
27
Note 1051 Unknown table 't1'
28
28
Note 1051 Unknown table 't2'
29
29
create table t1 (b char(0) not null, index(b));
30
30
ERROR 42000: The used storage engine can't index column 'b'
31
create temporary table t1 (a int not null,b text) engine=MEMORY;
31
create temporary table t1 (a int not null,b text) engine=heap;
32
32
ERROR 42000: The used table type doesn't support BLOB/TEXT columns
33
33
drop table if exists t1;
35
35
Note 1051 Unknown table 't1'
36
create temporary table t1 (ordid int not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=MEMORY;
36
create temporary table t1 (ordid int not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
37
37
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
38
38
create table not_existing_database.test (a int);
39
ERROR 42000: Unknown schema 'not_existing_database'
39
ERROR 42000: Unknown database 'not_existing_database'
40
40
create table `a/a` (a int);
41
41
show create table `a/a`;
43
43
a/a CREATE TABLE `a/a` (
45
) ENGINE=DEFAULT COLLATE = utf8_general_ci
46
46
create table t1 like `a/a`;
49
t1 CREATE TABLE `t1` (
51
) ENGINE=DEFAULT COLLATE = utf8_general_ci
52
show create table `t1`;
54
t1 CREATE TABLE `t1` (
56
) ENGINE=DEFAULT COLLATE = utf8_general_ci
59
49
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
117
107
create table t1(x varchar(50) );
118
108
create table t2 select x from t1 where 1=2;
120
Field Type Null Default Default_is_NULL On_Update
110
Field Type Null Key Default Extra
111
x varchar(50) YES NULL
123
Field Type Null Default Default_is_NULL On_Update
113
Field Type Null Key Default Extra
114
x varchar(50) YES NULL
126
116
create table t2 select now() as a , curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
128
Field Type Null Default Default_is_NULL On_Update
118
Field Type Null Key Default Extra
122
e decimal(3,1) NO NULL
135
125
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
137
Field Type Null Default Default_is_NULL On_Update
127
Field Type Null Key Default Extra
140
130
drop table t1,t2;
141
131
create table t1 (a int);
142
132
create table t2 (a int) select * from t1;
144
Field Type Null Default Default_is_NULL On_Update
134
Field Type Null Key Default Extra
147
Field Type Null Default Default_is_NULL On_Update
137
Field Type Null Key Default Extra
149
139
drop table if exists t2;
150
140
create table t2 (a int, a float) select * from t1;
151
141
ERROR 42S21: Duplicate column name 'a'
349
340
show create table t3;
350
341
Table Create Table
351
342
t3 CREATE TEMPORARY TABLE `t3` (
353
`name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
354
) ENGINE=DEFAULT COLLATE = utf8_general_ci
344
`name` varchar(20) DEFAULT NULL
355
346
create table t2 like t3;
356
347
show create table t2;
357
348
Table Create Table
358
349
t2 CREATE TABLE `t2` (
360
`name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
361
) ENGINE=DEFAULT COLLATE = utf8_general_ci
351
`name` varchar(20) DEFAULT NULL
362
353
select * from t2;
364
355
create table t3 like t1;
365
ERROR 42S01: Table 'test.t3' already exists
366
356
create table t3 like mysqltest.t3;
367
ERROR 42S01: Table 'test.t3' already exists
357
ERROR 42S01: Table 't3' already exists
368
358
create table non_existing_database.t1 like t1;
369
ERROR 42000: Unknown schema 'non_existing_database'
370
create table t4 like non_existing_table;
371
ERROR 42S02: Unknown table 'test.non_existing_table'
359
ERROR 42000: Unknown database 'non_existing_database'
360
create table t3 like non_existing_table;
361
ERROR 42S02: Table 'test.non_existing_table' doesn't exist
372
362
create temporary table t3 like t1;
373
ERROR 42S01: Table 'test.#t3' already exists
363
ERROR 42S01: Table 't3' already exists
374
364
drop table t1, t2, t3;
375
366
drop database mysqltest;
376
SET SESSION storage_engine="MEMORY";
367
SET SESSION storage_engine="heap";
377
368
SELECT @@storage_engine;
427
418
ifnull(h,cast('yet another binary data' as binary)) as h
430
Field Type Null Default Default_is_NULL On_Update
421
Field Type Null Key Default Extra
426
e varchar(1) YES NULL
438
429
select * from t2;
440
431
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 yet another binary data
441
432
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 binary data
442
433
drop table t1, t2;
443
434
create table t1 (a int, b int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), o char(10));
444
SHOW CREATE TABLE t1;
446
t1 CREATE TABLE `t1` (
447
`a` INT DEFAULT NULL,
448
`b` INT DEFAULT NULL,
449
`d` INT DEFAULT NULL,
450
`e` BIGINT DEFAULT NULL,
451
`f` DOUBLE(3,2) DEFAULT NULL,
452
`g` DOUBLE(4,3) DEFAULT NULL,
453
`h` DECIMAL(5,4) DEFAULT NULL,
454
`j` DATE DEFAULT NULL,
455
`k` TIMESTAMP NULL DEFAULT NULL,
456
`l` DATETIME DEFAULT NULL,
457
`m` ENUM('a','b') DEFAULT NULL,
458
`o` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
459
) ENGINE=InnoDB COLLATE = utf8_general_ci
460
435
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
461
436
show create table t2;
462
437
Table Create Table
463
438
t2 CREATE TABLE `t2` (
464
`ifnull(a,a)` INT DEFAULT NULL,
465
`ifnull(b,b)` INT DEFAULT NULL,
466
`ifnull(d,d)` INT DEFAULT NULL,
467
`ifnull(e,e)` BIGINT DEFAULT NULL,
468
`ifnull(f,f)` DOUBLE(3,2) DEFAULT NULL,
469
`ifnull(g,g)` DOUBLE(4,3) DEFAULT NULL,
470
`ifnull(h,h)` DECIMAL(5,4) DEFAULT NULL,
471
`ifnull(j,j)` DATE DEFAULT NULL,
472
`ifnull(k,k)` TIMESTAMP NULL DEFAULT NULL,
473
`ifnull(l,l)` DATETIME DEFAULT NULL,
474
`ifnull(m,m)` VARCHAR(1) COLLATE utf8_general_ci DEFAULT NULL,
475
`ifnull(o,o)` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
476
) ENGINE=DEFAULT COLLATE = utf8_general_ci
439
`ifnull(a,a)` int DEFAULT NULL,
440
`ifnull(b,b)` int DEFAULT NULL,
441
`ifnull(d,d)` int DEFAULT NULL,
442
`ifnull(e,e)` bigint DEFAULT NULL,
443
`ifnull(f,f)` double(3,2) DEFAULT NULL,
444
`ifnull(g,g)` double(4,3) DEFAULT NULL,
445
`ifnull(h,h)` decimal(5,4) DEFAULT NULL,
446
`ifnull(j,j)` date DEFAULT NULL,
447
`ifnull(k,k)` timestamp NULL DEFAULT NULL,
448
`ifnull(l,l)` datetime DEFAULT NULL,
449
`ifnull(m,m)` varchar(1) DEFAULT NULL,
450
`ifnull(o,o)` varchar(10) DEFAULT NULL
477
452
drop table t1,t2;
478
453
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
479
454
insert into t1 values ('','',0,0.0);
481
Field Type Null Default Default_is_NULL On_Update
482
str VARCHAR YES def NO
483
strnull VARCHAR YES YES
484
intg INTEGER YES 10 NO
485
rel DOUBLE YES 3.14 NO
456
Field Type Null Key Default Extra
457
str varchar(10) YES def
458
strnull varchar(10) YES NULL
486
461
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
488
Field Type Null Default Default_is_NULL On_Update
490
strnull VARCHAR YES YES
463
Field Type Null Key Default Extra
464
str varchar(10) YES NULL
465
strnull varchar(10) YES NULL
493
468
drop table t1, t2;
494
469
create table t1(name varchar(10), age int default -1);
496
Field Type Null Default Default_is_NULL On_Update
498
age INTEGER YES -1 NO
471
Field Type Null Key Default Extra
472
name varchar(10) YES NULL
499
474
create table t2(name varchar(10), age int default - 1);
501
Field Type Null Default Default_is_NULL On_Update
503
age INTEGER YES -1 NO
476
Field Type Null Key Default Extra
477
name varchar(10) YES NULL
504
479
drop table t1, t2;
505
480
create table t1(cenum enum('a'));
506
481
create table t2(cenum enum('a','a'));
850
825
show create table t1;
851
826
Table Create Table
852
827
t1 CREATE TABLE `t1` (
853
`c1` INT DEFAULT NULL,
854
`c2` INT DEFAULT NULL,
855
`c3` INT DEFAULT NULL,
856
`c4` INT DEFAULT NULL,
857
`c5` INT DEFAULT NULL,
858
`c6` INT DEFAULT NULL,
859
`c7` INT DEFAULT NULL,
860
`c8` INT DEFAULT NULL,
861
`c9` INT DEFAULT NULL,
862
`c10` INT DEFAULT NULL,
863
`c11` INT DEFAULT NULL,
864
`c12` INT DEFAULT NULL,
865
`c13` INT DEFAULT NULL,
866
`c14` INT DEFAULT NULL,
867
`c15` INT DEFAULT NULL,
868
`c16` INT DEFAULT NULL,
828
`c1` int DEFAULT NULL,
829
`c2` int DEFAULT NULL,
830
`c3` int DEFAULT NULL,
831
`c4` int DEFAULT NULL,
832
`c5` int DEFAULT NULL,
833
`c6` int DEFAULT NULL,
834
`c7` int DEFAULT NULL,
835
`c8` int DEFAULT NULL,
836
`c9` int DEFAULT NULL,
837
`c10` int DEFAULT NULL,
838
`c11` int DEFAULT NULL,
839
`c12` int DEFAULT NULL,
840
`c13` int DEFAULT NULL,
841
`c14` int DEFAULT NULL,
842
`c15` int DEFAULT NULL,
843
`c16` int DEFAULT NULL,
869
844
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
870
845
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
871
846
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
930
905
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
931
906
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
932
907
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
933
) ENGINE=DEFAULT COLLATE = utf8_general_ci
935
910
show create table t1;
936
911
Table Create Table
937
912
t1 CREATE TABLE `t1` (
938
`c1` INT DEFAULT NULL,
939
`c2` INT DEFAULT NULL,
940
`c3` INT DEFAULT NULL,
941
`c4` INT DEFAULT NULL,
942
`c5` INT DEFAULT NULL,
943
`c6` INT DEFAULT NULL,
944
`c7` INT DEFAULT NULL,
945
`c8` INT DEFAULT NULL,
946
`c9` INT DEFAULT NULL,
947
`c10` INT DEFAULT NULL,
948
`c11` INT DEFAULT NULL,
949
`c12` INT DEFAULT NULL,
950
`c13` INT DEFAULT NULL,
951
`c14` INT DEFAULT NULL,
952
`c15` INT DEFAULT NULL,
953
`c16` INT DEFAULT NULL,
913
`c1` int DEFAULT NULL,
914
`c2` int DEFAULT NULL,
915
`c3` int DEFAULT NULL,
916
`c4` int DEFAULT NULL,
917
`c5` int DEFAULT NULL,
918
`c6` int DEFAULT NULL,
919
`c7` int DEFAULT NULL,
920
`c8` int DEFAULT NULL,
921
`c9` int DEFAULT NULL,
922
`c10` int DEFAULT NULL,
923
`c11` int DEFAULT NULL,
924
`c12` int DEFAULT NULL,
925
`c13` int DEFAULT NULL,
926
`c14` int DEFAULT NULL,
927
`c15` int DEFAULT NULL,
928
`c16` int DEFAULT NULL,
954
929
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
955
930
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
956
931
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1015
990
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1016
991
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1017
992
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1018
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1020
995
create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
1021
996
c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
1151
1126
show create table t1;
1152
1127
Table Create Table
1153
1128
t1 CREATE TABLE `t1` (
1154
`c1` INT DEFAULT NULL,
1155
`c2` INT DEFAULT NULL,
1156
`c3` INT DEFAULT NULL,
1157
`c4` INT DEFAULT NULL,
1158
`c5` INT DEFAULT NULL,
1159
`c6` INT DEFAULT NULL,
1160
`c7` INT DEFAULT NULL,
1161
`c8` INT DEFAULT NULL,
1162
`c9` INT DEFAULT NULL,
1163
`c10` INT DEFAULT NULL,
1164
`c11` INT DEFAULT NULL,
1165
`c12` INT DEFAULT NULL,
1166
`c13` INT DEFAULT NULL,
1167
`c14` INT DEFAULT NULL,
1168
`c15` INT DEFAULT NULL,
1169
`c16` INT DEFAULT NULL,
1129
`c1` int DEFAULT NULL,
1130
`c2` int DEFAULT NULL,
1131
`c3` int DEFAULT NULL,
1132
`c4` int DEFAULT NULL,
1133
`c5` int DEFAULT NULL,
1134
`c6` int DEFAULT NULL,
1135
`c7` int DEFAULT NULL,
1136
`c8` int DEFAULT NULL,
1137
`c9` int DEFAULT NULL,
1138
`c10` int DEFAULT NULL,
1139
`c11` int DEFAULT NULL,
1140
`c12` int DEFAULT NULL,
1141
`c13` int DEFAULT NULL,
1142
`c14` int DEFAULT NULL,
1143
`c15` int DEFAULT NULL,
1144
`c16` int DEFAULT NULL,
1170
1145
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1171
1146
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1172
1147
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1231
1206
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1232
1207
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1233
1208
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1234
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1236
1211
show create table t1;
1237
1212
Table Create Table
1238
1213
t1 CREATE TABLE `t1` (
1239
`c1` INT DEFAULT NULL,
1240
`c2` INT DEFAULT NULL,
1241
`c3` INT DEFAULT NULL,
1242
`c4` INT DEFAULT NULL,
1243
`c5` INT DEFAULT NULL,
1244
`c6` INT DEFAULT NULL,
1245
`c7` INT DEFAULT NULL,
1246
`c8` INT DEFAULT NULL,
1247
`c9` INT DEFAULT NULL,
1248
`c10` INT DEFAULT NULL,
1249
`c11` INT DEFAULT NULL,
1250
`c12` INT DEFAULT NULL,
1251
`c13` INT DEFAULT NULL,
1252
`c14` INT DEFAULT NULL,
1253
`c15` INT DEFAULT NULL,
1254
`c16` INT DEFAULT NULL,
1214
`c1` int DEFAULT NULL,
1215
`c2` int DEFAULT NULL,
1216
`c3` int DEFAULT NULL,
1217
`c4` int DEFAULT NULL,
1218
`c5` int DEFAULT NULL,
1219
`c6` int DEFAULT NULL,
1220
`c7` int DEFAULT NULL,
1221
`c8` int DEFAULT NULL,
1222
`c9` int DEFAULT NULL,
1223
`c10` int DEFAULT NULL,
1224
`c11` int DEFAULT NULL,
1225
`c12` int DEFAULT NULL,
1226
`c13` int DEFAULT NULL,
1227
`c14` int DEFAULT NULL,
1228
`c15` int DEFAULT NULL,
1229
`c16` int DEFAULT NULL,
1255
1230
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1256
1231
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1257
1232
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1316
1291
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1317
1292
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1318
1293
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1319
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1320
1295
alter table t1 add key
1321
1296
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1322
1297
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1416
1397
drop table t1,t2;
1417
1398
CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1418
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1399
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1419
1400
DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1420
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1401
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1421
1402
USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1422
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1403
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1423
1404
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1424
Database Create Database
1405
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1425
1406
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1426
1407
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1427
1408
select database();
1429
1410
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
1431
select SCHEMA_NAME from data_dictionary.schemas
1412
select SCHEMA_NAME from information_schema.schemata
1432
1413
where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
1434
1415
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
1441
1422
select * from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1442
1423
имя_поля_в_кодировке_утф8_длиной_больше_чем_45
1443
select TABLE_NAME from data_dictionary.tables where
1424
select TABLE_NAME from information_schema.tables where
1444
1425
table_schema='test';
1446
1427
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48
1447
select COLUMN_NAME from data_dictionary.columns where
1428
select COLUMN_NAME from information_schema.columns where
1448
1429
table_schema='test';
1450
1431
имя_поля_в_кодировке_утф8_длиной_больше_чем_45
1451
select INDEX_NAME from data_dictionary.indexes where
1432
select INDEX_NAME from information_schema.statistics where
1452
1433
table_schema='test';
1454
1435
имя_индекса_в_кодировке_утф8_длиной_больше_чем_48
1455
1436
show create table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1456
1437
Table Create Table
1457
1438
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 CREATE TABLE `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` (
1458
`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` INT DEFAULT NULL,
1439
`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` int DEFAULT NULL,
1459
1440
KEY `имя_индекса_в_кодировке_утф8_длиной_больше_чем_48` (`имя_поля_в_кодировке_утф8_длиной_больше_чем_45`)
1460
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1461
1442
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1462
create table t1 like data_dictionary.processlist;
1463
Got one of the listed errors
1464
create table t1 like data_dictionary.processlist engine=innodb;
1443
create table t1 like information_schema.processlist;
1465
1444
show create table t1;
1466
1445
Table Create Table
1467
1446
t1 CREATE TABLE `t1` (
1468
`ID` BIGINT NOT NULL,
1469
`USERNAME` VARCHAR(16) NOT NULL,
1470
`HOST` VARCHAR(1025) NOT NULL,
1471
`DB` VARCHAR(256) DEFAULT NULL,
1472
`COMMAND` VARCHAR(16) NOT NULL,
1473
`TIME` BIGINT UNSIGNED NOT NULL,
1474
`STATE` VARCHAR(256) DEFAULT NULL,
1475
`INFO` VARCHAR(100) DEFAULT NULL,
1476
`HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
1477
) ENGINE=InnoDB COLLATE = utf8_general_ci
1447
`ID` bigint NOT NULL DEFAULT '0',
1448
`USER` varchar(16) NOT NULL DEFAULT '',
1449
`HOST` varchar(64) NOT NULL DEFAULT '',
1450
`DB` varchar(64) DEFAULT NULL,
1451
`COMMAND` varchar(16) NOT NULL DEFAULT '',
1452
`TIME` bigint NOT NULL DEFAULT '0',
1453
`STATE` varchar(64) DEFAULT NULL,
1479
create temporary table t1 like data_dictionary.processlist;
1480
Got one of the listed errors
1481
create temporary table t1 like data_dictionary.processlist engine=myisam;
1457
create temporary table t1 like information_schema.processlist;
1482
1458
show create table t1;
1483
1459
Table Create Table
1484
1460
t1 CREATE TEMPORARY TABLE `t1` (
1485
`ID` BIGINT NOT NULL,
1486
`USERNAME` VARCHAR(16) NOT NULL,
1487
`HOST` VARCHAR(1025) NOT NULL,
1488
`DB` VARCHAR(256) DEFAULT NULL,
1489
`COMMAND` VARCHAR(16) NOT NULL,
1490
`TIME` BIGINT UNSIGNED NOT NULL,
1491
`STATE` VARCHAR(256) DEFAULT NULL,
1492
`INFO` VARCHAR(100) DEFAULT NULL,
1493
`HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
1494
) ENGINE=MyISAM COLLATE = utf8_general_ci
1461
`ID` bigint NOT NULL DEFAULT '0',
1462
`USER` varchar(16) NOT NULL DEFAULT '',
1463
`HOST` varchar(64) NOT NULL DEFAULT '',
1464
`DB` varchar(64) DEFAULT NULL,
1465
`COMMAND` varchar(16) NOT NULL DEFAULT '',
1466
`TIME` bigint NOT NULL DEFAULT '0',
1467
`STATE` varchar(64) DEFAULT NULL,
1509
1484
c4 VARCHAR(255) NOT NULL DEFAULT 'a',
1510
1485
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
1511
1486
c6 VARCHAR(255))
1514
1489
SHOW CREATE TABLE t1;
1515
1490
Table Create Table
1516
1491
t1 CREATE TABLE `t1` (
1517
`c1` INT DEFAULT '12' COMMENT 'column1',
1518
`c2` INT DEFAULT NULL COMMENT 'column2',
1519
`c3` INT NOT NULL COMMENT 'column3',
1520
`c4` VARCHAR(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1521
`c5` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT 'b',
1522
`c6` VARCHAR(255) COLLATE utf8_bin DEFAULT NULL
1523
) ENGINE=DEFAULT COLLATE = utf8_bin
1492
`c1` int DEFAULT '12' COMMENT 'column1',
1493
`c2` int DEFAULT NULL COMMENT 'column2',
1494
`c3` int NOT NULL COMMENT 'column3',
1495
`c4` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1496
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
1497
`c6` varchar(255) COLLATE utf8_bin DEFAULT NULL
1525
1500
CREATE TABLE t2 AS SELECT * FROM t1;
1527
1502
SHOW CREATE TABLE t2;
1528
1503
Table Create Table
1529
1504
t2 CREATE TABLE `t2` (
1530
`c1` INT DEFAULT '12' COMMENT 'column1',
1531
`c2` INT DEFAULT NULL COMMENT 'column2',
1532
`c3` INT NOT NULL COMMENT 'column3',
1533
`c4` VARCHAR(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1534
`c5` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT 'b',
1535
`c6` VARCHAR(255) COLLATE utf8_bin DEFAULT NULL
1536
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1505
`c1` int DEFAULT '12' COMMENT 'column1',
1506
`c2` int DEFAULT NULL COMMENT 'column2',
1507
`c3` int NOT NULL COMMENT 'column3',
1508
`c4` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT 'a',
1509
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
1510
`c6` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL