~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/create.result

  • Committer: Jay Pipes
  • Date: 2009-02-04 15:44:25 UTC
  • mfrom: (829 drizzle)
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090204154425-th8xfk2ujz2y8xwg
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
44
  `a` int
 
45
) ENGINE=InnoDB
46
46
create table t1 like `a/a`;
47
47
drop table `a/a`;
48
48
drop table `t1`;
113
113
Field   Type    Null    Key     Default Extra
114
114
x       varchar(50)     YES             NULL    
115
115
drop table t2;
116
 
create table t2 select now() as a , curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
 
116
create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
117
117
describe t2;
118
118
Field   Type    Null    Key     Default Extra
119
119
a       datetime        YES             NULL    
 
120
b       time    YES             NULL    
120
121
c       date    NO              NULL    
121
122
d       int     NO              NULL    
122
123
e       decimal(3,1)    NO              NULL    
123
124
f       bigint  NO              NULL    
124
125
drop table t2;
125
 
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("2001-12-29  20:45:11" AS DATETIME) as dt;
 
126
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29  20:45:11" AS DATETIME) as dt;
126
127
describe t2;
127
128
Field   Type    Null    Key     Default Extra
128
129
d       date    YES             NULL    
 
130
t       time    YES             NULL    
129
131
dt      datetime        YES             NULL    
130
132
drop table t1,t2;
131
133
create table t1 (a int);
167
169
Table   Create Table
168
170
t1      CREATE TABLE `t1` (
169
171
  `a` int NOT NULL,
170
 
  `b` int DEFAULT NULL,
 
172
  `b` int,
171
173
  PRIMARY KEY (`a`),
172
174
  KEY `b` (`b`),
173
175
  KEY `b_2` (`b`),
200
202
  KEY `b_29` (`b`),
201
203
  KEY `b_30` (`b`),
202
204
  KEY `b_31` (`b`)
203
 
) ENGINE=DEFAULT
 
205
) ENGINE=InnoDB
204
206
drop table t1;
205
207
create table t1 select if(1,'1','0'), month("2002-08-02");
206
208
drop table t1;
246
248
drop table t1;
247
249
create table t1 select 1,2,3;
248
250
create table if not exists t1 select 1,2;
249
 
ERROR HY000: Field '1' doesn't have a default value
250
251
create table if not exists t1 select 1,2,3,4;
251
 
ERROR 21S01: Column count doesn't match value count at row 1
252
252
create table if not exists t1 select 1;
253
 
ERROR HY000: Field '1' doesn't have a default value
254
253
select * from t1;
255
254
1       2       3
256
255
1       2       3
306
305
Table   Create Table
307
306
t3      CREATE TABLE `t3` (
308
307
  `id` int NOT NULL,
309
 
  `name` varchar(20) DEFAULT NULL
310
 
) ENGINE=DEFAULT
 
308
  `name` varchar(20)
 
309
) ENGINE=InnoDB
311
310
select * from t3;
312
311
id      name
313
312
create table if not exists t3 like t1;
321
320
Table   Create Table
322
321
t3      CREATE TEMPORARY TABLE `t3` (
323
322
  `id` int NOT NULL
324
 
) ENGINE=DEFAULT
 
323
) ENGINE=InnoDB
325
324
select * from t3;
326
325
id
327
326
drop table t3;
329
328
Table   Create Table
330
329
t3      CREATE TABLE `t3` (
331
330
  `id` int NOT NULL,
332
 
  `name` varchar(20) DEFAULT NULL
333
 
) ENGINE=DEFAULT
 
331
  `name` varchar(20)
 
332
) ENGINE=InnoDB
334
333
select * from t3;
335
334
id      name
336
335
drop table t2, t3;
341
340
Table   Create Table
342
341
t3      CREATE TEMPORARY TABLE `t3` (
343
342
  `id` int NOT NULL,
344
 
  `name` varchar(20) DEFAULT NULL
345
 
) ENGINE=DEFAULT
 
343
  `name` varchar(20)
 
