~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/create.result

Reverted 1103

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 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 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 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 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
226
 
CREATE TEMPORARY TABLE t1 (a int not null);
 
216
CREATE TABLE t1 (a int not null);
227
217
show create table t1;
228
218
Table   Create Table
229
 
t1      CREATE TEMPORARY TABLE `t1` (
230
 
  `a` INT NOT NULL
231
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
219
t1      CREATE TABLE `t1` (
 
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'
235
225
SELECT @@storage_engine;
236
226
@@storage_engine
237
227
MEMORY
238
 
CREATE TEMPORARY TABLE t1 (a int not null);
 
228
CREATE TABLE t1 (a int not null);
239
229
show create table t1;
240
230
Table   Create Table
241
 
t1      CREATE TEMPORARY TABLE `t1` (
242
 
  `a` INT NOT NULL
243
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
231
t1      CREATE TABLE `t1` (
 
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
380
 
CREATE TEMPORARY TABLE t1 (a int not null);
 
371
CREATE TABLE t1 (a int not null);
381
372
show create table t1;
382
373
Table   Create Table
383
 
t1      CREATE TEMPORARY TABLE `t1` (
384
 
  `a` INT NOT NULL
385
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
374
t1      CREATE TABLE `t1` (
 
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'
389
380
SELECT @@storage_engine;
390
381
@@storage_engine
391
382
MEMORY
392
 
CREATE TEMPORARY TABLE t1 (a int not null);
 
383
CREATE TABLE t1 (a int not null);
393
384
show create table t1;
394
385
Table   Create Table
395
 
t1      CREATE TEMPORARY TABLE `t1` (
396
 
  `a` INT NOT NULL
397
 
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
386
t1      CREATE TABLE `t1` (
 
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;
 
659
create TEMPORARY table t1 (i int) engine=myisam max_rows=100000000000;
 
660
show create table t1;
 
661
Table   Create Table
 
662
t1      CREATE TEMPORARY TABLE `t1` (
 
663
  `i` int DEFAULT NULL
 
664
) ENGINE=MyISAM MAX_ROWS=100000000000
 
665
alter table t1 max_rows=100;
 
666
show create table t1;
 
667
Table   Create Table
 
668
t1      CREATE TEMPORARY TABLE `t1` (
 
669
  `i` int DEFAULT NULL
 
670
) ENGINE=MyISAM MAX_ROWS=100
 
671
alter table t1 max_rows=100000000000;
 
672
show create table t1;
 
673
Table   Create Table
 
674
t1      CREATE TEMPORARY TABLE `t1` (
 
675
  `i` int DEFAULT NULL
 
676
) ENGINE=MyISAM MAX_ROWS=100000000000
 
677
drop table t1;
684
678
create table t1 select * from t2;
685
 
ERROR 42S02: Unknown table 'test.t2'
 
679
ERROR 42S02: Table 'test.t2' doesn't exist
686
680
create table t1 select * from t1;
687
681
ERROR HY000: You can't specify target table 't1' for update in FROM clause
688
682
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
710
704
1
711
705
drop temporary table t1;
712
706
select * from t1;
713
 
ERROR 42S02: Unknown table 'test.t1'
 
707
ERROR 42S02: Table 'test.t1' doesn't exist
714
708
drop table t1;
715
709
ERROR 42S02: Unknown table 't1'
716
710
create table t1 (upgrade int);
850
844
show create table t1;
851
845
Table   Create Table
852
846
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,
 
847
  `c1` int DEFAULT NULL,
 
848
  `c2` int DEFAULT NULL,
 
849
  `c3` int DEFAULT NULL,
 
850
  `c4` int DEFAULT NULL,
 
851
  `c5` int DEFAULT NULL,
 
852
  `c6` int DEFAULT NULL,
 
853
  `c7` int DEFAULT NULL,
 
854
  `c8` int DEFAULT NULL,
 
855
  `c9` int DEFAULT NULL,
 
856
  `c10` int DEFAULT NULL,
 
857
  `c11` int DEFAULT NULL,
 
858
  `c12` int DEFAULT NULL,
 
859
  `c13` int DEFAULT NULL,
 
860
  `c14` int DEFAULT NULL,
 
861
  `c15` int DEFAULT NULL,
 
862
  `c16` int DEFAULT NULL,
869
863
  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
864
  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
865
  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
924
  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
925
  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
926
  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
 
927
) ENGINE=DEFAULT
934
928
flush tables;
935
929
show create table t1;
936
930
Table   Create Table
937
931
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,
 
932
  `c1` int DEFAULT NULL,
 
933
  `c2` int DEFAULT NULL,
 
934
  `c3` int DEFAULT NULL,
 
935
  `c4` int DEFAULT NULL,
 
936
  `c5` int DEFAULT NULL,
 
937
  `c6` int DEFAULT NULL,
 
938
  `c7` int DEFAULT NULL,
 
939
  `c8` int DEFAULT NULL,
 
940
  `c9` int DEFAULT NULL,
 
941
  `c10` int DEFAULT NULL,
 
942
  `c11` int DEFAULT NULL,
 
943
  `c12` int DEFAULT NULL,
 
944
  `c13` int DEFAULT NULL,
 
945
  `c14` int DEFAULT NULL,
 
946
  `c15` int DEFAULT NULL,
 
947
  `c16` int DEFAULT NULL,
954
948
  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
949
  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
950
  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
1009
  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
1010
  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
1011
  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
 
1012
) ENGINE=DEFAULT
1019
1013
drop table t1;
1020
1014
create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, 
1021
1015
c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
1151
1145
show create table t1;
1152
1146
Table   Create Table
1153
1147
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,
 
1148
  `c1` int DEFAULT NULL,
 
1149
  `c2` int DEFAULT NULL,
 
1150
  `c3` int DEFAULT NULL,
 
1151
  `c4` int DEFAULT NULL,
 
1152
  `c5` int DEFAULT NULL,
 
1153
  `c6` int DEFAULT NULL,
 
1154
  `c7` int DEFAULT NULL,
 
1155
  `c8` int DEFAULT NULL,
 
1156
  `c9` int DEFAULT NULL,
 
1157
  `c10` int DEFAULT NULL,
 
1158
  `c11` int DEFAULT NULL,
 
1159
  `c12` int DEFAULT NULL,
 
1160
  `c13` int DEFAULT NULL,
 
1161
  `c14` int DEFAULT NULL,
 
1162
  `c15` int DEFAULT NULL,
 
1163
  `c16` int DEFAULT NULL,
1170
1164
  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
1165
  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
1166
  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
1225
  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
1226
  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
1227
  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
 
1228
) ENGINE=DEFAULT
1235
1229
flush tables;
1236
1230
show create table t1;
1237
1231
Table   Create Table
1238
1232
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,
 
1233
  `c1` int DEFAULT NULL,
 
1234
  `c2` int DEFAULT NULL,
 
1235
  `c3` int DEFAULT NULL,
 
1236
  `c4` int DEFAULT NULL,
 
1237
  `c5` int DEFAULT NULL,
 
1238
  `c6` int DEFAULT NULL,
 
1239
  `c7` int DEFAULT NULL,
 
1240
  `c8` int DEFAULT NULL,
 
1241
  `c9` int DEFAULT NULL,
 
1242
  `c10` int DEFAULT NULL,
 
1243
  `c11` int DEFAULT NULL,
 
1244
  `c12` int DEFAULT NULL,
 
1245
  `c13` int DEFAULT NULL,
 
1246
  `c14` int DEFAULT NULL,
 
1247
  `c15` int DEFAULT NULL,
 
1248
  `c16` int DEFAULT NULL,
1255
1249
  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
1250
  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
1251
  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
1310
  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
1311
  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
1312
  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
 
1313
) ENGINE=DEFAULT
1320
1314
alter table t1 add key 
1321
1315
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1322
1316
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1334
1328
show create table t1;
1335
1329
Table   Create Table
1336
1330
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
 
1331
  `c1` int DEFAULT NULL,
 
1332
  `c2` int DEFAULT NULL,
 
1333
  `c3` int DEFAULT NULL,
 
1334
  `c4` int DEFAULT NULL,
 
1335
  `c5` int DEFAULT NULL,
 
1336
  `c6` int DEFAULT NULL,
 
1337
  `c7` int DEFAULT NULL,
 
1338
  `c8` int DEFAULT NULL,
 
1339
  `c9` int DEFAULT NULL,
 
1340
  `c10` int DEFAULT NULL,
 
1341
  `c11` int DEFAULT NULL,
 
1342
  `c12` int DEFAULT NULL,
 
1343
  `c13` int DEFAULT NULL,
 
1344
  `c14` int DEFAULT NULL,
 
1345
  `c15` int DEFAULT NULL,
 
1346
  `c16` int DEFAULT NULL,
 
1347
  `c17` int DEFAULT NULL
 
1348
) ENGINE=DEFAULT
1355
1349
drop table t1;
1356
1350
 
1357
1351
Bug #26104 Bug on foreign key class constructor
1386
1380
DROP TABLE t1;
1387
1381
CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE);
1388
1382
DROP TABLE t1;
1389
 
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
 
1383
CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
 
1384
SHOW INDEX FROM t1;
 
1385
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1386
t1      1       c1      1       c1      NULL    0       NULL    NULL    YES     HASH            
1390
1387
DROP TABLE t1;
1391
 
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
 
1388
CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
 
1389
SHOW INDEX FROM t1;
 
1390
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
1391
t1      1       c1      1       c1      A       NULL    NULL    NULL    YES     BTREE           
1392
1392
DROP TABLE t1;
1393
1393
End of 5.0 tests
1394
1394
CREATE TABLE t1 (a int, b int);
1415
1415
a       b
1416
1416
drop table t1,t2;
1417
1417
CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1418
 
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 
1418
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1419
1419
DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1420
 
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 
1420
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1421
1421
USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1422
 
ERROR 42000: Incorrect schema name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 
1422
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1423
1423
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1424
 
Database        Create Database
 
1424
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
1425
1425
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1426
1426
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1427
1427
select database();
1428
1428
database()
1429
1429
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
1430
1430
use test;
1431
 
select SCHEMA_NAME from data_dictionary.schemas
 
1431
select SCHEMA_NAME from information_schema.schemata
1432
1432
where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
1433
1433
SCHEMA_NAME
1434
1434
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
1440
1440
);
1441
1441
select * from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1442
1442
имя_поля_в_кодировке_утф8_длиной_больше_чем_45
1443
 
select TABLE_NAME from data_dictionary.tables where
 
1443
select TABLE_NAME from information_schema.tables where
1444
1444
table_schema='test';
1445
1445
TABLE_NAME
1446
1446
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48
1447
 
select COLUMN_NAME from data_dictionary.columns where
 
1447
select COLUMN_NAME from information_schema.columns where
1448
1448
table_schema='test';
1449
1449
COLUMN_NAME
1450
1450
имя_поля_в_кодировке_утф8_длиной_больше_чем_45
1451
 
select INDEX_NAME from data_dictionary.indexes where
 
1451
select INDEX_NAME from information_schema.statistics where
1452
1452
table_schema='test';
1453
1453
INDEX_NAME
1454
1454
имя_индекса_в_кодировке_утф8_длиной_больше_чем_48
1455
1455
show create table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1456
1456
Table   Create Table
1457
1457
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48       CREATE TABLE `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` (
1458
 
  `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` INT DEFAULT NULL,
 
1458
  `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` int DEFAULT NULL,
1459
1459
  KEY `имя_индекса_в_кодировке_утф8_длиной_больше_чем_48` (`имя_поля_в_кодировке_утф8_длиной_больше_чем_45`)
1460
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
1460
) ENGINE=DEFAULT
1461
1461
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;
 
1462
create table t1 like information_schema.processlist;
1465
1463
show create table t1;
1466
1464
Table   Create Table
1467
1465
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
 
1466
  `ID` bigint NOT NULL DEFAULT '0',
 
1467
  `USER` varchar(16) NOT NULL DEFAULT '',
 
1468
  `HOST` varchar(64) NOT NULL DEFAULT '',
 
1469
  `DB` varchar(64) DEFAULT NULL,
 
1470
  `COMMAND` varchar(16) NOT NULL DEFAULT '',
 
1471
  `TIME` bigint NOT NULL DEFAULT '0',
 
1472
  `STATE` varchar(64) DEFAULT NULL,
 
1473
  `INFO` text
 
1474
) ENGINE=MyISAM
1478
1475
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;
 
