204
204
show create table t1;
205
205
Table Create Table
206
206
t1 CREATE TABLE `t1` (
207
`name` varchar(20) COMMENT 'O''Brien as default',
207
`name` varchar(20) DEFAULT 'O''Brien' COMMENT 'O''Brien as default',
208
208
`c` int NOT NULL COMMENT 'int column',
209
`c-b` int COMMENT 'name with a minus',
210
`space 2` int COMMENT 'name with a space'
209
`c-b` int DEFAULT NULL COMMENT 'name with a minus',
210
`space 2` int DEFAULT NULL COMMENT 'name with a space'
211
211
) ENGINE=InnoDB COMMENT='it''s a table'
212
212
show full columns from t1;
213
213
Field Type Collation Null Key Default Extra Privileges Comment
214
name varchar(20) utf8_general_ci YES NULL O'Brien as default
214
name varchar(20) utf8_general_ci YES O'Brien O'Brien as default
215
215
c int NULL NO NULL int column
216
216
c-b int NULL YES NULL name with a minus
217
217
space 2 int NULL YES NULL name with a space
304
304
show create table t1;
305
305
Table Create Table
306
306
t1 CREATE TABLE `t1` (
308
`type_bigint` bigint,
309
`type_decimal` decimal(5,2),
310
`type_numeric` decimal(5,2),
311
`empty_char` varchar(0),
312
`type_char` varchar(2),
313
`type_varchar` varchar(10),
307
`type_int` int DEFAULT NULL,
308
`type_bigint` bigint DEFAULT NULL,
309
`type_decimal` decimal(5,2) DEFAULT NULL,
310
`type_numeric` decimal(5,2) DEFAULT NULL,
311
`empty_char` varchar(0) DEFAULT NULL,
312
`type_char` varchar(2) DEFAULT NULL,
313
`type_varchar` varchar(10) DEFAULT NULL,
314
314
`type_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
316
`type_time` time NOT NULL,
317
`type_datetime` datetime,
318
`type_enum` enum('red','green','blue'),
319
`type_set` enum('red','green','blue'),
315
`type_date` date DEFAULT NULL,
316
`type_time` time NOT NULL DEFAULT '00:00:00',
317
`type_datetime` datetime DEFAULT NULL,
318
`type_enum` enum('red','green','blue') DEFAULT NULL,
319
`type_set` enum('red','green','blue') DEFAULT NULL,
320
320
`type_blob` blob,
321
321
KEY `type_int` (`type_int`)
322
322
) ENGINE=MyISAM MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
350
350
SHOW CREATE TABLE ```ab``cd```;
351
351
Table Create Table
352
352
`ab`cd` CREATE TABLE ```ab``cd``` (
355
355
DROP TABLE ```ab``cd```;
356
356
CREATE TABLE ```ab````cd``` (i INT);
357
357
SHOW CREATE TABLE ```ab````cd```;
358
358
Table Create Table
359
359
`ab``cd` CREATE TABLE ```ab````cd``` (
362
362
DROP TABLE ```ab````cd```;
363
363
CREATE TABLE ```a` (i INT);
364
364
SHOW CREATE TABLE ```a`;
365
365
Table Create Table
366
366
`a CREATE TABLE ```a` (
369
369
DROP TABLE ```a`;
370
370
CREATE TABLE `a.1` (i INT);
371
371
SHOW CREATE TABLE `a.1`;
372
372
Table Create Table
373
373
a.1 CREATE TABLE `a.1` (
376
376
DROP TABLE `a.1`;
377
377
select @@max_heap_table_size;
468
468
SHOW CREATE TABLE t1;
469
469
Table Create Table
470
470
t1 CREATE TABLE `t1` (
472
KEY `i` (`i`) USING BTREE
475
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
476
SHOW CREATE TABLE t1;
478
t1 CREATE TABLE `t1` (
483
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
484
SHOW CREATE TABLE t1;
486
t1 CREATE TABLE `t1` (
488
KEY `i` (`i`) USING BTREE
491
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
492
SHOW CREATE TABLE t1;
494
t1 CREATE TABLE `t1` (
498
ALTER TABLE t1 ENGINE=MEMORY;
499
SHOW CREATE TABLE t1;
501
t1 CREATE TABLE `t1` (
506
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
507
SHOW CREATE TABLE t1;
509
t1 CREATE TABLE `t1` (
511
KEY `i` (`i`) USING BTREE
513
ALTER TABLE t1 ENGINE=MEMORY;
514
SHOW CREATE TABLE t1;
516
t1 CREATE TABLE `t1` (
471
`i` int DEFAULT NULL,
472
KEY `i` (`i`) USING BTREE
475
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
476
SHOW CREATE TABLE t1;
478
t1 CREATE TABLE `t1` (
479
`i` int DEFAULT NULL,
483
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
484
SHOW CREATE TABLE t1;
486
t1 CREATE TABLE `t1` (
487
`i` int DEFAULT NULL,
488
KEY `i` (`i`) USING BTREE
491
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
492
SHOW CREATE TABLE t1;
494
t1 CREATE TABLE `t1` (
495
`i` int DEFAULT NULL,
498
ALTER TABLE t1 ENGINE=MEMORY;
499
SHOW CREATE TABLE t1;
501
t1 CREATE TABLE `t1` (
502
`i` int DEFAULT NULL,
506
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
507
SHOW CREATE TABLE t1;
509
t1 CREATE TABLE `t1` (
510
`i` int DEFAULT NULL,
511
KEY `i` (`i`) USING BTREE
513
ALTER TABLE t1 ENGINE=MEMORY;
514
SHOW CREATE TABLE t1;
516
t1 CREATE TABLE `t1` (
517
`i` int DEFAULT NULL,
518
518
KEY `i` (`i`) USING BTREE