344
) ENGINE=InnoDB
346
345
create table t2 like t3;
347
346
show create table t2;
348
347
Table   Create Table
349
348
t2      CREATE TABLE `t2` (
350
349
  `id` int NOT NULL,
351
 
  `name` varchar(20) DEFAULT NULL
352
 
) ENGINE=DEFAULT
 
350
  `name` varchar(20)
 
351
) ENGINE=InnoDB
353
352
select * from t2;
354
353
id      name
355
354
create table t3 like t1;
388
387
) ENGINE=MEMORY
389
388
SET SESSION storage_engine=default;
390
389
drop table t1;
391
 
create table t1(a int,b int,c int,d date,e char,f datetime,h blob);
 
390
create table t1(a int,b int,c int,d date,e char,f datetime,g time,h blob);
392
391
insert into t1(a)values(1);
393
 
insert into t1(a,b,c,d,e,f,h)
394
 
values(2,-2,2,'1825-12-14','a','2003-01-01 03:02:01','binary data');
 
392
insert into t1(a,b,c,d,e,f,g,h)
 
393
values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data');
395
394
select * from t1;
396
 
a       b       c       d       e       f       h
397
 
1       NULL    NULL    NULL    NULL    NULL    NULL
398
 
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
 
395
a       b       c       d       e       f       g       h
 
396
1       NULL    NULL    NULL    NULL    NULL    NULL    NULL
 
397
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     04:03:02        binary data
399
398
select a, 
400
399
ifnull(b,-7) as b, 
401
400
ifnull(c,7) as c, 
402
401
ifnull(d,cast('2000-01-01' as date)) as d, 
403
402
ifnull(e,cast('b' as char)) as e,
404
403
ifnull(f,cast('2000-01-01' as datetime)) as f, 
405
 
ifnull(h,cast('yet another binary data' as binary)) as h
 
404
ifnull(g,cast('5:4:3' as time)) as g,
 
405
ifnull(h,cast('yet another binary data' as binary)) as h,
 
406
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd 
406
407
from t1;
407
 
a       b       c       d       e       f       h
408
 
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     yet another binary data
409
 
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
 
408
a       b       c       d       e       f       g       h       dd
 
409
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     05:04:03        yet another binary data 02:00:00
 
410
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     04:03:02        binary data     02:00:00
410
411
create table t2
411
412
select
412
413
a, 
415
416
ifnull(d,cast('2000-01-01'              as date))     as d,
416
417
ifnull(e,cast('b'                       as char))     as e,
417
418
ifnull(f,cast('2000-01-01'              as datetime)) as f,
418
 
ifnull(h,cast('yet another binary data' as binary))   as h
 
419
ifnull(g,cast('5:4:3'                   as time))     as g,
 
420
ifnull(h,cast('yet another binary data' as binary))   as h,
 
421
addtime(cast('1:0:0' as time),cast('1:0:0' as time))  as dd
419
422
from t1;
420
423
explain t2;
421
424
Field   Type    Null    Key     Default Extra
425
428
d       date    YES             NULL    
426
429
e       varchar(1)      YES             NULL    
427
430
f       datetime        YES             NULL    
 
431
g       time    YES             NULL    
428
432
h       blob    YES             NULL    
 
433
dd      time    YES             NULL    
429
434
select * from t2;
430
 
a       b       c       d       e       f       h
431
 
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     yet another binary data
432
 
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
 
435
a       b       c       d       e       f       g       h       dd
 
436
1       -7      7       2000-01-01      b       2000-01-01 00:00:00     05:04:03        yet another binary data 02:00:00
 
437
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     04:03:02        binary data     02:00:00
433
438
drop table t1, t2;
434
439
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));
435
440
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;
436
441
show create table t2;
437
442
Table   Create Table
438
443
t2      CREATE TABLE `t2` (
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
 
444
  `ifnull(a,a)` int,
 
445
  `ifnull(b,b)` int,
 
446
  `ifnull(d,d)` int,
 
447
  `ifnull(e,e)` bigint,
 
448
  `ifnull(f,f)` double(3,2),
 
449
  `ifnull(g,g)` double(4,3),
 
450
  `ifnull(h,h)` decimal(5,4),
 
451
  `ifnull(j,j)` date,
 
452
  `ifnull(k,k)` timestamp NOT NULL,
 
453
  `ifnull(l,l)` datetime,
 
454
  `ifnull(m,m)` varchar(1),
 
455
  `ifnull(o,o)` varchar(10)
 
456
) ENGINE=InnoDB
452
457
drop table t1,t2;
453
458
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
454
459
insert into t1 values ('','',0,0.0);
455
460
describe t1;
456
461
Field   Type    Null    Key     Default Extra
457
 