1476
create temporary table t1 like information_schema.processlist;
1482
1477
show create table t1;
1483
1478
Table   Create Table
1484
1479
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
 
1480
  `ID` bigint NOT NULL DEFAULT '0',
 
1481
  `USER` varchar(16) NOT NULL DEFAULT '',
 
1482
  `HOST` varchar(64) NOT NULL DEFAULT '',
 
1483
  `DB` varchar(64) DEFAULT NULL,
 
1484
  `COMMAND` varchar(16) NOT NULL DEFAULT '',
 
1485
  `TIME` bigint NOT NULL DEFAULT '0',
 
1486
  `STATE` varchar(64) DEFAULT NULL,
 
1487
  `INFO` text
 
1488
) ENGINE=MyISAM
1495
1489
drop table t1;
1496
1490
 
1497
1491
# --
1509
1503
c4 VARCHAR(255) NOT NULL DEFAULT 'a',
1510
1504
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
1511
1505
c6 VARCHAR(255))
1512
 
COLLATE=utf8_bin;
 
1506
COLLATE utf8_bin;
1513
1507
 
1514
1508
SHOW CREATE TABLE t1;
1515
1509
Table   Create Table
1516
1510
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
 
1511
  `c1` int DEFAULT '12' COMMENT 'column1',
 
1512
  `c2` int DEFAULT NULL COMMENT 'column2',
 
1513
  `c3` int NOT NULL COMMENT 'column3',
 
1514
  `c4` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
 
1515
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
 
1516
  `c6` varchar(255) COLLATE utf8_bin DEFAULT NULL
 
1517
) ENGINE=DEFAULT
1524
1518
 
1525
1519
CREATE TABLE t2 AS SELECT * FROM t1;
1526
1520
 
1527
1521
SHOW CREATE TABLE t2;
1528
1522
Table   Create Table
1529
1523
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
 
1524
  `c1` int DEFAULT '12' COMMENT 'column1',
 
1525
  `c2` int DEFAULT NULL COMMENT 'column2',
 
1526
  `c3` int NOT NULL COMMENT 'column3',
 
1527
  `c4` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT 'a',
 
1528
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
 
1529
  `c6` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL
 
1530
) ENGINE=DEFAULT
1537
1531
 
1538
1532
DROP TABLE t2;
1539
1533