349
349
show create table t3;
350
350
Table Create Table
351
351
t3 CREATE TEMPORARY TABLE `t3` (
353
`name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
354
) ENGINE=DEFAULT COLLATE = utf8_general_ci
353
`name` varchar(20) DEFAULT NULL
355
355
create table t2 like t3;
356
356
show create table t2;
357
357
Table Create Table
358
358
t2 CREATE TABLE `t2` (
360
`name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT NULL
361
) ENGINE=DEFAULT COLLATE = utf8_general_ci
360
`name` varchar(20) DEFAULT NULL
362
362
select * from t2;
364
364
create table t3 like t1;
365
ERROR 42S01: Table 'test.t3' already exists
365
ERROR 42S01: Table 't3' already exists
366
366
create table t3 like mysqltest.t3;
367
ERROR 42S01: Table 'test.t3' already exists
367
ERROR 42S01: Table 't3' already exists
368
368
create table non_existing_database.t1 like t1;
369
ERROR 42000: Unknown schema 'non_existing_database'
370
create table t4 like non_existing_table;
371
ERROR 42S02: Unknown table 'test.non_existing_table'
369
ERROR 42000: Unknown database 'non_existing_database'
370
create table t3 like non_existing_table;
371
ERROR 42S02: Table 'test.non_existing_table' doesn't exist
372
372
create temporary table t3 like t1;
373
ERROR 42S01: Table 'test.#t3' already exists
373
ERROR 42S01: Table 't3' already exists
374
374
drop table t1, t2, t3;
375
375
drop database mysqltest;
376
376
SET SESSION storage_engine="MEMORY";
430
430
Field Type Null Default Default_is_NULL On_Update
438
438
select * from t2;
440
440
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 yet another binary data
441
441
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 binary data
442
442
drop table t1, t2;
443
443
create table t1 (a int, b int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), o char(10));
444
SHOW CREATE TABLE t1;
446
t1 CREATE TABLE `t1` (
447
`a` INT DEFAULT NULL,
448
`b` INT DEFAULT NULL,
449
`d` INT DEFAULT NULL,
450
`e` BIGINT DEFAULT NULL,
451
`f` DOUBLE(3,2) DEFAULT NULL,
452
`g` DOUBLE(4,3) DEFAULT NULL,
453
`h` DECIMAL(5,4) DEFAULT NULL,
454
`j` DATE DEFAULT NULL,
455
`k` TIMESTAMP NULL DEFAULT NULL,
456
`l` DATETIME DEFAULT NULL,
457
`m` ENUM('a','b') DEFAULT NULL,
458
`o` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
459
) ENGINE=InnoDB COLLATE = utf8_general_ci
460
444
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
461
445
show create table t2;
462
446
Table Create Table
463
447
t2 CREATE TABLE `t2` (
464
`ifnull(a,a)` INT DEFAULT NULL,
465
`ifnull(b,b)` INT DEFAULT NULL,
466
`ifnull(d,d)` INT DEFAULT NULL,
467
`ifnull(e,e)` BIGINT DEFAULT NULL,
468
`ifnull(f,f)` DOUBLE(3,2) DEFAULT NULL,
469
`ifnull(g,g)` DOUBLE(4,3) DEFAULT NULL,
470
`ifnull(h,h)` DECIMAL(5,4) DEFAULT NULL,
471
`ifnull(j,j)` DATE DEFAULT NULL,
472
`ifnull(k,k)` TIMESTAMP NULL DEFAULT NULL,
473
`ifnull(l,l)` DATETIME DEFAULT NULL,
474
`ifnull(m,m)` VARCHAR(1) COLLATE utf8_general_ci DEFAULT NULL,
475
`ifnull(o,o)` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
476
) ENGINE=DEFAULT COLLATE = utf8_general_ci
448
`ifnull(a,a)` int DEFAULT NULL,
449
`ifnull(b,b)` int DEFAULT NULL,
450
`ifnull(d,d)` int DEFAULT NULL,
451
`ifnull(e,e)` bigint DEFAULT NULL,
452
`ifnull(f,f)` double(3,2) DEFAULT NULL,
453
`ifnull(g,g)` double(4,3) DEFAULT NULL,
454
`ifnull(h,h)` decimal(5,4) DEFAULT NULL,
455
`ifnull(j,j)` date DEFAULT NULL,
456
`ifnull(k,k)` timestamp NULL DEFAULT NULL,
457
`ifnull(l,l)` datetime DEFAULT NULL,
458
`ifnull(m,m)` varchar(1) DEFAULT NULL,
459
`ifnull(o,o)` varchar(10) DEFAULT NULL
477
461
drop table t1,t2;
478
462
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
479
463
insert into t1 values ('','',0,0.0);
481
465
Field Type Null Default Default_is_NULL On_Update
482
str VARCHAR YES def NO
483
strnull VARCHAR YES YES
484
intg INTEGER YES 10 NO
485
rel DOUBLE YES 3.14 NO
466
str VARCHAR TRUE def FALSE
467
strnull VARCHAR TRUE TRUE
468
intg INTEGER TRUE 10 FALSE
469
rel DOUBLE TRUE 3.14 FALSE
486
470
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
488
472
Field Type Null Default Default_is_NULL On_Update
490
strnull VARCHAR YES YES
473
str VARCHAR TRUE TRUE
474
strnull VARCHAR TRUE TRUE
475
intg INTEGER TRUE TRUE
493
477
drop table t1, t2;
494
478
create table t1(name varchar(10), age int default -1);
496
480
Field Type Null Default Default_is_NULL On_Update
498
age INTEGER YES -1 NO
481
name VARCHAR TRUE TRUE
482
age INTEGER TRUE -1 FALSE
499
483
create table t2(name varchar(10), age int default - 1);
501
485
Field Type Null Default Default_is_NULL On_Update
503
age INTEGER YES -1 NO
486
name VARCHAR TRUE TRUE
487
age INTEGER TRUE -1 FALSE
504
488
drop table t1, t2;
505
489
create table t1(cenum enum('a'));
506
490
create table t2(cenum enum('a','a'));
850
834
show create table t1;
851
835
Table Create Table
852
836
t1 CREATE TABLE `t1` (
853
`c1` INT DEFAULT NULL,
854
`c2` INT DEFAULT NULL,
855
`c3` INT DEFAULT NULL,
856
`c4` INT DEFAULT NULL,
857
`c5` INT DEFAULT NULL,
858
`c6` INT DEFAULT NULL,
859
`c7` INT DEFAULT NULL,
860
`c8` INT DEFAULT NULL,
861
`c9` INT DEFAULT NULL,
862
`c10` INT DEFAULT NULL,
863
`c11` INT DEFAULT NULL,
864
`c12` INT DEFAULT NULL,
865
`c13` INT DEFAULT NULL,
866
`c14` INT DEFAULT NULL,
867
`c15` INT DEFAULT NULL,
868
`c16` INT DEFAULT NULL,
837
`c1` int DEFAULT NULL,
838
`c2` int DEFAULT NULL,
839
`c3` int DEFAULT NULL,
840
`c4` int DEFAULT NULL,
841
`c5` int DEFAULT NULL,
842
`c6` int DEFAULT NULL,
843
`c7` int DEFAULT NULL,
844
`c8` int DEFAULT NULL,
845
`c9` int DEFAULT NULL,
846
`c10` int DEFAULT NULL,
847
`c11` int DEFAULT NULL,
848
`c12` int DEFAULT NULL,
849
`c13` int DEFAULT NULL,
850
`c14` int DEFAULT NULL,
851
`c15` int DEFAULT NULL,
852
`c16` int DEFAULT NULL,
869
853
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
870
854
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
871
855
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
930
914
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
931
915
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
932
916
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
933
) ENGINE=DEFAULT COLLATE = utf8_general_ci
935
919
show create table t1;
936
920
Table Create Table
937
921
t1 CREATE TABLE `t1` (
938
`c1` INT DEFAULT NULL,
939
`c2` INT DEFAULT NULL,
940
`c3` INT DEFAULT NULL,
941
`c4` INT DEFAULT NULL,
942
`c5` INT DEFAULT NULL,
943
`c6` INT DEFAULT NULL,
944
`c7` INT DEFAULT NULL,
945
`c8` INT DEFAULT NULL,
946
`c9` INT DEFAULT NULL,
947
`c10` INT DEFAULT NULL,
948
`c11` INT DEFAULT NULL,
949
`c12` INT DEFAULT NULL,
950
`c13` INT DEFAULT NULL,
951
`c14` INT DEFAULT NULL,
952
`c15` INT DEFAULT NULL,
953
`c16` INT DEFAULT NULL,
922
`c1` int DEFAULT NULL,
923
`c2` int DEFAULT NULL,
924
`c3` int DEFAULT NULL,
925
`c4` int DEFAULT NULL,
926
`c5` int DEFAULT NULL,
927
`c6` int DEFAULT NULL,
928
`c7` int DEFAULT NULL,
929
`c8` int DEFAULT NULL,
930
`c9` int DEFAULT NULL,
931
`c10` int DEFAULT NULL,
932
`c11` int DEFAULT NULL,
933
`c12` int DEFAULT NULL,
934
`c13` int DEFAULT NULL,
935
`c14` int DEFAULT NULL,
936
`c15` int DEFAULT NULL,
937
`c16` int DEFAULT NULL,
954
938
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
955
939
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
956
940
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1015
999
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1016
1000
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1017
1001
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1018
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1020
1004
create table t1 (c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int,
1021
1005
c8 int, c9 int, c10 int, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int);
1151
1135
show create table t1;
1152
1136
Table Create Table
1153
1137
t1 CREATE TABLE `t1` (
1154
`c1` INT DEFAULT NULL,
1155
`c2` INT DEFAULT NULL,
1156
`c3` INT DEFAULT NULL,
1157
`c4` INT DEFAULT NULL,
1158
`c5` INT DEFAULT NULL,
1159
`c6` INT DEFAULT NULL,
1160
`c7` INT DEFAULT NULL,
1161
`c8` INT DEFAULT NULL,
1162
`c9` INT DEFAULT NULL,
1163
`c10` INT DEFAULT NULL,
1164
`c11` INT DEFAULT NULL,
1165
`c12` INT DEFAULT NULL,
1166
`c13` INT DEFAULT NULL,
1167
`c14` INT DEFAULT NULL,
1168
`c15` INT DEFAULT NULL,
1169
`c16` INT DEFAULT NULL,
1138
`c1` int DEFAULT NULL,
1139
`c2` int DEFAULT NULL,
1140
`c3` int DEFAULT NULL,
1141
`c4` int DEFAULT NULL,
1142
`c5` int DEFAULT NULL,
1143
`c6` int DEFAULT NULL,
1144
`c7` int DEFAULT NULL,
1145
`c8` int DEFAULT NULL,
1146
`c9` int DEFAULT NULL,
1147
`c10` int DEFAULT NULL,
1148
`c11` int DEFAULT NULL,
1149
`c12` int DEFAULT NULL,
1150
`c13` int DEFAULT NULL,
1151
`c14` int DEFAULT NULL,
1152
`c15` int DEFAULT NULL,
1153
`c16` int DEFAULT NULL,
1170
1154
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1171
1155
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1172
1156
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1231
1215
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1232
1216
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1233
1217
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1234
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1236
1220
show create table t1;
1237
1221
Table Create Table
1238
1222
t1 CREATE TABLE `t1` (
1239
`c1` INT DEFAULT NULL,
1240
`c2` INT DEFAULT NULL,
1241
`c3` INT DEFAULT NULL,
1242
`c4` INT DEFAULT NULL,
1243
`c5` INT DEFAULT NULL,
1244
`c6` INT DEFAULT NULL,
1245
`c7` INT DEFAULT NULL,
1246
`c8` INT DEFAULT NULL,
1247
`c9` INT DEFAULT NULL,
1248
`c10` INT DEFAULT NULL,
1249
`c11` INT DEFAULT NULL,
1250
`c12` INT DEFAULT NULL,
1251
`c13` INT DEFAULT NULL,
1252
`c14` INT DEFAULT NULL,
1253
`c15` INT DEFAULT NULL,
1254
`c16` INT DEFAULT NULL,
1223
`c1` int DEFAULT NULL,
1224
`c2` int DEFAULT NULL,
1225
`c3` int DEFAULT NULL,
1226
`c4` int DEFAULT NULL,
1227
`c5` int DEFAULT NULL,
1228
`c6` int DEFAULT NULL,
1229
`c7` int DEFAULT NULL,
1230
`c8` int DEFAULT NULL,
1231
`c9` int DEFAULT NULL,
1232
`c10` int DEFAULT NULL,
1233
`c11` int DEFAULT NULL,
1234
`c12` int DEFAULT NULL,
1235
`c13` int DEFAULT NULL,
1236
`c14` int DEFAULT NULL,
1237
`c15` int DEFAULT NULL,
1238
`c16` int DEFAULT NULL,
1255
1239
KEY `a001_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1256
1240
KEY `a002_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1257
1241
KEY `a003_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1316
1300
KEY `a062_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1317
1301
KEY `a063_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`),
1318
1302
KEY `a064_long_123456789_123456789_123456789_123456789_123456789_1234` (`c1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8`,`c9`,`c10`,`c11`,`c12`,`c13`,`c14`,`c15`,`c16`)
1319
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1320
1304
alter table t1 add key
1321
1305
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1322
1306
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1455
1439
show create table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1456
1440
Table Create Table
1457
1441
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 CREATE TABLE `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` (
1458
`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` INT DEFAULT NULL,
1442
`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` int DEFAULT NULL,
1459
1443
KEY `имя_индекса_в_кодировке_утф8_длиной_больше_чем_48` (`имя_поля_в_кодировке_утф8_длиной_больше_чем_45`)
1460
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1461
1445
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1462
1446
create table t1 like data_dictionary.processlist;
1463
Got one of the listed errors
1447
ERROR HY000: Can't create table 'test.t1' (errno: 1)
1464
1448
create table t1 like data_dictionary.processlist engine=innodb;
1465
1449
show create table t1;
1466
1450
Table Create Table
1467
1451
t1 CREATE TABLE `t1` (
1468
`ID` BIGINT NOT NULL,
1469
`USERNAME` VARCHAR(16) NOT NULL,
1470
`HOST` VARCHAR(1025) NOT NULL,
1471
`DB` VARCHAR(256) DEFAULT NULL,
1472
`COMMAND` VARCHAR(16) NOT NULL,
1473
`TIME` BIGINT UNSIGNED NOT NULL,
1474
`STATE` VARCHAR(256) DEFAULT NULL,
1475
`INFO` VARCHAR(100) DEFAULT NULL,
1476
`HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
1477
) ENGINE=InnoDB COLLATE = utf8_general_ci
1452
`ID` bigint NOT NULL DEFAULT '0',
1453
`USER` varchar(16) NOT NULL DEFAULT '',
1454
`HOST` varchar(1025) NOT NULL DEFAULT '',
1455
`DB` varchar(256) NOT NULL DEFAULT '',
1456
`COMMAND` varchar(16) NOT NULL DEFAULT '',
1457
`TIME` bigint NOT NULL DEFAULT '0',
1458
`STATE` varchar(256) NOT NULL DEFAULT '',
1459
`INFO` varchar(100) NOT NULL DEFAULT ''
1479
1462
create temporary table t1 like data_dictionary.processlist;
1480
Got one of the listed errors
1463
ERROR HY000: Can't create table 'test.#t1' (errno: 138)
1481
1464
create temporary table t1 like data_dictionary.processlist engine=myisam;
1482
1465
show create table t1;
1483
1466
Table Create Table
1484
1467
t1 CREATE TEMPORARY TABLE `t1` (
1485
`ID` BIGINT NOT NULL,
1486
`USERNAME` VARCHAR(16) NOT NULL,
1487
`HOST` VARCHAR(1025) NOT NULL,
1488
`DB` VARCHAR(256) DEFAULT NULL,
1489
`COMMAND` VARCHAR(16) NOT NULL,
1490
`TIME` BIGINT UNSIGNED NOT NULL,
1491
`STATE` VARCHAR(256) DEFAULT NULL,
1492
`INFO` VARCHAR(100) DEFAULT NULL,
1493
`HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
1494
) ENGINE=MyISAM COLLATE = utf8_general_ci
1468
`ID` bigint NOT NULL DEFAULT '0',
1469
`USER` varchar(16) NOT NULL DEFAULT '',
1470
`HOST` varchar(1025) NOT NULL DEFAULT '',
1471
`DB` varchar(256) NOT NULL DEFAULT '',
1472
`COMMAND` varchar(16) NOT NULL DEFAULT '',
1473
`TIME` bigint NOT NULL DEFAULT '0',
1474
`STATE` varchar(256) NOT NULL DEFAULT '',
1475
`INFO` varchar(100) NOT NULL DEFAULT ''
1514
1496
SHOW CREATE TABLE t1;
1515
1497
Table Create Table
1516
1498
t1 CREATE TABLE `t1` (
1517
`c1` INT DEFAULT '12' COMMENT 'column1',
1518
`c2` INT DEFAULT NULL COMMENT 'column2',
1519
`c3` INT NOT NULL COMMENT 'column3',
1520
`c4` VARCHAR(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1521
`c5` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT 'b',
1522
`c6` VARCHAR(255) COLLATE utf8_bin DEFAULT NULL
1523
) ENGINE=DEFAULT COLLATE = utf8_bin
1499
`c1` int DEFAULT '12' COMMENT 'column1',
1500
`c2` int DEFAULT NULL COMMENT 'column2',
1501
`c3` int NOT NULL COMMENT 'column3',
1502
`c4` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1503
`c5` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'b',
1504
`c6` varchar(255) COLLATE utf8_bin DEFAULT NULL
1525
1507
CREATE TABLE t2 AS SELECT * FROM t1;
1527
1509
SHOW CREATE TABLE t2;
1528
1510
Table Create Table
1529
1511
t2 CREATE TABLE `t2` (
1530
`c1` INT DEFAULT '12' COMMENT 'column1',
1531
`c2` INT DEFAULT NULL COMMENT 'column2',
1532
`c3` INT NOT NULL COMMENT 'column3',
1533
`c4` VARCHAR(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1534
`c5` VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT 'b',
1535
`c6` VARCHAR(255) COLLATE utf8_bin DEFAULT NULL
1536
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1512
`c1` int DEFAULT '12' COMMENT 'column1',
1513
`c2` int DEFAULT NULL COMMENT 'column2',
1514
`c3` int NOT NULL COMMENT 'column3',
1515
`c4` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT 'a',
1516
`c5` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'b',
1517
`c6` varchar(255) COLLATE utf8_bin DEFAULT NULL