str     varchar(10)     YES             def     
 
462
str     varchar(10)     YES             NULL    
458
463
strnull varchar(10)     YES             NULL    
459
 
intg    int     YES             10      
460
 
rel     double  YES             3.14    
 
464
intg    int     YES             NULL    
 
465
rel     double  YES             NULL    
461
466
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
462
467
describe t2;
463
468
Field   Type    Null    Key     Default Extra
470
475
describe t1;
471
476
Field   Type    Null    Key     Default Extra
472
477
name    varchar(10)     YES             NULL    
473
 
age     int     YES             -1      
 
478
age     int     YES             NULL    
474
479
create table t2(name varchar(10), age int default - 1);
475
480
describe t2;
476
481
Field   Type    Null    Key     Default Extra
477
482
name    varchar(10)     YES             NULL    
478
 
age     int     YES             -1      
 
483
age     int     YES             NULL    
479
484
drop table t1, t2;
480
485
create table t1(cenum enum('a'));
481
486
create table t2(cenum enum('a','a'));
506
511
drop table t1, t2, t3;
507
512
create table t1 (a int);
508
513
create table t1 select * from t1;
509
 
ERROR HY000: You can't specify target table 't1' for update in FROM clause
510
514
flush tables with read lock;
511
515
unlock tables;
512
516
drop table t1;
559
563
t1      CREATE TABLE `t1` (
560
564
  `a` varchar(112) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
561
565
  PRIMARY KEY (`a`)
562
 
) ENGINE=DEFAULT
 
566
) ENGINE=InnoDB
563
567
drop table t1;
564
568
CREATE TABLE t2 (
565
569
a int default NULL
575
579
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
576
580
  `b` int NOT NULL,
577
581
  PRIMARY KEY (`a`)
578
 
) ENGINE=DEFAULT
 
582
) ENGINE=InnoDB
579
583
drop table t1;
580
584
create table t1 ( 
581
585
a varchar(12) collate utf8_bin not null, 
589
593
show create table t1;
590
594
Table   Create Table
591
595
t1      CREATE TABLE `t1` (
592
 
  `b` int DEFAULT NULL,
 
596
  `b` int,
593
597
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
594
598
  `c` int NOT NULL,
595
599
  PRIMARY KEY (`a`)
596
 
) ENGINE=DEFAULT
 
600
) ENGINE=InnoDB
597
601
drop table t1;
598
602
create table t1 ( 
599
603
a varchar(12) collate utf8_bin not null,
605
609
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
606
610
  `b` int NOT NULL,
607
611
  PRIMARY KEY (`a`)
608
 
) ENGINE=DEFAULT
 
612
) ENGINE=InnoDB
609
613
drop table t1;
610
614
create table t1 ( 
611
615
a varchar(12) collate utf8_bin,
617
621
  `a` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
618
622
  `b` int NOT NULL,
619
623
  PRIMARY KEY (`a`)
620
 
) ENGINE=DEFAULT
 
624
) ENGINE=InnoDB
621
625
drop table t1, t2;
622
626
create table t1 ( 
623
627
a1 int not null,
650
654
show create table t2;
651
655
Table   Create Table
652
656
t2      CREATE TABLE `t2` (
653
 
  `a` int DEFAULT '3',
654
 
  `b` int DEFAULT '3',
655
 
  `a1` int DEFAULT NULL,
656
 
  `a2` int DEFAULT NULL
657
 
) ENGINE=DEFAULT
 
657
  `a` int,
 
658
  `b` int,
 
659
  `a1` int,
 
660
  `a2` int
 
661
) ENGINE=InnoDB
658
662
drop table t1, t2;
659
663
create table t1 (i int) engine=myisam max_rows=100000000000;
660
664
show create table t1;
661
665
Table   Create Table
662
666
t1      CREATE TABLE `t1` (
663
 
  `i` int DEFAULT NULL
664
 
) ENGINE=MyISAM MAX_ROWS=100000000000
 
