~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/create.result

Merge Joe, plus I updated the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=MEMORY;
20
20
drop table t1;
21
21
create temporary table t2 engine=MEMORY select * from t1;
22
 
ERROR 42S02: Unknown table 'test.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;
26
26
Warnings:
27
27
Note    1051    Unknown table 't1'
36
36
create temporary table t1 (ordid int not null auto_increment, ord  varchar(50) not null, primary key (ord,ordid)) engine=MEMORY;
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`;
42
42
Table   Create Table
43
43
a/a     CREATE TABLE `a/a` (
44
 
  `a` INT DEFAULT NULL
45
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
44
  `a` int DEFAULT NULL
 
45
) ENGINE=DEFAULT
46
46
create table t1 like `a/a`;
47
47
show create table t1;
48
48
Table   Create Table
49
49
t1      CREATE TABLE `t1` (
50
 
  `a` INT DEFAULT NULL
51
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
50
  `a` int DEFAULT NULL
 
51
) ENGINE=DEFAULT
52
52
show create table `t1`;
53
53
Table   Create Table
54
54
t1      CREATE TABLE `t1` (
55
 
  `a` INT DEFAULT NULL
56
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
55
  `a` int DEFAULT NULL
 
56
) ENGINE=DEFAULT
57
57
drop table `a/a`;
58
58
drop table `t1`;
59
59
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
86
86
drop table t1;
87
87
drop database if exists mysqltest;
88
88
Warnings:
89
 
Note    1008    Can't drop schema 'mysqltest'; schema doesn't exist
 
89
Note    1008    Can't drop database 'mysqltest'; database doesn't exist
90
90
create database mysqltest;
91
91
create table mysqltest.$test1 (a$1 int, $b int, c$ int);
92
92
insert into mysqltest.$test1 values (1,2,3);
118
118
create table t2 select x from t1 where 1=2;
119
119
describe t1;
120
120
Field   Type    Null    Default Default_is_NULL On_Update
121
 
x       VARCHAR YES             YES     
 
121
x       VARCHAR TRUE            TRUE    
122
122
describe t2;
123
123
Field   Type    Null    Default Default_is_NULL On_Update
124
 
x       VARCHAR YES             YES     
 
124
x       VARCHAR TRUE            TRUE    
125
125
drop table t2;
126
126
create table t2 select now() as a , curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
127
127
describe t2;
128
128
Field   Type    Null    Default Default_is_NULL On_Update
129
 
a       DATETIME        YES             YES     
130
 
c       DATE    NO              NO      
131
 
d       INTEGER NO              NO      
132
 
e       DECIMAL NO              NO      
133
 
f       BIGINT  NO              NO      
 
129
a       DATETIME        TRUE            TRUE    
 
130
c       DATE    FALSE           FALSE   
 
131
d       INTEGER FALSE           FALSE   
 
132
e       DECIMAL FALSE           FALSE   
 
133
f       BIGINT  FALSE           FALSE   
134
134
drop table t2;
135
135
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("2001-12-29  20:45:11" AS DATETIME) as dt;
136
136
describe t2;
137
137
Field   Type    Null    Default Default_is_NULL On_Update
138
 
d       DATE    YES             YES     
139
 
dt      DATETIME        YES             YES     
 
138
d       DATE    TRUE            TRUE    
 
139
dt      DATETIME        TRUE            TRUE    
140
140
drop table t1,t2;
141
141
create table t1 (a int);
142
142
create table t2 (a int) select * from t1;
143
143
describe t1;
144
144
Field   Type    Null    Default Default_is_NULL On_Update
145
 
a       INTEGER YES             YES     
 
145
a       INTEGER TRUE            TRUE    
146
146
describe t2;
147
147
Field   Type    Null    Default Default_is_NULL On_Update
148
 
a       INTEGER YES             YES     
 
148
a       INTEGER TRUE            TRUE    
149
149
drop table if exists t2;
150
150
create table t2 (a int, a float) select * from t1;
151
151
ERROR 42S21: Duplicate column name 'a'
167
167
CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
168
168
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
169
169
SELECT * from t2;
170
 
ERROR 42S02: Unknown table 'test.t2'
 
170
ERROR 42S02: Table 'test.t2' doesn't exist
171
171
DROP TABLE t1;
172
172
DROP TABLE IF EXISTS t2;
173
173
Warnings:
176
176
show create table t1;
177
177
Table   Create Table
178
178
t1      CREATE TABLE `t1` (
179
 
  `a` INT NOT NULL,
180
 
  `b` INT DEFAULT NULL,
 
179
  `a` int NOT NULL,
 
180
  `b` int DEFAULT NULL,
181
181
  PRIMARY KEY (`a`),
182
182
  KEY `b` (`b`),
183
183
  KEY `b_2` (`b`),
210
210
  KEY `b_29` (`b`),
211
211
  KEY `b_30` (`b`),
212
212
  KEY `b_31` (`b`)
213
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
213
) ENGINE=DEFAULT
214
214
drop table t1;
215
215
create table t1 select if(1,'1','0'), month("2002-08-02");
216
216
drop table t1;
227
227
show create table t1;
228
228
Table   Create Table
229
229
t1      CREATE TEMPORARY TABLE `t1` (
230
 
  `a` INT NOT NULL
231
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
230
  `a` int NOT NULL
 
231
) ENGINE=MEMORY
232
232
drop table t1;
233
233
SET SESSION storage_engine="gemini";
234
234
ERROR 42000: Unknown table engine 'gemini'
239
239
show create table t1;
240
240
Table   Create Table
241
241
t1      CREATE TEMPORARY TABLE `t1` (
242
 
  `a` INT NOT NULL
243
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
242
  `a` int NOT NULL
 
243
) ENGINE=MEMORY
244
244
SET SESSION storage_engine=default;
245
245
drop table t1;
246
246
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
280
280
Level   Code    Message
281
281
Note    1050    Table 't1' already exists
282
282
Error   1062    Duplicate entry '3' for key 'PRIMARY'
283
 
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT AND TABLE_SCHEMA = SCHEMA() > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
 
283
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
284
284
TABLE_SCHEMA    TABLE_NAME      VERSION TABLE_COUNT     IS_NAME_LOCKED
285
285
select * from t1;
286
286
a       b
290
290
create table `t1 `(a int);
291
291
ERROR 42000: Incorrect table name 't1 '
292
292
create database `db1 `;
293
 
ERROR 42000: Incorrect schema name 'db1 '
 
293
ERROR 42000: Incorrect database name 'db1 '
294
294
create table t1(`a ` int);
295
295
ERROR 42000: Incorrect column name 'a '
296
296
create table t1 (a int,);
314
314
show create table t3;
315
315
Table   Create Table
316
316
t3      CREATE TABLE `t3` (
317
 
  `id` INT NOT NULL,
318
 
  `name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
