26
58
test.t1 check status OK
27
59
show index from t1;
28
60
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
29
def data_dictionary show_indexes SHOW_INDEXES Table Table 8 1024 2 N 4097 0 45
30
def data_dictionary show_indexes SHOW_INDEXES Unique Unique 8 1 3 N 4097 0 63
31
def data_dictionary show_indexes SHOW_INDEXES Key_name Key_name 8 1024 7 N 4097 0 45
32
def data_dictionary show_indexes SHOW_INDEXES Seq_in_index Seq_in_index 5 21 1 N 36865 0 63
33
def data_dictionary show_indexes SHOW_INDEXES Column_name Column_name 8 1024 1 N 4097 0 45
34
Table Unique Key_name Seq_in_index Column_name
61
def STATISTICS TABLE_NAME Table 8 256 2 N 1 0 45
62
def STATISTICS NON_UNIQUE Non_unique 5 1 1 N 32769 0 63
63
def STATISTICS INDEX_NAME Key_name 8 256 7 N 1 0 45
64
def STATISTICS SEQ_IN_INDEX Seq_in_index 5 2 1 N 32769 0 63
65
def STATISTICS COLUMN_NAME Column_name 8 256 1 N 1 0 45
66
def STATISTICS COLLATION Collation 8 4 1 Y 0 0 45
67
def STATISTICS CARDINALITY Cardinality 5 21 1 Y 32768 0 63
68
def STATISTICS SUB_PART Sub_part 5 3 0 Y 32768 0 63
69
def STATISTICS PACKED Packed 8 40 0 Y 0 0 45
70
def STATISTICS NULLABLE Null 8 12 0 N 1 0 45
71
def STATISTICS INDEX_TYPE Index_type 8 64 5 N 1 0 45
72
def STATISTICS COMMENT Comment 8 64 0 Y 0 0 45
73
def STATISTICS INDEX_COMMENT Index_Comment 8 4096 0 N 1 0 45
74
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
75
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
76
t1 1 b 1 b A 5 NULL NULL BTREE
77
t1 1 b 2 c A 5 NULL NULL BTREE
38
78
insert into t1 values (5,5,5);
39
79
ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
40
80
-- Here we enable metadata just to check that the collation of the
41
81
-- resultset is non-binary for string type. This should be changed
42
82
-- after Bug#29394 is implemented.
43
alter table t1 engine="default";
44
alter table t1 engine="default";
84
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
85
def Table 8 512 7 Y 0 31 45
86
def Op 8 40 8 Y 0 31 45
87
def Msg_type 8 40 6 Y 0 31 45
88
def Msg_text 8 1020 2 Y 0 31 45
89
Table Op Msg_type Msg_text
90
test.t1 optimize status OK
92
Table Op Msg_type Msg_text
93
test.t1 optimize status OK
46
95
-- Here we enable metadata just to check that the collation of the
47
96
-- resultset is non-binary for string type. This should be changed
48
97
-- after Bug#29394 is implemented.
49
98
show variables like "server_id%";
50
99
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
51
def data_dictionary session_variables SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 9 N 4097 0 45
52
def data_dictionary session_variables SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 1 N 4097 0 45
100
def VARIABLES VARIABLE_NAME Variable_name 8 256 9 N 1 0 45
101
def VARIABLES VARIABLE_VALUE Value 8 65200 1 Y 0 0 45
53
102
Variable_name Value
55
104
show variables like "SERVER_id%";
56
105
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
57
def data_dictionary session_variables SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 9 N 4097 0 45
58
def data_dictionary session_variables SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 1 N 4097 0 45
106
def VARIABLES VARIABLE_NAME Variable_name 8 256 9 N 1 0 45
107
def VARIABLES VARIABLE_VALUE Value 8 65200 1 Y 0 0 45
59
108
Variable_name Value
61
110
show variables like "this_doesn't_exists%";
62
111
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
63
def data_dictionary session_variables SESSION_VARIABLES VARIABLE_NAME Variable_name 8 1024 0 N 4097 0 45
64
def data_dictionary session_variables SESSION_VARIABLES VARIABLE_VALUE Value 8 4096 0 N 4097 0 45
112
def VARIABLES VARIABLE_NAME Variable_name 8 256 0 N 1 0 45
113
def VARIABLES VARIABLE_VALUE Value 8 65200 0 Y 0 0 45
65
114
Variable_name Value
66
115
show table status from test like "this_doesn't_exists%";
67
116
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
68
def data_dictionary show_table_status SHOW_TABLE_STATUS Session Session 5 21 0 N 36865 0 63
69
def data_dictionary show_table_status SHOW_TABLE_STATUS Schema Schema 8 1024 0 N 4097 0 45
70
def data_dictionary show_table_status SHOW_TABLE_STATUS Name Name 8 1024 0 N 4097 0 45
71
def data_dictionary show_table_status SHOW_TABLE_STATUS Type Type 8 1024 0 N 4097 0 45
72
def data_dictionary show_table_status SHOW_TABLE_STATUS Engine Engine 8 1024 0 N 4097 0 45
73
def data_dictionary show_table_status SHOW_TABLE_STATUS Version Version 8 1024 0 N 4097 0 45
74
def data_dictionary show_table_status SHOW_TABLE_STATUS Rows Rows 8 1024 0 N 4097 0 45
75
def data_dictionary show_table_status SHOW_TABLE_STATUS Avg_row_length Avg_row_length 8 1024 0 N 4097 0 45
76
def data_dictionary show_table_status SHOW_TABLE_STATUS Table_size Table_size 8 1024 0 N 4097 0 45
77
def data_dictionary show_table_status SHOW_TABLE_STATUS Auto_increment Auto_increment 8 1024 0 N 4097 0 45
78
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
117
def TABLES TABLE_NAME Name 8 256 0 N 1 0 45
118
def TABLES ENGINE Engine 8 256 0 Y 0 0 45
119
def TABLES VERSION Version 5 21 0 Y 32768 0 63
120
def TABLES ROW_FORMAT Row_format 8 40 0 Y 0 0 45
121
def TABLES TABLE_ROWS Rows 5 21 0 Y 32768 0 63
122
def TABLES AVG_ROW_LENGTH Avg_row_length 5 21 0 Y 32768 0 63
123
def TABLES DATA_LENGTH Data_length 5 21 0 Y 32768 0 63
124
def TABLES MAX_DATA_LENGTH Max_data_length 5 21 0 Y 32768 0 63
125
def TABLES INDEX_LENGTH Index_length 5 21 0 Y 32768 0 63
126
def TABLES DATA_FREE Data_free 5 21 0 Y 32768 0 63
127
def TABLES AUTO_INCREMENT Auto_increment 5 21 0 Y 32768 0 63
128
def TABLES CREATE_TIME Create_time 6 19 0 Y 128 0 63
129
def TABLES UPDATE_TIME Update_time 6 19 0 Y 128 0 63
130
def TABLES CHECK_TIME Check_time 6 19 0 Y 128 0 63
131
def TABLES TABLE_COLLATION Collation 8 256 0 Y 0 0 45
132
def TABLES CHECKSUM Checksum 5 21 0 Y 32768 0 63
133
def TABLES CREATE_OPTIONS Create_options 8 1020 0 Y 0 0 45
134
def TABLES TABLE_COMMENT Comment 8 8192 0 N 1 0 45
135
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
80
137
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
81
def data_dictionary show_schemas SHOW_SCHEMAS SCHEMA_NAME Database 8 1024 18 N 4097 0 45
138
def SCHEMATA SCHEMA_NAME Database 8 256 18 N 1 0 45
87
143
show databases like "test%";
88
144
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
89
def data_dictionary show_schemas SHOW_SCHEMAS SCHEMA_NAME Database (test%) 8 1024 4 N 4097 0 45
145
def SCHEMATA SCHEMA_NAME Database (test%) 8 256 4 N 1 0 45
92
148
create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));
103
159
Table Op Msg_type Msg_text
104
160
test.t1 analyze status OK
105
161
show index from t1;
106
Table Unique Key_name Seq_in_index Column_name
162
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
163
t1 0 PRIMARY 1 f1 A 2 NULL NULL BTREE
164
t1 0 PRIMARY 2 f2 A 6 NULL NULL BTREE
165
t1 0 PRIMARY 3 f3 A 18 NULL NULL BTREE
166
t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE
111
167
show index from t1;
112
Table Unique Key_name Seq_in_index Column_name
168
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
169
t1 0 PRIMARY 1 f1 A 2 NULL NULL BTREE
170
t1 0 PRIMARY 2 f2 A 6 NULL NULL BTREE
171
t1 0 PRIMARY 3 f3 A 18 NULL NULL BTREE
172
t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE
118
174
create temporary table t1 (a int not null);
119
175
show create table t1;
120
176
Table Create Table
121
177
t1 CREATE TEMPORARY TABLE `t1` (
123
) ENGINE=DEFAULT COLLATE = utf8_general_ci
124
180
alter table t1 rename t2;
125
181
show create table t2;
126
182
Table Create Table
127
183
t2 CREATE TEMPORARY TABLE `t2` (
129
) ENGINE=DEFAULT COLLATE = utf8_general_ci
131
187
create table t1 (
132
188
name char(20) default 'O''Brien' comment 'O''Brien as default',
137
193
show create table t1;
138
194
Table Create Table
139
195
t1 CREATE TABLE `t1` (
140
`name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT 'O''Brien' COMMENT 'O''Brien as default',
141
`c` INT NOT NULL COMMENT 'int column',
142
`c-b` INT DEFAULT NULL COMMENT 'name with a minus',
143
`space 2` INT DEFAULT NULL COMMENT 'name with a space'
144
) ENGINE=DEFAULT COMMENT='it''s a table' COLLATE = utf8_general_ci
145
show columns from t1;
146
Field Type Null Default Default_is_NULL On_Update
147
name VARCHAR YES O'Brien NO
150
space 2 INTEGER YES YES
196
`name` varchar(20) DEFAULT 'O''Brien' COMMENT 'O''Brien as default',
197
`c` int NOT NULL COMMENT 'int column',
198
`c-b` int DEFAULT NULL COMMENT 'name with a minus',
199
`space 2` int DEFAULT NULL COMMENT 'name with a space'
200
) ENGINE=DEFAULT COMMENT='it''s a table'
201
show full columns from t1;
202
Field Type Collation Null Key Default Extra Privileges Comment
203
name varchar(20) utf8_general_ci YES O'Brien O'Brien as default
204
c int NULL NO NULL int column
205
c-b int NULL YES NULL name with a minus
206
space 2 int NULL YES NULL name with a space
152
208
create table t1 (a int not null, unique aa (a));
153
209
show create table t1;
154
210
Table Create Table
155
211
t1 CREATE TABLE `t1` (
157
213
UNIQUE KEY `aa` (`a`)
158
) ENGINE=DEFAULT COLLATE = utf8_general_ci
160
216
create table t1 (a int not null, primary key (a));
161
217
show create table t1;
162
218
Table Create Table
163
219
t1 CREATE TABLE `t1` (
165
221
PRIMARY KEY (`a`)
166
) ENGINE=DEFAULT COLLATE = utf8_general_ci
226
Database Table In_use Name_locked
227
create table t1(n int);
228
insert into t1 values (1);
230
Database Table In_use Name_locked
168
233
create temporary table t1 (a int not null, b VARCHAR(10), INDEX (b) ) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
169
234
show create table t1;
170
235
Table Create Table
171
236
t1 CREATE TEMPORARY TABLE `t1` (
173
`b` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
238
`b` varchar(10) DEFAULT NULL,
175
) ENGINE=MyISAM ROW_FORMAT='fixed' COMMENT='test' COLLATE = utf8_general_ci
240
) ENGINE=MyISAM ROW_FORMAT=FIXED COMMENT='test'
176
241
alter table t1 ROW_FORMAT=dynamic;
177
242
show create table t1;
178
243
Table Create Table
179
244
t1 CREATE TEMPORARY TABLE `t1` (
181
`b` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
246
`b` varchar(10) DEFAULT NULL,
183
) ENGINE=MyISAM ROW_FORMAT='dynamic' COMMENT='test' COLLATE = utf8_general_ci
184
ALTER TABLE t1 COMMENT="", ROW_FORMAT=default;
248
) ENGINE=MyISAM ROW_FORMAT=DYNAMIC COMMENT='test'
249
ALTER TABLE t1 COMMENT="" ROW_FORMAT=default;
185
250
show create table t1;
186
251
Table Create Table
187
252
t1 CREATE TEMPORARY TABLE `t1` (
189
`b` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
254
`b` varchar(10) DEFAULT NULL,
191
) ENGINE=MyISAM ROW_FORMAT='default' COLLATE = utf8_general_ci
193
258
create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0));
194
259
show columns from t1;
195
Field Type Null Default Default_is_NULL On_Update
202
show columns from t1;
203
Field Type Null Default Default_is_NULL On_Update
260
Field Type Null Key Default Extra
261
a decimal(9,2) YES NULL
262
b decimal(9,0) YES NULL
263
e double(9,2) YES NULL
264
f double(5,0) YES NULL
265
h double(3,2) YES NULL
266
i double(3,0) YES NULL
267
show full columns from t1;
268
Field Type Collation Null Key Default Extra Privileges Comment
269
a decimal(9,2) NULL YES NULL
270
b decimal(9,0) NULL YES NULL
271
e double(9,2) NULL YES NULL
272
f double(5,0) NULL YES NULL
273
h double(3,2) NULL YES NULL
274
i double(3,0) NULL YES NULL
211
276
create temporary table t1 (
227
292
show create table t1;
228
293
Table Create Table
229
294
t1 CREATE TEMPORARY TABLE `t1` (
230
`type_int` INT DEFAULT NULL,
231
`type_bigint` BIGINT DEFAULT NULL,
232
`type_decimal` DECIMAL(5,2) DEFAULT NULL,
233
`type_numeric` DECIMAL(5,2) DEFAULT NULL,
234
`empty_char` VARCHAR(0) COLLATE utf8_general_ci DEFAULT NULL,
235
`type_char` VARCHAR(2) COLLATE utf8_general_ci DEFAULT NULL,
236
`type_varchar` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
237
`type_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
238
`type_date` DATE DEFAULT NULL,
239
`type_datetime` DATETIME DEFAULT NULL,
240
`type_enum` ENUM('red','green','blue') DEFAULT NULL,
241
`type_set` ENUM('red','green','blue') DEFAULT NULL,
295
`type_int` int DEFAULT NULL,
296
`type_bigint` bigint DEFAULT NULL,
297
`type_decimal` decimal(5,2) DEFAULT NULL,
298
`type_numeric` decimal(5,2) DEFAULT NULL,
299
`empty_char` varchar(0) DEFAULT NULL,
300
`type_char` varchar(2) DEFAULT NULL,
301
`type_varchar` varchar(10) DEFAULT NULL,
302
`type_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
303
`type_date` date DEFAULT NULL,
304
`type_datetime` datetime DEFAULT NULL,
305
`type_enum` enum('red','green','blue') DEFAULT NULL,
306
`type_set` enum('red','green','blue') DEFAULT NULL,
243
308
KEY `type_int` (`type_int`)
244
) ENGINE=MyISAM ROW_FORMAT='fixed' COMMENT='test' COLLATE = utf8_general_ci
309
) ENGINE=MyISAM ROW_FORMAT=FIXED COMMENT='test'
245
310
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
246
311
select * from t1;
247
312
type_int type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_datetime type_enum type_set type_blob
250
315
create table t1 (a int not null);
251
316
create table t2 select max(a) from t1;
252
317
show columns from t2;
253
Field Type Null Default Default_is_NULL On_Update
254
max(a) INTEGER YES YES
318
Field Type Null Key Default Extra
255
320
drop table t1,t2;
256
321
create table t1 (c decimal, d double, f float, r real);
257
322
show columns from t1;
258
Field Type Null Default Default_is_NULL On_Update
323
Field Type Null Key Default Extra
324
c decimal(10,0) YES NULL
264
329
create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
265
330
show columns from t1;
266
Field Type Null Default Default_is_NULL On_Update
331
Field Type Null Key Default Extra
332
c decimal(3,3) YES NULL
333
d double(3,3) YES NULL
334
f double(3,3) YES NULL
271
336
CREATE TABLE ```ab``cd``` (i INT);
272
337
SHOW CREATE TABLE ```ab``cd```;
273
338
Table Create Table
274
339
`ab`cd` CREATE TABLE ```ab``cd``` (
276
) ENGINE=DEFAULT COLLATE = utf8_general_ci
277
342
DROP TABLE ```ab``cd```;
278
343
CREATE TABLE ```ab````cd``` (i INT);
279
344
SHOW CREATE TABLE ```ab````cd```;
280
345
Table Create Table
281
346
`ab``cd` CREATE TABLE ```ab````cd``` (
283
) ENGINE=DEFAULT COLLATE = utf8_general_ci
284
349
DROP TABLE ```ab````cd```;
285
350
CREATE TABLE ```a` (i INT);
286
351
SHOW CREATE TABLE ```a`;
287
352
Table Create Table
288
353
`a CREATE TABLE ```a` (
290
) ENGINE=DEFAULT COLLATE = utf8_general_ci
291
356
DROP TABLE ```a`;
292
357
CREATE TABLE `a.1` (i INT);
293
358
SHOW CREATE TABLE `a.1`;
294
359
Table Create Table
295
360
a.1 CREATE TABLE `a.1` (
297
) ENGINE=DEFAULT COLLATE = utf8_general_ci
298
363
DROP TABLE `a.1`;
299
364
select @@max_heap_table_size;
300
365
@@max_heap_table_size
302
367
CREATE TEMPORARY TABLE t1 (
303
368
a int default NULL,
304
369
KEY a USING BTREE (a)
306
371
CREATE TEMPORARY TABLE t2 (
307
372
b int default NULL,
310
375
CREATE TEMPORARY TABLE t3 (
311
376
a int default NULL,
312
377
b int default NULL,
313
378
KEY a USING BTREE (a),
316
381
insert into t1 values (1),(2);
317
382
insert into t2 values (1),(2);
318
383
insert into t3 values (1,1),(2,2);
319
384
show table status;
320
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
321
# test t1 TEMPORARY MEMORY # # # # #
322
# test t2 TEMPORARY MEMORY # # # # #
323
# test t3 TEMPORARY MEMORY # # # # #
385
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
324
386
insert into t1 values (3),(4);
325
387
insert into t2 values (3),(4);
326
388
insert into t3 values (3,3),(4,4);
327
389
show table status;
328
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
329
# test t1 TEMPORARY MEMORY # # # # #
330
# test t2 TEMPORARY MEMORY # # # # #
331
# test t3 TEMPORARY MEMORY # # # # #
390
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
332
391
insert into t1 values (5);
333
392
insert into t2 values (5);
334
393
insert into t3 values (5,5);
335
394
show table status;
336
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
337
# test t1 TEMPORARY MEMORY # # # # #
338
# test t2 TEMPORARY MEMORY # # # # #
339
# test t3 TEMPORARY MEMORY # # # # #
395
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
340
396
delete from t1 where a=3;
341
397
delete from t2 where b=3;
342
398
delete from t3 where a=3;
343
399
show table status;
344
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
345
# test t1 TEMPORARY MEMORY # # # # #
346
# test t2 TEMPORARY MEMORY # # # # #
347
# test t3 TEMPORARY MEMORY # # # # #
400
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
348
401
truncate table t1;
349
402
truncate table t2;
350
403
truncate table t3;
351
404
show table status;
352
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
353
# test t1 TEMPORARY MEMORY # # # # #
354
# test t2 TEMPORARY MEMORY # # # # #
355
# test t3 TEMPORARY MEMORY # # # # #
405
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
356
406
insert into t1 values (5);
357
407
insert into t2 values (5);
358
408
insert into t3 values (5,5);
359
409
show table status;
360
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
361
# test t1 TEMPORARY MEMORY # # # # #
362
# test t2 TEMPORARY MEMORY # # # # #
363
# test t3 TEMPORARY MEMORY # # # # #
410
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
364
411
delete from t1 where a=5;
365
412
delete from t2 where b=5;
366
413
delete from t3 where a=5;
367
414
show table status;
368
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
369
# test t1 TEMPORARY MEMORY # # # # #
370
# test t2 TEMPORARY MEMORY # # # # #
371
# test t3 TEMPORARY MEMORY # # # # #
415
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
372
416
drop table t1, t2, t3;
373
417
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
374
418
SHOW CREATE TABLE t1;
375
419
Table Create Table
376
420
t1 CREATE TEMPORARY TABLE `t1` (
377
`i` INT DEFAULT NULL,
421
`i` int DEFAULT NULL,
379
) ENGINE=MEMORY COLLATE = utf8_general_ci
381
425
CREATE TEMPORARY TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
382
426
SHOW CREATE TABLE t1;
383
427
Table Create Table
384
428
t1 CREATE TEMPORARY TABLE `t1` (
385
`i` INT DEFAULT NULL,
429
`i` int DEFAULT NULL,
386
430
KEY `i` (`i`) USING HASH
387
) ENGINE=MEMORY COLLATE = utf8_general_ci
389
433
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
390
434
SHOW CREATE TABLE t1;
391
435
Table Create Table
392
436
t1 CREATE TEMPORARY TABLE `t1` (
393
`i` INT DEFAULT NULL,
394
KEY `i` (`i`) USING BTREE
395
) ENGINE=MEMORY COLLATE = utf8_general_ci
397
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
398
SHOW CREATE TABLE t1;
400
t1 CREATE TEMPORARY TABLE `t1` (
401
`i` INT DEFAULT NULL,
403
) ENGINE=MyISAM COLLATE = utf8_general_ci
405
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
406
SHOW CREATE TABLE t1;
408
t1 CREATE TEMPORARY TABLE `t1` (
409
`i` INT DEFAULT NULL,
410
KEY `i` (`i`) USING BTREE
411
) ENGINE=MyISAM COLLATE = utf8_general_ci
413
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
414
SHOW CREATE TABLE t1;
416
t1 CREATE TEMPORARY TABLE `t1` (
417
`i` INT DEFAULT NULL,
419
) ENGINE=MyISAM COLLATE = utf8_general_ci
420
ALTER TABLE t1 ENGINE=MEMORY;
421
SHOW CREATE TABLE t1;
423
t1 CREATE TEMPORARY TABLE `t1` (
424
`i` INT DEFAULT NULL,
426
) ENGINE=MEMORY COLLATE = utf8_general_ci
428
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
429
SHOW CREATE TABLE t1;
431
t1 CREATE TEMPORARY TABLE `t1` (
432
`i` INT DEFAULT NULL,
433
KEY `i` (`i`) USING BTREE
434
) ENGINE=MyISAM COLLATE = utf8_general_ci
435
ALTER TABLE t1 ENGINE=MEMORY;
436
SHOW CREATE TABLE t1;
438
t1 CREATE TEMPORARY TABLE `t1` (
439
`i` INT DEFAULT NULL,
440
KEY `i` (`i`) USING BTREE
441
) ENGINE=MEMORY COLLATE = utf8_general_ci
437
`i` int DEFAULT NULL,
438
KEY `i` (`i`) USING BTREE
441
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
442
SHOW CREATE TABLE t1;
444
t1 CREATE TEMPORARY TABLE `t1` (
445
`i` int DEFAULT NULL,
449
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
450
SHOW CREATE TABLE t1;
452
t1 CREATE TEMPORARY TABLE `t1` (
453
`i` int DEFAULT NULL,
454
KEY `i` (`i`) USING BTREE
457
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
458
SHOW CREATE TABLE t1;
460
t1 CREATE TEMPORARY TABLE `t1` (
461
`i` int DEFAULT NULL,
464
ALTER TABLE t1 ENGINE=MEMORY;
465
SHOW CREATE TABLE t1;
467
t1 CREATE TEMPORARY TABLE `t1` (
468
`i` int DEFAULT NULL,
472
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
473
SHOW CREATE TABLE t1;
475
t1 CREATE TEMPORARY TABLE `t1` (
476
`i` int DEFAULT NULL,
477
KEY `i` (`i`) USING BTREE
479
ALTER TABLE t1 ENGINE=MEMORY;
480
SHOW CREATE TABLE t1;
482
t1 CREATE TEMPORARY TABLE `t1` (
483
`i` int DEFAULT NULL,
484
KEY `i` (`i`) USING BTREE
444
488
field1 text NOT NULL,
447
491
show index from t1;
448
492
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
449
def data_dictionary show_indexes SHOW_INDEXES Table Table 8 1024 2 N 4097 0 45
450
def data_dictionary show_indexes SHOW_INDEXES Unique Unique 8 1 3 N 4097 0 63
451
def data_dictionary show_indexes SHOW_INDEXES Key_name Key_name 8 1024 7 N 4097 0 45
452
def data_dictionary show_indexes SHOW_INDEXES Seq_in_index Seq_in_index 5 21 1 N 36865 0 63
453
def data_dictionary show_indexes SHOW_INDEXES Column_name Column_name 8 1024 6 N 4097 0 45
454
Table Unique Key_name Seq_in_index Column_name
455
t1 YES PRIMARY 1 field1
493
def STATISTICS TABLE_NAME Table 8 256 2 N 1 0 45
494
def STATISTICS NON_UNIQUE Non_unique 5 1 1 N 32769 0 63
495
def STATISTICS INDEX_NAME Key_name 8 256 7 N 1 0 45
496
def STATISTICS SEQ_IN_INDEX Seq_in_index 5 2 1 N 32769 0 63
497
def STATISTICS COLUMN_NAME Column_name 8 256 6 N 1 0 45
498
def STATISTICS COLLATION Collation 8 4 1 Y 0 0 45
499
def STATISTICS CARDINALITY Cardinality 5 21 1 Y 32768 0 63
500
def STATISTICS SUB_PART Sub_part 5 3 3 Y 32768 0 63
501
def STATISTICS PACKED Packed 8 40 0 Y 0 0 45
502
def STATISTICS NULLABLE Null 8 12 0 N 1 0 45
503
def STATISTICS INDEX_TYPE Index_type 8 64 5 N 1 0 45
504
def STATISTICS COMMENT Comment 8 64 0 Y 0 0 45
505
def STATISTICS INDEX_COMMENT Index_Comment 8 4096 0 N 1 0 45
506
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
507
t1 0 PRIMARY 1 field1 A 0 180 NULL BTREE
457
509
create table t1 (
463
515
SHOW CREATE TABLE t1;
464
516
Table Create Table
465
517
t1 CREATE TABLE `t1` (
468
520
PRIMARY KEY (`c1`) USING HASH,
469
521
KEY `c2` (`c2`) USING BTREE
470
) ENGINE=DEFAULT COLLATE = utf8_general_ci
525
# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
527
DROP DATABASE IF EXISTS mysqltest1;
528
CREATE DATABASE mysqltest1;
531
CREATE TABLE t1(a INT);
532
CREATE TABLE t2(a INT);
541
SHOW OPEN TABLES FROM mysqltest1;
542
Database Table In_use Name_locked
546
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
547
Database Table In_use Name_locked
549
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
550
Database Table In_use Name_locked
553
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
554
Database Table In_use Name_locked
559
DROP DATABASE mysqltest1;
472
562
SHOW TABLES FROM non_existing_database;
473
ERROR 42000: Unknown schema 'non_existing_database'
563
ERROR 42000: Unknown database 'non_existing_database'
475
565
SHOW TABLES FROM no_such_database;
476
ERROR 42000: Unknown schema 'no_such_database'
566
ERROR 42000: Unknown database 'no_such_database'
477
567
SHOW COLUMNS FROM no_such_table;
478
ERROR 42S02: Unknown table 'test.no_such_table'
568
ERROR 42S02: Table 'test.no_such_table' doesn't exist
479
569
show variables like 'myisam_recover_options';
480
570
Variable_name Value
485
575
Tables_in_mysqlttest\1
487
577
show fields from `mysqlttest\1`.`a\b`;
488
Field Type Null Default Default_is_NULL On_Update
578
Field Type Null Key Default Extra
490
580
show columns from `a\b` from `mysqlttest\1`;
491
Field Type Null Default Default_is_NULL On_Update
581
Field Type Null Key Default Extra
493
583
show keys from `mysqlttest\1`.`a\b`;
494
Table Unique Key_name Seq_in_index Column_name
584
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
495
585
drop table `mysqlttest\1`.`a\b`;
496
586
drop database `mysqlttest\1`;
587
show engine foobar status;
588
ERROR 42000: Unknown table engine 'foobar'
589
show engine foobar logs;
590
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'logs' at line 1
591
show engine foobar mutex;
592
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'mutex' at line 1
593
show engine mutex status;
594
ERROR 42000: Unknown table engine 'mutex'
595
show engine csv status;
497
597
drop table if exists `été`;
498
598
create table `été` (field1 int);
600
Tables_in_test Table_type
502
602
drop table `été`;
503
603
show columns from `#mysql50#????????`;
504
604
Got one of the listed errors
506
ERROR HY000: Engine status is now stored in the data_dictionary tables, please use these instead.