667
  `i` int
 
668
) ENGINE=MyISAM MAX_ROWS=4294967295
665
669
alter table t1 max_rows=100;
666
670
show create table t1;
667
671
Table   Create Table
668
672
t1      CREATE TABLE `t1` (
669
 
  `i` int DEFAULT NULL
 
673
  `i` int
670
674
) ENGINE=MyISAM MAX_ROWS=100
671
675
alter table t1 max_rows=100000000000;
672
676
show create table t1;
673
677
Table   Create Table
674
678
t1      CREATE TABLE `t1` (
675
 
  `i` int DEFAULT NULL
676
 
) ENGINE=MyISAM MAX_ROWS=100000000000
 
679
  `i` int
 
680
) ENGINE=MyISAM MAX_ROWS=4294967295
677
681
drop table t1;
678
682
create table t1 select * from t2;
679
683
ERROR 42S02: Table 'test.t2' doesn't exist
687
691
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
688
692
create table t1 (i int);
689
693
create table if not exists t1 select 1 as i;
690
 
Warnings:
691
 
Note    1050    Table 't1' already exists
692
694
select * from t1;
693
695
i
694
 
1
695
696
drop table t1;
696
697
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
697
698
ERROR HY000: Illegal mix of collations (utf8_swedish_ci,EXPLICIT) and (utf8_bin,EXPLICIT) for operation 'coalesce'
890
891
show create table t1;
891
892
Table   Create Table
892
893
t1      CREATE TABLE `t1` (
893
 
  `c1` int DEFAULT NULL,
894
 
  `c2` int DEFAULT NULL,
895
 
  `c3` int DEFAULT NULL,
896
 
  `c4` int DEFAULT NULL,
897
 
  `c5` int DEFAULT NULL,
898
 
  `c6` int DEFAULT NULL,
899
 
  `c7` int DEFAULT NULL,
900
 
  `c8` int DEFAULT NULL,
901
 
  `c9` int DEFAULT NULL,
902
 
  `c10` int DEFAULT NULL,
903
 
  `c11` int DEFAULT NULL,
904
 
  `c12` int DEFAULT NULL,
905
 
  `c13` int DEFAULT NULL,
906
 
  `c14` int DEFAULT NULL,
907
 
  `c15` int DEFAULT NULL,
908
 
  `c16` int DEFAULT NULL,
 
894
  `c1` int,
 
895
  `c2` int,
 
896
  `c3` int,
 
897
  `c4` int,
 
898
  `c5` int,
 
899
  `c6` int,
 
900
  `c7` int,
 
901
  `c8` int,
 
902
  `c9` int,
 
903
  `c10` int,
 
904
  `c11` int,
 
905
  `c12` int,
 
906
  `c13` int,
 
907
  `c14` int,
 
908
  `c15` int,
 
909
  `c16` int,
909
910
  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`),
910
911
  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`),
911
912
  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`),
970
971
  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`),
971
972
  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`),
972
973
  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`)
973
 
) ENGINE=DEFAULT
 