319
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
317
  `id` int NOT NULL,
 
318
  `name` varchar(20) DEFAULT NULL
 
319
) ENGINE=DEFAULT
320
320
select * from t3;
321
321
id      name
322
322
create table if not exists t3 like t1;
329
329
show create table t3;
330
330
Table   Create Table
331
331
t3      CREATE TEMPORARY TABLE `t3` (
332
 
  `id` INT NOT NULL
333
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
332
  `id` int NOT NULL
 
333
) ENGINE=DEFAULT
334
334
select * from t3;
335
335
id
336
336
drop table t3;
337
337
show create table t3;
338
338
Table   Create Table
339
339
t3      CREATE TABLE `t3` (
340
 
  `id` INT NOT NULL,
341
 
  `name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
342
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
340
  `id` int NOT NULL,
 
341
  `name` varchar(20) DEFAULT NULL
 
342
) ENGINE=DEFAULT
343
343
select * from t3;
344
344
id      name
345
345
drop table t2, t3;
349
349
show create table t3;
350
350
Table   Create Table
351
351
t3      CREATE TEMPORARY TABLE `t3` (
352
 
  `id` INT NOT NULL,
353
 
  `name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
354
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
352
  `id` int NOT NULL,
 
353
  `name` varchar(20) DEFAULT NULL
 
354
) ENGINE=DEFAULT
355
355
create table t2 like t3;
356
356
show create table t2;
357
357
Table   Create Table
358
358
t2      CREATE TABLE `t2` (
359
 
  `id` INT NOT NULL,
360
 
  `name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
361
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
359
  `id` int NOT NULL,
 
360
  `name` varchar(20) DEFAULT NULL
 
361
) ENGINE=DEFAULT
362
362
select * from t2;
363
363
id      name
364
364
create table t3 like t1;
365
 
ERROR 42S01: Table 'test.t3' already exists
 
365
ERROR 42S01: Table 't3' already exists
366
366
create table t3 like mysqltest.t3;
367
 
ERROR 42S01: Table 'test.t3' already exists
 
367
ERROR 42S01: Table 't3' already exists
368
368
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'
 
369
ERROR 42000: Unknown database 'non_existing_database'
 
370
create table t3 like non_existing_table;
 
371
ERROR 42S02: Table 'test.non_existing_table' doesn't exist
372
372
create temporary table t3 like t1;
373
 
ERROR 42S01: Table 'test.#t3' already exists
 
373
ERROR 42S01: Table 't3' already exists
374
374
drop table t1, t2, t3;
375
375
drop database mysqltest;
376
376
SET SESSION storage_engine="MEMORY";
381
381
show create table t1;
382
382
Table   Create Table
383
383
t1      CREATE TEMPORARY TABLE `t1` (
384
 
  `a` INT NOT NULL
385
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
384
  `a` int NOT NULL
 
385
) ENGINE=MEMORY
386
386
drop table t1;
387
387
SET SESSION storage_engine="gemini";
388
388
ERROR 42000: Unknown table engine 'gemini'
393
393
show create table t1;
394
394
Table   Create Table
395
395
t1      CREATE TEMPORARY TABLE `t1` (
396
 
  `a` INT NOT NULL
397
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
396
  `a` int NOT NULL
 
397
) ENGINE=MEMORY
398
398
SET SESSION storage_engine=default;
399
399
drop table t1;
400
400
create table t1(a int,b int,c int,d date,e char,f datetime,h blob);
428
428
from t1;
429
429
explain t2;
430
430
Field   Type    Null    Default Default_is_NULL On_Update
431
 
a       INTEGER YES             YES     
432
 
b       BIGINT  NO              NO      
433
 
c       BIGINT  NO              NO      
434
 
d       DATE    YES             YES     
435
 
e       VARCHAR YES             YES     
436
 
f       DATETIME        YES             YES     
437
 
h       BLOB    YES             YES     
 
431
a       INTEGER TRUE            TRUE    
 
432
b       BIGINT  FALSE           FALSE   
 
433
c       BIGINT  FALSE           FALSE   
 
434
d       DATE    TRUE            TRUE    
 
435
e       VARCHAR TRUE            TRUE    
 
436
f       DATETIME        TRUE            TRUE    
 
437
h       BLOB    TRUE            TRUE    
438
438
select * from t2;
439
439
a       b       c       d       e       f       h
440
440
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     yet another binary data
441
441
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
442
442
drop table t1, t2;
443
443
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;
445
 
Table   Create Table
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
444
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
445
show create table t2;
462
446
Table   Create Table
463
447
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
 
448
  `ifnull(a,a)` int DEFAULT NULL,
 
449
  `ifnull(b,b)` int DEFAULT NULL,
 
450
  `ifnull(d,d)` int DEFAULT NULL,
 
451
  `ifnull(e,e)` bigint DEFAULT NULL,
 
452
  `ifnull(f,f)` double(3,2) DEFAULT NULL,
 
453
  `ifnull(g,g)` double(4,3) DEFAULT NULL,
 
454
  `ifnull(h,h)` decimal(5,4) DEFAULT NULL,
 
455
  `ifnull(j,j)` date DEFAULT NULL,
 
456
  `ifnull(k,k)` timestamp NULL DEFAULT NULL,
 
457
  `ifnull(l,l)` datetime DEFAULT NULL,
 
458
  `ifnull(m,m)` varchar(1) DEFAULT NULL,
 
459
  `ifnull(o,o)` varchar(10) DEFAULT NULL
 
460
) ENGINE=DEFAULT
477
461
drop table t1,t2;
478
462
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
479
463
insert into t1 values ('','',0,0.0);
480
464
describe t1;
481
465
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      
 
466
str     VARCHAR TRUE    def     FALSE   
 
467
strnull VARCHAR TRUE            TRUE    
 
468
intg    INTEGER TRUE    10      FALSE   
 
469
rel     DOUBLE  TRUE    3.14    FALSE   
486
470
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
487
471
describe t2;
488
472
Field   Type    Null    Default Default_is_NULL On_Update
489
 
str     VARCHAR YES             YES     
490
 
strnull VARCHAR YES             YES     
491
 
intg    INTEGER YES             YES     
492
 
rel     DOUBLE  YES             YES     
 
473
str     VARCHAR TRUE            TRUE    
 
474
strnull VARCHAR TRUE            TRUE    
 
475
intg    INTEGER TRUE            TRUE    
 
476
rel     DOUBLE  TRUE            TRUE    
493
477
drop table t1, t2;
494
478
create table t1(name varchar(10), age int default -1);
495
479
describe t1;
496
480
Field   Type    Null    Default Default_is_NULL On_Update
497
 
name    VARCHAR YES             YES     
498
 
age     INTEGER YES     -1      NO      
 
481
name    VARCHAR TRUE            TRUE    
 
482
age     INTEGER TRUE    -1      FALSE   
499
483
create table t2(name varchar(10), age int default - 1);
500
484
describe t2;
501
485
Field   Type    Null    Default Default_is_NULL On_Update
502
 
name    VARCHAR YES             YES     
503
 
age     INTEGER YES     -1      NO      
 
486
name    VARCHAR TRUE            TRUE    
 
487
age     INTEGER TRUE    -1      FALSE   
504
488
drop table t1, t2;
505
489
create table t1(cenum enum('a'));
506
490
create table t2(cenum enum('a','a'));
540
524
create table t1(test.column.name int);
541
525
ERROR 42000: Incorrect table name 'column'
542
526
create table t1(xyz.t1.name int);
543
 
ERROR 42000: Incorrect schema name 'xyz'
 
527
ERROR 42000: Incorrect database name 'xyz'
544
528
create table t1(t1.name int);
545
529
create table t2(test.t2.name int);
546
530
drop table t1,t2;
548
532
CREATE TABLE t2 AS SELECT LEFT(f1,171) AS f2 FROM t1 UNION SELECT LEFT(f1,171) AS f2 FROM t1;
549
533
DESC t2;
550
534
Field   Type    Null    Default Default_is_NULL On_Update
551
 
f2      VARCHAR YES             YES     
 
535
f2      VARCHAR TRUE            TRUE    
552
536
DROP TABLE t1,t2;
553
537
CREATE TABLE t12913 (f1 ENUM ('a','b')) AS SELECT 'a' AS f1;
554
538
SELECT * FROM t12913;
559
543
use mysqltest;
560
544
drop database mysqltest;
561
545
create table test.t1 like x;
562
 
ERROR 3D000: No schema selected
 
546
ERROR 3D000: No database selected
563
547
drop table if exists test.t1;
564
548
create database mysqltest;
565
549
create database if not exists mysqltest;
566
550
Warnings:
567
 
Note    1007    Can't create schema 'mysqltest'; schema exists
 
551
Note    1007    Can't create database 'mysqltest'; database exists
568
552
show create database mysqltest;
569
553
Database        Create Database
570
554
mysqltest       CREATE DATABASE `mysqltest` COLLATE = utf8_general_ci
582
566
show create table t1;
583
567
Table   Create Table
584
568
t1      CREATE TABLE `t1` (
585
 
  `a` VARCHAR(112) COLLATE utf8_bin NOT NULL,
 
569
  `a` varchar(112) COLLATE utf8_bin NOT NULL,
586
570
  PRIMARY KEY (`a`)
587
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
571
) ENGINE=DEFAULT
588
572
drop table t1;
589
573
CREATE TABLE t2 (
590
574
a int default NULL
597
581
show create table t1;
598
582
Table   Create Table
599
583
t1      CREATE TABLE `t1` (
600
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
601
 
  `b` INT NOT NULL,
 
584
  `a` varchar(12) COLLATE utf8_bin NOT NULL,
 
585
  `b` int NOT NULL,
602
586
  PRIMARY KEY (`a`)
603
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
587
) ENGINE=DEFAULT
604
588
drop table t1;
605
589
create table t1 ( 
606
590
a varchar(12) collate utf8_bin not null, 
614
598
show create table t1;
615
599
Table   Create Table
616
600
t1      CREATE TABLE `t1` (
617
 
  `b` INT DEFAULT NULL,
618
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
619
 
  `c` INT NOT NULL,
 
601
  `b` int DEFAULT NULL,
 
602
  `a` varchar(12) COLLATE utf8_bin NOT NULL,
 
603
  `c` int NOT NULL,
620
604
  PRIMARY KEY (`a`)
621
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
605
) ENGINE=DEFAULT
622
606
drop table t1;
623
607
create table t1 ( 
624
608
a varchar(12) collate utf8_bin not null,
627
611
show create table t1;
628
612
Table   Create Table
629
613
t1      CREATE TABLE `t1` (
630
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
631
 
  `b` INT NOT NULL,
 
614
  `a` varchar(12) COLLATE utf8_bin NOT NULL,
 
615
  `b` int NOT NULL,
632
616
  PRIMARY KEY (`a`)
633
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
617
) ENGINE=DEFAULT
634
618
drop table t1;
635
619
create table t1 ( 
636
620
a varchar(12) collate utf8_bin,
639
623
show create table t1;
640
624
Table   Create Table
641
625
t1      CREATE TABLE `t1` (
642
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
643
 
  `b` INT NOT NULL,
 
626
  `a` varchar(12) COLLATE utf8_bin NOT NULL,
 
627
  `b` int NOT NULL,
644
628
  PRIMARY KEY (`a`)
645
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
629
) ENGINE=DEFAULT
646
630
drop table t1, t2;
647
631
create table t1 ( 
648
632
a1 int not null,
675
659
show create table t2;
676
660
Table   Create Table
677
661
t2      CREATE TABLE `t2` (
678
 
  `a` INT DEFAULT '3',
679
 
  `b` INT DEFAULT '3',
680
 
  `a1` INT DEFAULT NULL,
681
 
  `a2` INT DEFAULT NULL
682
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
662
  `a` int DEFAULT '3',
 
663
  `b` int DEFAULT '3',
 
664
  `a1` int DEFAULT NULL,
 
665
  `a2` int DEFAULT NULL
 
666
) ENGINE=DEFAULT
683
667
drop table t1, t2;
684
668
create table t1 select * from t2;
685
 
ERROR 42S02: Unknown table 'test.t2'
 
669
ERROR 42S02: Table 'test.t2' doesn't exist
686
670
create table t1 select * from t1;
687
671
ERROR HY000: You can't specify target table 't1' for update in FROM clause
688
672
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
710
694
1
711
695
drop temporary table t1;
712
696
select * from t1;
713
 
ERROR 42S02: Unknown table 'test.t1'
 
697
ERROR 42S02: Table 'test.t1' doesn't exist
714
698
drop table t1;
715
699
ERROR 42S02: Unknown table 't1'
716
700
create table t1 (upgrade int);
850
834
show create table t1;
851
835
Table   Create Table
852
836
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,
 
837
  `c1` int DEFAULT NULL,
 
838
  `c2` int DEFAULT NULL,
 
839
  `c3` int DEFAULT NULL,
 
840
  `c4` int DEFAULT NULL,
 
841
  `c5` int DEFAULT NULL,
 
842
  `c6` int DEFAULT NULL,
 
843
  `c7` int DEFAULT NULL,
 
844
  `c8` int DEFAULT NULL,
 
845
  `c9` int DEFAULT NULL,
 
846
  `c10` int DEFAULT NULL,
 
847
  `c11` int DEFAULT NULL,
 
848
  `c12` int DEFAULT NULL,
 
849
  `c13` int DEFAULT NULL,
 
850
  `c14` int DEFAULT NULL,
 
851
  `c15` int DEFAULT NULL,
 
852
  `c16` int DEFAULT NULL,
869
853
  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
854
  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
855
  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
914
  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
915
  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
916
  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
 
917
) ENGINE=DEFAULT
934
918
flush tables;
935
919
show create table t1;
936
920
Table   Create Table
937
921
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,
 
922
  `c1` int DEFAULT NULL,
 
923
  `c2` int DEFAULT NULL,
 
924
  `c3` int DEFAULT NULL,
 
925
  `c4` int DEFAULT NULL,
 
926
  `c5` int DEFAULT NULL,
 
927
  `c6` int DEFAULT NULL,
 
928
  `c7` int DEFAULT NULL,
 
929
  `c8` int DEFAULT NULL,
 
930
  `c9` int DEFAULT NULL,
 
931
  `c10` int DEFAULT NULL,
 
932
  `c11` int DEFAULT NULL,
 
933
  `c12` int DEFAULT NULL,
 
934
  `c13` int DEFAULT NULL,
 
935
  `c14` int DEFAULT NULL,
 
936
  `c15` int DEFAULT NULL,
 
937
  `c16` int DEFAULT NULL,
954
938
  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
939
  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
940
  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
999
  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
1000
  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
1001
  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
 
1002
) ENGINE=DEFAULT
1019
1003
drop table t1;
1020
1004
create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, 
1021
1005
c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
1151
1135
show create table t1;
1152
1136
Table   Create Table
1153
1137
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,
 
1138
  `c1` int DEFAULT NULL,
 
1139
  `c2` int DEFAULT NULL,
 
1140
  `c3` int DEFAULT NULL,
 
1141
  `c4` int DEFAULT NULL,
 
1142
  `c5` int DEFAULT NULL,
 
1143
  `c6` int DEFAULT NULL,
 
1144
  `c7` int DEFAULT NULL,
 
1145
  `c8` int DEFAULT NULL,
 
1146
  `c9` int DEFAULT NULL,
 
1147
  `c10` int DEFAULT NULL,
 
1148
  `c11` int DEFAULT NULL,
 
1149
  `c12` int DEFAULT NULL,
 
1150
  `c13` int DEFAULT NULL,
 
1151
  `c14` int DEFAULT NULL,
 
1152
  `c15` int DEFAULT NULL,
 
1153
  `c16` int DEFAULT NULL,
1170
1154
  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
1155
  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
1156
  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
1215
  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
1216
  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
1217
  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
 
1218
) ENGINE=DEFAULT
1235
1219
flush tables;
1236
1220
show create table t1;
1237
1221
Table   Create Table
1238
1222
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,
 
1223
  `c1` int DEFAULT NULL,
 
1224
  `c2` int DEFAULT NULL,
 
1225
  `c3` int DEFAULT NULL,
 
1226
  `c4` int DEFAULT NULL,
 
1227
  `c5` int DEFAULT NULL,
 
1228
  `c6` int DEFAULT NULL,
 
1229
  `c7` int DEFAULT NULL,
 
1230
  `c8` int DEFAULT NULL,
 
1231
  `c9` int DEFAULT NULL,
 
1232
  `c10` int DEFAULT NULL,
 
1233
  `c11` int DEFAULT NULL,
 
1234
  `c12` int DEFAULT NULL,
 
1235
  `c13` int DEFAULT NULL,
 
1236
  `c14` int DEFAULT NULL,
 
1237
  `c15` int DEFAULT NULL,
 
1238
  `c16` int DEFAULT NULL,
1255
1239
  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
1240
  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
1241
  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
1300
  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
1301
  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
1302
  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
 
1303
) ENGINE=DEFAULT
1320
1304
alter table t1 add key 
1321
1305
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1322
1306
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1334
1318
show create table t1;
1335
1319
Table   Create Table
1336
1320
t1      CREATE TABLE `t1` (
1337
 
  `c1` INT DEFAULT NULL,
1338
 
  `c2` INT DEFAULT NULL,
1339
 
  `c3` INT DEFAULT NULL,
1340
 
  `c4` INT DEFAULT NULL,
1341
 
  `c5` INT DEFAULT NULL,
1342
 
  `c6` INT DEFAULT NULL,
1343
 
  `c7` INT DEFAULT NULL,
1344
 
  `c8` INT DEFAULT NULL,
1345
 
  `c9` INT DEFAULT NULL,
1346
 
  `c10` INT DEFAULT NULL,
1347
 
  `c11` INT DEFAULT NULL,
1348
 
  `c12` INT DEFAULT NULL,
1349
 
  `c13` INT DEFAULT NULL,
1350
 
  `c14` INT DEFAULT NULL,
1351
 
  `c15` INT DEFAULT NULL,
1352
 
  `c16` INT DEFAULT NULL,
1353
 
  `c17` INT DEFAULT NULL
1354
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
1321
  `c1` int DEFAULT NULL,
 
1322
  `c2` int DEFAULT NULL,
 
1323
  `c3` int DEFAULT NULL,
 
1324
  `c4` int DEFAULT NULL,
 
1325
  `c5` int DEFAULT NULL,
 
1326
  `c6` int DEFAULT NULL,
 
1327
  `c7` int DEFAULT NULL,
 
1328
  `c8` int DEFAULT NULL,
 
1329
  `c9` int DEFAULT NULL,
 
1330
  `c10` int DEFAULT NULL,
 
1331
  `c11` int DEFAULT NULL,
 
1332
  `c12` int DEFAULT NULL,
 
1333
  `c13` int DEFAULT NULL,
 
1334
  `c14` int DEFAULT NULL,
 
1335
  `c15` int DEFAULT NULL,
 
1336
  `c16` int DEFAULT NULL,
 
1337
  `c17` int DEFAULT NULL
 
1338
) ENGINE=DEFAULT
1355
1339
drop table t1;
1356
1340
 
1357
1341
Bug #26104 Bug on foreign key class constructor
1415
1399
a       b
1416
1400
drop table t1,t2;
1417
1401
CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1418
 
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 
1402
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1419
1403
DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1420
 
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 
1404
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1421
1405
USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1422
 
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 
1406
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1423
1407
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1424
 
Database        Create Database
 
1408
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1425
1409
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1426
1410
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1427
1411
select database();
1455
1439
show create table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1456
1440
Table   Create Table
1457
1441
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48       CREATE TABLE `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` (
1458
 
  `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` INT DEFAULT NULL,
 
1442
  `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` int DEFAULT NULL,
1459
1443
  KEY `имя_индекса_в_кодировке_утф8_длиной_больше_чем_48` (`имя_поля_в_кодировке_утф8_длиной_больше_чем_45`)
1460
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
1444
) ENGINE=DEFAULT
1461
1445
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1462
1446
create table t1 like data_dictionary.processlist;
1463
 
Got one of the listed errors
 
1447
ERROR HY000: Can't create table 'test.t1' (errno: 1)
1464
1448
create table t1 like data_dictionary.processlist engine=innodb;
1465
1449
show create table t1;
1466
1450
Table   Create Table
1467
1451
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
 
1452
  `ID` bigint NOT NULL DEFAULT '0',
 
1453
  `USER` varchar(16) NOT NULL DEFAULT '',
 
1454
  `HOST` varchar(1025) NOT NULL DEFAULT '',
 
1455
  `DB` varchar(256) NOT NULL DEFAULT '',
 
1456
  `COMMAND` varchar(16) NOT NULL DEFAULT '',
 
1457
  `TIME` bigint NOT NULL DEFAULT '0',
 
1458
  `STATE` varchar(256) NOT NULL DEFAULT '',
 
1459
  `INFO` varchar(100) NOT NULL DEFAULT ''
 
1460
) ENGINE=InnoDB
1478
1461
drop table t1;
1479
1462
create temporary table t1 like data_dictionary.processlist;
1480
 
Got one of the listed errors
 
1463
ERROR HY000: Can't create table 'test.#t1' (errno: 138)
1481
1464
create temporary table t1 like data_dictionary.processlist engine=myisam;
1482
1465
show create table t1;
1483
1466
Table   Create Table
1484
1467
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
 
1468
  `ID` bigint NOT NULL DEFAULT '0',
 
1469
  `USER` varchar(16) NOT NULL DEFAULT '',
 
1470
  `HOST` varchar(1025) NOT NULL DEFAULT '',
 
1471
  `DB` varchar(256) NOT NULL DEFAULT '',
 
1472
  `COMMAND` varchar(16) NOT NULL DEFAULT '',
 
1473
  `TIME` bigint NOT NULL DEFAULT '0',
 
1474
  `STATE` varchar(256) NOT NULL DEFAULT '',
 
1475
  `INFO` varchar(100) NOT NULL DEFAULT ''
 
1476
) ENGINE=MyISAM
1495
1477
drop table t1;
1496
1478
 
1497
1479
# --
1514
1496
SHOW CREATE TABLE t1;
1515
1497
Table   Create Table
1516
1498
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
 
1499
  `c1` int DEFAULT '12' COMMENT 'column1',
 
1500
  `c2` int DEFAULT NULL COMMENT 'column2',
 
1501
  `c3` int NOT NULL COMMENT 'column3',
 
1502
  `c4` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
 
1503
  `c5` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'b',
 
1504
  `c6` varchar(255) COLLATE utf8_bin DEFAULT NULL
 
1505
) ENGINE=DEFAULT
1524
1506
 
1525
1507
CREATE TABLE t2 AS SELECT * FROM t1;
1526
1508
 
1527
1509
SHOW CREATE TABLE t2;
1528
1510
Table   Create Table
1529
1511
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
 
1512
  `c1` int DEFAULT '12' COMMENT 'column1',
 
1513
  `c2` int DEFAULT NULL COMMENT 'column2',
 
1514
  `c3` int NOT NULL COMMENT 'column3',
 
1515
  `c4` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
 
1516
  `c5` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'b',
 
1517
  `c6` varchar(255) COLLATE utf8_bin DEFAULT NULL
 
1518
) ENGINE=DEFAULT
1537
1519
 
1538
1520
DROP TABLE t2;
1539
1521