~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/create.result

Merge Stewart's dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
select * from t1;
17
17
b
18
18
drop table t1;
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;
20
20
drop table t1;
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;
26
26
Warnings:
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;
34
34
Warnings:
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`;
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
 
show create table t1;
48
 
Table   Create Table
49
 
t1      CREATE TABLE `t1` (
50
 
  `a` INT DEFAULT NULL
51
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
52
 
show create table `t1`;
53
 
Table   Create Table
54
 
t1      CREATE TABLE `t1` (
55
 
  `a` INT DEFAULT NULL
56
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
57
47
drop table `a/a`;
58
48
drop table `t1`;
59
49
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
86
76
drop table t1;
87
77
drop database if exists mysqltest;
88
78
Warnings:
89
 
Note    1008    Can't drop schema 'mysqltest'; schema doesn't exist
 
79
Note    1008    Can't drop database 'mysqltest'; database doesn't exist
90
80
create database mysqltest;
91
81
create table mysqltest.$test1 (a$1 int, $b int, c$ int);
92
82
insert into mysqltest.$test1 values (1,2,3);
117
107
create table t1(x varchar(50) );
118
108
create table t2 select x from t1 where 1=2;
119
109
describe t1;
120
 
Field   Type    Null    Default Default_is_NULL On_Update
121
 
x       VARCHAR YES             YES     
 
110
Field   Type    Null    Key     Default Extra
 
111
x       varchar(50)     YES             NULL    
122
112
describe t2;
123
 
Field   Type    Null    Default Default_is_NULL On_Update
124
 
x       VARCHAR YES             YES     
 
113
Field   Type    Null    Key     Default Extra
 
114
x       varchar(50)     YES             NULL    
125
115
drop table t2;
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;
127
117
describe t2;
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      
 
118
Field   Type    Null    Key     Default Extra
 
119
a       datetime        YES             NULL    
 
120
c       date    NO              NULL    
 
121
d       int     NO              NULL    
 
122
e       decimal(3,1)    NO              NULL    
 
123
f       bigint  NO              NULL    
134
124
drop table t2;
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;
136
126
describe t2;
137
 
Field   Type    Null    Default Default_is_NULL On_Update
138
 
d       DATE    YES             YES     
139
 
dt      DATETIME        YES             YES     
 
127
Field   Type    Null    Key     Default Extra
 
128
d       date    YES             NULL    
 
129
dt      datetime        YES             NULL    
140
130
drop table t1,t2;
141
131
create table t1 (a int);
142
132
create table t2 (a int) select * from t1;
143
133
describe t1;
144
 
Field   Type    Null    Default Default_is_NULL On_Update
145
 
a       INTEGER YES             YES     
 
134
Field   Type    Null    Key     Default Extra
 
135
a       int     YES             NULL    
146
136
describe t2;
147
 
Field   Type    Null    Default Default_is_NULL On_Update
148
 
a       INTEGER YES             YES     
 
137
Field   Type    Null    Key     Default Extra
 
138
a       int     YES             NULL    
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'
167
157
CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
168
158
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
169
159
SELECT * from t2;
170
 
ERROR 42S02: Unknown table 'test.t2'
 
160
ERROR 42S02: Table 'test.t2' doesn't exist
171
161
DROP TABLE t1;
172
162
DROP TABLE IF EXISTS t2;
173
163
Warnings:
176
166
show create table t1;
177
167
Table   Create Table
178
168
t1      CREATE TABLE `t1` (
179
 
  `a` INT NOT NULL,
180
 
  `b` INT DEFAULT NULL,
 
169
  `a` int NOT NULL,
 
170
  `b` int DEFAULT NULL,
181
171
  PRIMARY KEY (`a`),
182
172
  KEY `b` (`b`),
183
173
  KEY `b_2` (`b`),
210
200
  KEY `b_29` (`b`),
211
201
  KEY `b_30` (`b`),
212
202
  KEY `b_31` (`b`)
213
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
203
) ENGINE=DEFAULT
214
204
drop table t1;
215
205
create table t1 select if(1,'1','0'), month("2002-08-02");
216
206
drop table t1;
219
209
if('2002'='2002','Y','N')
220
210
Y
221
211
drop table if exists t1;
222
 
SET SESSION storage_engine="MEMORY";
 
212
SET SESSION storage_engine="heap";
223
213
SELECT @@storage_engine;
224
214
@@storage_engine
225
215
MEMORY
227
217
show create table t1;
228
218
Table   Create Table
229
219
t1      CREATE TEMPORARY TABLE `t1` (
230
 
  `a` INT NOT NULL
231
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
220
  `a` int NOT NULL
 
221
) ENGINE=MEMORY
232
222
drop table t1;
233
223
SET SESSION storage_engine="gemini";
234
224
ERROR 42000: Unknown table engine 'gemini'
239
229
show create table t1;
240
230
Table   Create Table
241
231
t1      CREATE TEMPORARY TABLE `t1` (
242
 
  `a` INT NOT NULL
243
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
232
  `a` int NOT NULL
 
233
) ENGINE=MEMORY
244
234
SET SESSION storage_engine=default;
245
235
drop table t1;
246
236
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
280
270
Level   Code    Message
281
271
Note    1050    Table 't1' already exists
282
272
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;
284
 
TABLE_SCHEMA    TABLE_NAME      VERSION TABLE_COUNT     IS_NAME_LOCKED
 
273
show status like "Opened_tables";
 
274
Variable_name   Value
 
275
Opened_tables   2
285
276
select * from t1;
286
277
a       b
287
278
1       1
290
281
create table `t1 `(a int);
291
282
ERROR 42000: Incorrect table name 't1 '
292
283
create database `db1 `;
293
 
ERROR 42000: Incorrect schema name 'db1 '
 
284
ERROR 42000: Incorrect database name 'db1 '
294
285
create table t1(`a ` int);
295
286
ERROR 42000: Incorrect column name 'a '
296
287
create table t1 (a int,);
314
305
show create table t3;
315
306
Table   Create Table
316
307
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
 
308
  `id` int NOT NULL,
 
309
  `name` varchar(20) DEFAULT NULL
 
310
) ENGINE=DEFAULT
320
311
select * from t3;
321
312
id      name
322
313
create table if not exists t3 like t1;
329
320
show create table t3;
330
321
Table   Create Table
331
322
t3      CREATE TEMPORARY TABLE `t3` (
332
 
  `id` INT NOT NULL
333
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
323
  `id` int NOT NULL
 
324
) ENGINE=DEFAULT
334
325
select * from t3;
335
326
id
336
327
drop table t3;
337
328
show create table t3;
338
329
Table   Create Table
339
330
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
 
331
  `id` int NOT NULL,
 
332
  `name` varchar(20) DEFAULT NULL
 
333
) ENGINE=DEFAULT
343
334
select * from t3;
344
335
id      name
345
336
drop table t2, t3;
349
340
show create table t3;
350
341
Table   Create Table
351
342
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
 
343
  `id` int NOT NULL,
 
344
  `name` varchar(20) DEFAULT NULL
 
345
) ENGINE=DEFAULT
355
346
create table t2 like t3;
356
347
show create table t2;
357
348
Table   Create Table
358
349
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
 
350
  `id` int NOT NULL,
 
351
  `name` varchar(20) DEFAULT NULL
 
352
) ENGINE=DEFAULT
362
353
select * from t2;
363
354
id      name
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;
 
365
drop table t3;
375
366
drop database mysqltest;
376
 
SET SESSION storage_engine="MEMORY";
 
367
SET SESSION storage_engine="heap";
377
368
SELECT @@storage_engine;
378
369
@@storage_engine
379
370
MEMORY
381
372
show create table t1;
382
373
Table   Create Table
383
374
t1      CREATE TEMPORARY TABLE `t1` (
384
 
  `a` INT NOT NULL
385
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
375
  `a` int NOT NULL
 
376
) ENGINE=MEMORY
386
377
drop table t1;
387
378
SET SESSION storage_engine="gemini";
388
379
ERROR 42000: Unknown table engine 'gemini'
393
384
show create table t1;
394
385
Table   Create Table
395
386
t1      CREATE TEMPORARY TABLE `t1` (
396
 
  `a` INT NOT NULL
397
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
387
  `a` int NOT NULL
 
388
) ENGINE=MEMORY
398
389
SET SESSION storage_engine=default;
399
390
drop table t1;
400
391
create table t1(a int,b int,c int,d date,e char,f datetime,h blob);
427
418
ifnull(h,cast('yet another binary data' as binary))   as h
428
419
from t1;
429
420
explain t2;
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     
 
421
Field   Type    Null    Key     Default Extra
 
422
a       int     YES             NULL    
 
423
b       bigint  NO              NULL    
 
424
c       bigint  NO              NULL    
 
425
d       date    YES             NULL    
 
426
e       varchar(1)      YES             NULL    
 
427
f       datetime        YES             NULL    
 
428
h       blob    YES             NULL    
438
429
select * from t2;
439
430
a       b       c       d       e       f       h
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;
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
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
 
451
) ENGINE=DEFAULT
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);
480
455
describe t1;
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    
 
459
intg    int     YES             10      
 
460
rel     double  YES             3.14    
486
461
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
487
462
describe t2;
488
 
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     
 
463
Field   Type    Null    Key     Default Extra
 
464
str     varchar(10)     YES             NULL    
 
465
strnull varchar(10)     YES             NULL    
 
466
intg    int     YES             NULL    
 
467
rel     double  YES             NULL    
493
468
drop table t1, t2;
494
469
create table t1(name varchar(10), age int default -1);
495
470
describe t1;
496
 
Field   Type    Null    Default Default_is_NULL On_Update
497
 
name    VARCHAR YES             YES     
498
 
age     INTEGER YES     -1      NO      
 
471
Field   Type    Null    Key     Default Extra
 
472
name    varchar(10)     YES             NULL    
 
473
age     int     YES             -1      
499
474
create table t2(name varchar(10), age int default - 1);
500
475
describe t2;
501
 
Field   Type    Null    Default Default_is_NULL On_Update
502
 
name    VARCHAR YES             YES     
503
 
age     INTEGER YES     -1      NO      
 
476
Field   Type    Null    Key     Default Extra
 
477
name    varchar(10)     YES             NULL    
 
478
age     int     YES             -1      
504
479
drop table t1, t2;
505
480
create table t1(cenum enum('a'));
506
481
create table t2(cenum enum('a','a'));
540
515
create table t1(test.column.name int);
541
516
ERROR 42000: Incorrect table name 'column'
542
517
create table t1(xyz.t1.name int);
543
 
ERROR 42000: Incorrect schema name 'xyz'
 
518
ERROR 42000: Incorrect database name 'xyz'
544
519
create table t1(t1.name int);
545
520
create table t2(test.t2.name int);
546
521
drop table t1,t2;
547
522
CREATE TABLE t1 (f1 VARCHAR(255));
548
523
CREATE TABLE t2 AS SELECT LEFT(f1,171) AS f2 FROM t1 UNION SELECT LEFT(f1,171) AS f2 FROM t1;
549
524
DESC t2;
550
 
Field   Type    Null    Default Default_is_NULL On_Update
551
 
f2      VARCHAR YES             YES     
 
525
Field   Type    Null    Key     Default Extra
 
526
f2      varchar(171)    YES             NULL    
552
527
DROP TABLE t1,t2;
553
528
CREATE TABLE t12913 (f1 ENUM ('a','b')) AS SELECT 'a' AS f1;
554
529
SELECT * FROM t12913;
559
534
use mysqltest;
560
535
drop database mysqltest;
561
536
create table test.t1 like x;
562
 
ERROR 3D000: No schema selected
 
537
ERROR 3D000: No database selected
563
538
drop table if exists test.t1;
564
539
create database mysqltest;
565
540
create database if not exists mysqltest;
566
541
Warnings:
567
 
Note    1007    Can't create schema 'mysqltest'; schema exists
 
542
Note    1007    Can't create database 'mysqltest'; database exists
568
543
show create database mysqltest;
569
544
Database        Create Database
570
 
mysqltest       CREATE DATABASE `mysqltest` COLLATE = utf8_general_ci
 
545
mysqltest       CREATE DATABASE `mysqltest`
571
546
drop database mysqltest;
572
547
use test;
573
548
create table t1 (a int);
582
557
show create table t1;
583
558
Table   Create Table
584
559
t1      CREATE TABLE `t1` (
585
 
  `a` VARCHAR(112) COLLATE utf8_bin NOT NULL,
 
560
  `a` varchar(112) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
586
561
  PRIMARY KEY (`a`)
587
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
562
) ENGINE=DEFAULT
588
563
drop table t1;
589
564
CREATE TABLE t2 (
590
565
a int default NULL
597
572
show create table t1;
598
573
Table   Create Table
599
574
t1      CREATE TABLE `t1` (
600
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
601
 
  `b` INT NOT NULL,
 
575
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
 
576
  `b` int NOT NULL,
602
577
  PRIMARY KEY (`a`)
603
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
578
) ENGINE=DEFAULT
604
579
drop table t1;
605
580
create table t1 ( 
606
581
a varchar(12) collate utf8_bin not null, 
614
589
show create table t1;
615
590
Table   Create Table
616
591
t1      CREATE TABLE `t1` (
617
 
  `b` INT DEFAULT NULL,
618
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
619
 
  `c` INT NOT NULL,
 
592
  `b` int DEFAULT NULL,
 
593
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
 
594
  `c` int NOT NULL,
620
595
  PRIMARY KEY (`a`)
621
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
596
) ENGINE=DEFAULT
622
597
drop table t1;
623
598
create table t1 ( 
624
599
a varchar(12) collate utf8_bin not null,
627
602
show create table t1;
628
603
Table   Create Table
629
604
t1      CREATE TABLE `t1` (
630
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
631
 
  `b` INT NOT NULL,
 
605
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
 
606
  `b` int NOT NULL,
632
607
  PRIMARY KEY (`a`)
633
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
608
) ENGINE=DEFAULT
634
609
drop table t1;
635
610
create table t1 ( 
636
611
a varchar(12) collate utf8_bin,
639
614
show create table t1;
640
615
Table   Create Table
641
616
t1      CREATE TABLE `t1` (
642
 
  `a` VARCHAR(12) COLLATE utf8_bin NOT NULL,
643
 
  `b` INT NOT NULL,
 
617
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
 
618
  `b` int NOT NULL,
644
619
  PRIMARY KEY (`a`)
645
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
620
) ENGINE=DEFAULT
646
621
drop table t1, t2;
647
622
create table t1 ( 
648
623
a1 int not null,
675
650
show create table t2;
676
651
Table   Create Table
677
652
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
 
653
  `a` int DEFAULT '3',
 
654
  `b` int DEFAULT '3',
 
655
  `a1` int DEFAULT NULL,
 
656
  `a2` int DEFAULT NULL
 
657
) ENGINE=DEFAULT
683
658
drop table t1, t2;
684
659
create table t1 select * from t2;
685
 
ERROR 42S02: Unknown table 'test.t2'
 
660
ERROR 42S02: Table 'test.t2' doesn't exist
686
661
create table t1 select * from t1;
687
662
ERROR HY000: You can't specify target table 't1' for update in FROM clause
688
663
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
710
685
1
711
686
drop temporary table t1;
712
687
select * from t1;
713
 
ERROR 42S02: Unknown table 'test.t1'
 
688
ERROR 42S02: Table 'test.t1' doesn't exist
714
689
drop table t1;
715
690
ERROR 42S02: Unknown table 't1'
716
691
create table t1 (upgrade int);
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
 
908
) ENGINE=DEFAULT
934
909
flush tables;
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
 
993
) ENGINE=DEFAULT
1019
994
drop table t1;
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
 
1209
) ENGINE=DEFAULT
1235
1210
flush tables;
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
 
1294
) ENGINE=DEFAULT
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);
1334
1309
show create table t1;
1335
1310
Table   Create Table
1336
1311
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
 
1312
  `c1` int DEFAULT NULL,
 
1313
  `c2` int DEFAULT NULL,
 
1314
  `c3` int DEFAULT NULL,
 
1315
  `c4` int DEFAULT NULL,
 
1316
  `c5` int DEFAULT NULL,
 
1317
  `c6` int DEFAULT NULL,
 
1318
  `c7` int DEFAULT NULL,
 
1319
  `c8` int DEFAULT NULL,
 
1320
  `c9` int DEFAULT NULL,
 
1321
  `c10` int DEFAULT NULL,
 
1322
  `c11` int DEFAULT NULL,
 
1323
  `c12` int DEFAULT NULL,
 
1324
  `c13` int DEFAULT NULL,
 
1325
  `c14` int DEFAULT NULL,
 
1326
  `c15` int DEFAULT NULL,
 
1327
  `c16` int DEFAULT NULL,
 
1328
  `c17` int DEFAULT NULL
 
1329
) ENGINE=DEFAULT
1355
1330
drop table t1;
1356
1331
 
1357
1332
Bug #26104 Bug on foreign key class constructor
1387
1362
CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE);
1388
1363
DROP TABLE t1;
1389
1364
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
 
1365
SHOW INDEX FROM t1;
 
1366
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1367
t1      1       c1      1       c1      NULL    0       NULL    NULL    YES     HASH            
1390
1368
DROP TABLE t1;
1391
1369
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
 
1370
SHOW INDEX FROM t1;
 
1371
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1372
t1      1       c1      1       c1      A       NULL    NULL    NULL    YES     BTREE           
1392
1373
DROP TABLE t1;
1393
1374
End of 5.0 tests
1394
1375
CREATE TABLE t1 (a int, b int);
1415
1396
a       b
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();
1428
1409
database()
1429
1410
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
1430
1411
use test;
1431
 
select SCHEMA_NAME from data_dictionary.schemas
 
1412
select SCHEMA_NAME from information_schema.schemata
1432
1413
where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
1433
1414
SCHEMA_NAME
1434
1415
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
1440
1421
);
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';
1445
1426
TABLE_NAME
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';
1449
1430
COLUMN_NAME
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';
1453
1434
INDEX_NAME
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
 
1441
) ENGINE=DEFAULT
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,
 
1454
  `INFO` text
 
1455
) ENGINE=MyISAM
1478
1456
drop table t1;
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,
 
1468
  `INFO` text
 
1469
) ENGINE=MyISAM
1495
1470
drop table t1;
1496
1471
 
1497
1472
# --
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))
1512
 
COLLATE=utf8_bin;
 
1487
COLLATE utf8_bin;
1513
1488
 
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
 
1498
) ENGINE=DEFAULT
1524
1499
 
1525
1500
CREATE TABLE t2 AS SELECT * FROM t1;
1526
1501
 
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
 
1511
) ENGINE=DEFAULT
1537
1512
 
1538
1513
DROP TABLE t2;
1539
1514