974
) ENGINE=InnoDB
974
975
flush tables;
975
976
show create table t1;
976
977
Table   Create Table
977
978
t1      CREATE TABLE `t1` (
978
 
  `c1` int DEFAULT NULL,
979
 
  `c2` int DEFAULT NULL,
980
 
  `c3` int DEFAULT NULL,
981
 
  `c4` int DEFAULT NULL,
982
 
  `c5` int DEFAULT NULL,
983
 
  `c6` int DEFAULT NULL,
984
 
  `c7` int DEFAULT NULL,
985
 
  `c8` int DEFAULT NULL,
986
 
  `c9` int DEFAULT NULL,
987
 
  `c10` int DEFAULT NULL,
988
 
  `c11` int DEFAULT NULL,
989
 
  `c12` int DEFAULT NULL,
990
 
  `c13` int DEFAULT NULL,
991
 
  `c14` int DEFAULT NULL,
992
 
  `c15` int DEFAULT NULL,
993
 
  `c16` int DEFAULT NULL,
 
979
  `c1` int,
 
980
  `c2` int,
 
981
  `c3` int,
 
982
  `c4` int,
 
983
  `c5` int,
 
984
  `c6` int,
 
985
  `c7` int,
 
986
  `c8` int,
 
987
  `c9` int,
 
988
  `c10` int,
 
989
  `c11` int,
 
990
  `c12` int,
 
991
  `c13` int,
 
992
  `c14` int,
 
993
  `c15` int,
 
994
  `c16` int,
994
995
  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`),
995
996
  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`),
996
997
  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`),
1055
1056
  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`),
1056
1057
  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`),
1057
1058
  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`)
1058
 
) ENGINE=DEFAULT
 
1059
) ENGINE=InnoDB
1059
1060
drop table t1;
1060
1061
create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, 
1061
1062
c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
1191
1192
show create table t1;
1192
1193
Table   Create Table
1193
1194
t1      CREATE TABLE `t1` (
1194
 
  `c1` int DEFAULT NULL,
1195
 
  `c2` int DEFAULT NULL,
1196
 
  `c3` int DEFAULT NULL,
1197
 
  `c4` int DEFAULT NULL,
1198
 
  `c5` int DEFAULT NULL,
1199
 
  `c6` int DEFAULT NULL,
1200
 
  `c7` int DEFAULT NULL,
1201
 
  `c8` int DEFAULT NULL,
1202
 
  `c9` int DEFAULT NULL,
1203
 
  `c10` int DEFAULT NULL,
1204
 
  `c11` int DEFAULT NULL,
1205
 
  `c12` int DEFAULT NULL,
1206
 
  `c13` int DEFAULT NULL,
1207
 
  `c14` int DEFAULT NULL,
1208
 
  `c15` int DEFAULT NULL,
1209
 
  `c16` int DEFAULT NULL,
 
1195
  `c1` int,
 
1196
  `c2` int,
 
1197
  `c3` int,
 
1198
  `c4` int,
 
1199
  `c5` int,
 
1200
  `c6` int,
 
1201
  `c7` int,
 
1202
  `c8` int,
 
1203
  `c9` int,
 
1204
  `c10` int,
 
1205
  `c11` int,
 
1206
  `c12` int,
 
1207
  `c13` int,
 
1208
  `c14` int,
 
1209
  `c15` int,
 
1210
  `c16` int,
1210
1211
  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`),
1211
1212
  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`),
1212
1213
  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`),
1271
1272
  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`),
1272
1273
  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`),
1273
1274
  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`)
1274
 
) ENGINE=DEFAULT
 
1275
) ENGINE=InnoDB
1275
1276
flush tables;
1276
1277
show create table t1;
1277
1278
Table   Create Table
1278
1279
t1      CREATE TABLE `t1` (
1279
 
  `c1` int DEFAULT NULL,
1280
 
  `c2` int DEFAULT NULL,
1281
 
  `c3` int DEFAULT NULL,
1282
 
  `c4` int DEFAULT NULL,
1283
 
  `c5` int DEFAULT NULL,
1284
 
  `c6` int DEFAULT NULL,
1285
 
  `c7` int DEFAULT NULL,
1286
 
  `c8` int DEFAULT NULL,
1287
 
  `c9` int DEFAULT NULL,
1288
 
  `c10` int DEFAULT NULL,
1289
 
  `c11` int DEFAULT NULL,
1290
 
  `c12` int DEFAULT NULL,
1291
 
  `c13` int DEFAULT NULL,
1292
 
  `c14` int DEFAULT NULL,
1293
 
  `c15` int DEFAULT NULL,
1294
 
  `c16` int DEFAULT NULL,
 
1280
  `c1` int,
 
1281
  `c2` int,
 
1282
  `c3` int,
 
1283
  `c4` int,
 
1284
  `c5` int,
 
1285
  `c6` int,
 
1286
  `c7` int,
 
1287
  `c8` int,
 
1288
  `c9` int,
 
1289
  `c10` int,
 
1290
  `c11` int,
 
1291
  `c12` int,
 
1292
  `c13` int,
 
1293
  `c14` int,
 
1294
  `c15` int,
 
1295
  `c16` int,
1295
1296
  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`),
1296
1297
  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`),
1297
1298
  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`),
1356
1357
  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`),
1357
1358
  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`),
1358
1359
  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`)
1359
 
) ENGINE=DEFAULT
 
1360
) ENGINE=InnoDB
1360
1361
alter table t1 add key 
1361
1362
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1362
1363
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1374
1375
show create table t1;
1375
1376
Table   Create Table
1376
1377
t1      CREATE TABLE `t1` (
1377
 
  `c1` int DEFAULT NULL,
1378
 
  `c2` int DEFAULT NULL,
1379
 
  `c3` int DEFAULT NULL,
1380
 
  `c4` int DEFAULT NULL,
1381
 
  `c5` int DEFAULT NULL,
1382
 
  `c6` int DEFAULT NULL,
1383
 
  `c7` int DEFAULT NULL,
1384
 
  `c8` int DEFAULT NULL,
1385
 
  `c9` int DEFAULT NULL,
1386
 
  `c10` int DEFAULT NULL,
1387
 
  `c11` int DEFAULT NULL,
1388
 
  `c12` int DEFAULT NULL,
1389
 
  `c13` int DEFAULT NULL,
1390
 
  `c14` int DEFAULT NULL,
1391
 
  `c15` int DEFAULT NULL,
1392
 
  `c16` int DEFAULT NULL,
1393
 
  `c17` int DEFAULT NULL
1394
 
) ENGINE=DEFAULT
 
1378
  `c1` int,
 
1379
  `c2` int,
 
1380
  `c3` int,
 
1381
  `c4` int,
 
1382
  `c5` int,
 
1383
  `c6` int,
 
1384
  `c7` int,
 
1385
  `c8` int,
 
1386
  `c9` int,
 
1387
  `c10` int,
 
1388
  `c11` int,
 
1389
  `c12` int,
 
1390
  `c13` int,
 
1391
  `c14` int,
 
1392
  `c15` int,
 
1393
  `c16` int,
 
1394
  `c17` int
 
1395
) ENGINE=InnoDB
1395
1396
drop table t1;
1396
1397
 
1397
1398
Bug #26104 Bug on foreign key class constructor
1501
1502
show create table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1502
1503
Table   Create Table
1503
1504
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48       CREATE TABLE `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` (
1504
 
  `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` int DEFAULT NULL,
 
1505
  `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` int,
1505
1506
  KEY `имя_индекса_в_кодировке_утф8_длиной_больше_чем_48` (`имя_поля_в_кодировке_утф8_длиной_больше_чем_45`)
1506
 
) ENGINE=DEFAULT
 
1507
) ENGINE=InnoDB
1507
1508
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1508
1509
create table t1 like information_schema.processlist;
1509
1510
show create table t1;
1510
1511
Table   Create Table
1511
1512
t1      CREATE TABLE `t1` (
1512
 
  `ID` bigint NOT NULL DEFAULT '0',
1513
 
  `USER` varchar(16) NOT NULL DEFAULT '',
1514
 
  `HOST` varchar(64) NOT NULL DEFAULT '',
1515
 
  `DB` varchar(64) DEFAULT NULL,
1516
 
  `COMMAND` varchar(16) NOT NULL DEFAULT '',
1517
 
  `TIME` bigint NOT NULL DEFAULT '0',
1518
 
  `STATE` varchar(64) DEFAULT NULL,
 
1513
  `ID` bigint NOT NULL,
 
1514
  `USER` varchar(16) NOT NULL,
 
1515
  `HOST` varchar(64) NOT NULL,
 
1516
  `DB` varchar(64),
 
1517
  `COMMAND` varchar(16) NOT NULL,
 
1518
  `TIME` bigint NOT NULL,
 
1519
  `STATE` varchar(64),
1519
1520
  `INFO` text
1520
1521
) ENGINE=MyISAM
1521
1522
drop table t1;
1523
1524
show create table t1;
1524
1525
Table   Create Table
1525
1526
t1      CREATE TEMPORARY TABLE `t1` (
1526
 
  `ID` bigint NOT NULL DEFAULT '0',
1527
 
  `USER` varchar(16) NOT NULL DEFAULT '',
1528
 
  `HOST` varchar(64) NOT NULL DEFAULT '',
1529
 
  `DB` varchar(64) DEFAULT NULL,
1530
 
  `COMMAND` varchar(16) NOT NULL DEFAULT '',
1531
 
  `TIME` bigint NOT NULL DEFAULT '0',
1532
 
  `STATE` varchar(64) DEFAULT NULL,
 
1527
  `ID` bigint NOT NULL,
 
1528
  `USER` varchar(16) NOT NULL,
 
1529
  `HOST` varchar(64) NOT NULL,
 
1530
  `DB` varchar(64),
 
1531
  `COMMAND` varchar(16) NOT NULL,
 
1532
  `TIME` bigint NOT NULL,
 
1533
  `STATE` varchar(64),
1533
1534
  `INFO` text
1534
1535
) ENGINE=MyISAM
1535
1536
drop table t1;
1554
1555
SHOW CREATE TABLE t1;
1555
1556
Table   Create Table
1556
1557
t1      CREATE TABLE `t1` (
1557
 
  `c1` int DEFAULT '12' COMMENT 'column1',
1558
 
  `c2` int DEFAULT NULL COMMENT 'column2',
 
1558
  `c1` int COMMENT 'column1',
 
1559
  `c2` int COMMENT 'column2',
1559
1560
  `c3` int NOT NULL COMMENT 'column3',
1560
 
  `c4` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1561
 
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
1562
 
  `c6` varchar(255) COLLATE utf8_bin DEFAULT NULL
1563
 
) ENGINE=DEFAULT
 
1561
  `c4` varchar(255) COLLATE utf8_bin NOT NULL,
 
1562
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci,
 
1563
  `c6` varchar(255) COLLATE utf8_bin
 
1564
) ENGINE=InnoDB
1564
1565
 
1565
1566
CREATE TABLE t2 AS SELECT * FROM t1;
1566
1567
 
1567
1568
SHOW CREATE TABLE t2;
1568
1569
Table   Create Table
1569
1570
t2      CREATE TABLE `t2` (
1570
 
  `c1` int DEFAULT '12' COMMENT 'column1',
1571
 
  `c2` int DEFAULT NULL COMMENT 'column2',
 
1571
  `c1` int COMMENT 'column1',
 
1572
  `c2` int COMMENT 'column2',
1572
1573
  `c3` int NOT NULL COMMENT 'column3',
1573
 
  `c4` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT 'a',
1574
 
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
1575
 
  `c6` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL
1576
 
) ENGINE=DEFAULT
 
1574
  `c4` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
 
1575
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci,
 
1576
  `c6` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin
 
1577
) ENGINE=InnoDB
1577
1578
 
1578
1579
DROP TABLE t2;
1579
1580
 
1590
1591
CREATE TABLE t1(c1 TIMESTAMP, c2 TIMESTAMP);
1591
1592
 
1592
1593
 
1593
 
CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP NULL);
1594
 
drop table t2;
1595
 
CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP DEFAULT '1982-01-29');
 
1594
CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP DEFAULT 0);
1596
1595
drop table t2;
1597
1596
 
1598
1597
CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP);
1608
1607
 
1609
1608
CREATE TABLE t3(c1 DATETIME NOT NULL);
1610
1609
INSERT INTO t3 VALUES (0);
1611
 
ERROR HY000: Received an invalid datetime value '0'.
1612
1610
 
1613
1611
ALTER TABLE t3 ADD INDEX(c1);
1614
1612