1
drop table if exists t1,t2;
2
drop table if exists t1aa,t2aa;
3
drop database if exists mysqltest;
4
drop database if exists mysqltest1;
5
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
6
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
7
-- Here we enable metadata just to check that the collation of the
8
-- resultset is non-binary for string type. This should be changed
9
-- after Bug#29394 is implemented.
11
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
12
def Table 253 128 7 Y 0 31 8
13
def Op 253 10 5 Y 0 31 8
14
def Msg_type 253 10 6 Y 0 31 8
15
def Msg_text 253 255 27 Y 0 31 8
16
Table Op Msg_type Msg_text
17
test.t1 check status Table is already up to date
19
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
20
def Table 253 128 7 Y 0 31 8
21
def Op 253 10 5 Y 0 31 8
22
def Msg_type 253 10 6 Y 0 31 8
23
def Msg_text 253 255 27 Y 0 31 8
24
Table Op Msg_type Msg_text
25
test.t1 check status Table is already up to date
26
check table t1 changed;
27
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
28
def Table 253 128 7 Y 0 31 8
29
def Op 253 10 5 Y 0 31 8
30
def Msg_type 253 10 6 Y 0 31 8
31
def Msg_text 253 255 2 Y 0 31 8
32
Table Op Msg_type Msg_text
33
test.t1 check status OK
34
insert into t1 values (5,5,5);
35
check table t1 changed;
36
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
37
def Table 253 128 7 Y 0 31 8
38
def Op 253 10 5 Y 0 31 8
39
def Msg_type 253 10 6 Y 0 31 8
40
def Msg_text 253 255 2 Y 0 31 8
41
Table Op Msg_type Msg_text
42
test.t1 check status OK
43
check table t1 medium;
44
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
45
def Table 253 128 7 Y 0 31 8
46
def Op 253 10 5 Y 0 31 8
47
def Msg_type 253 10 6 Y 0 31 8
48
def Msg_text 253 255 2 Y 0 31 8
49
Table Op Msg_type Msg_text
50
test.t1 check status OK
51
check table t1 extended;
52
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
53
def Table 253 128 7 Y 0 31 8
54
def Op 253 10 5 Y 0 31 8
55
def Msg_type 253 10 6 Y 0 31 8
56
def Msg_text 253 255 2 Y 0 31 8
57
Table Op Msg_type Msg_text
58
test.t1 check status OK
60
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
61
def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
62
def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
63
def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
64
def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
65
def STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8
66
def STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
67
def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
68
def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
69
def STATISTICS PACKED Packed 253 10 0 Y 0 0 8
70
def STATISTICS NULLABLE Null 253 3 0 N 1 0 8
71
def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
72
def STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
73
def STATISTICS INDEX_COMMENT Index_Comment 253 1024 0 N 1 0 8
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 1 NULL NULL BTREE
77
t1 1 b 2 c A 5 NULL NULL BTREE
78
insert into t1 values (5,5,5);
79
ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
80
-- Here we enable metadata just to check that the collation of the
81
-- resultset is non-binary for string type. This should be changed
82
-- after Bug#29394 is implemented.
84
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
85
def Table 253 128 7 Y 0 31 8
86
def Op 253 10 8 Y 0 31 8
87
def Msg_type 253 10 6 Y 0 31 8
88
def Msg_text 253 255 2 Y 0 31 8
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 Table is already up to date
95
-- Here we enable metadata just to check that the collation of the
96
-- resultset is non-binary for string type. This should be changed
97
-- after Bug#29394 is implemented.
98
show variables like "wait_timeout%";
99
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
100
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
101
def VARIABLES VARIABLE_VALUE Value 253 16300 5 Y 0 0 8
104
show variables like "WAIT_timeout%";
105
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
106
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
107
def VARIABLES VARIABLE_VALUE Value 253 16300 5 Y 0 0 8
110
show variables like "this_doesn't_exists%";
111
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
112
def VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
113
def VARIABLES VARIABLE_VALUE Value 253 16300 0 Y 0 0 8
115
show table status from test like "this_doesn't_exists%";
116
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
117
def TABLES TABLE_NAME Name 253 64 0 N 1 0 8
118
def TABLES ENGINE Engine 253 64 0 Y 0 0 8
119
def TABLES VERSION Version 8 21 0 Y 32800 0 63
120
def TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
121
def TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
122
def TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
123
def TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
124
def TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63
125
def TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63
126
def TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63
127
def TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
128
def TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
129
def TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
130
def TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
131
def TABLES TABLE_COLLATION Collation 253 64 0 Y 0 0 8
132
def TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
133
def TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
134
def TABLES TABLE_COMMENT Comment 253 2048 0 N 1 0 8
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
137
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
138
def SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
143
show databases like "test%";
144
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
145
def SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8
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));
149
insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0),(1,3,1,0),(1,3,2,0),(1,3,3,0),(1,1,1,1),(1,1,2,1),(1,1,3,1),(1,2,1,1),(1,2,2,1),(1,2,3,1),(1,3,1,1),(1,3,2,1),(1,3,3,1);
150
-- Here we enable metadata just to check that the collation of the
151
-- resultset is non-binary for string type. This should be changed
152
-- after Bug#29394 is implemented.
154
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
155
def Table 253 128 7 Y 0 31 8
156
def Op 253 10 7 Y 0 31 8
157
def Msg_type 253 10 6 Y 0 31 8
158
def Msg_text 253 255 2 Y 0 31 8
159
Table Op Msg_type Msg_text
160
test.t1 analyze status OK
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 1 NULL NULL BTREE
164
t1 0 PRIMARY 2 f2 A 3 NULL NULL BTREE
165
t1 0 PRIMARY 3 f3 A 9 NULL NULL BTREE
166
t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE
167
-- Here we enable metadata just to check that the collation of the
168
-- resultset is non-binary for string type. This should be changed
169
-- after Bug#29394 is implemented.
171
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
172
def Table 253 128 7 Y 0 31 8
173
def Op 253 10 6 Y 0 31 8
174
def Msg_type 253 10 6 Y 0 31 8
175
def Msg_text 253 255 2 Y 0 31 8
176
Table Op Msg_type Msg_text
177
test.t1 repair status OK
179
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
180
t1 0 PRIMARY 1 f1 A 1 NULL NULL BTREE
181
t1 0 PRIMARY 2 f2 A 3 NULL NULL BTREE
182
t1 0 PRIMARY 3 f3 A 9 NULL NULL BTREE
183
t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE
185
create temporary table t1 (a int not null);
186
show create table t1;
188
t1 CREATE TEMPORARY TABLE "t1" (
190
) ENGINE=MyISAM DEFAULT CHARSET=latin1
191
alter table t1 rename t2;
192
show create table t2;
194
t2 CREATE TEMPORARY TABLE "t2" (
196
) ENGINE=MyISAM DEFAULT CHARSET=latin1
199
test_set set( 'val1', 'val2', 'val3' ) not null default '',
200
name char(20) default 'O''Brien' comment 'O''Brien as default',
201
c int not null comment 'int column',
202
`c-b` int comment 'name with a minus',
203
`space 2` int comment 'name with a space'
204
) comment = 'it\'s a table' ;
205
show create table t1;
207
t1 CREATE TABLE "t1" (
208
"test_set" set('val1','val2','val3') NOT NULL,
209
"name" char(20) COMMENT 'O''Brien as default',
210
"c" int(11) NOT NULL COMMENT 'int column',
211
"c-b" int(11) COMMENT 'name with a minus',
212
"space 2" int(11) COMMENT 'name with a space'
213
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
214
set sql_quote_show_create=0;
215
show create table t1;
218
test_set set('val1','val2','val3') NOT NULL,
219
"name" char(20) COMMENT 'O''Brien as default',
220
c int(11) NOT NULL COMMENT 'int column',
221
"c-b" int(11) COMMENT 'name with a minus',
222
"space 2" int(11) COMMENT 'name with a space'
223
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
224
set sql_quote_show_create=1;
225
show full columns from t1;
226
Field Type Collation Null Key Default Extra Privileges Comment
227
test_set set('val1','val2','val3') latin1_swedish_ci NO NULL
228
name char(20) latin1_swedish_ci YES NULL O'Brien as default
229
c int(11) NULL NO NULL int column
230
c-b int(11) NULL YES NULL name with a minus
231
space 2 int(11) NULL YES NULL name with a space
233
create table t1 (a int not null, unique aa (a));
234
show create table t1;
236
t1 CREATE TABLE "t1" (
237
"a" int(11) NOT NULL,
238
UNIQUE KEY "aa" ("a")
239
) ENGINE=MyISAM DEFAULT CHARSET=latin1
241
create table t1 (a int not null, primary key (a));
242
show create table t1;
244
t1 CREATE TABLE "t1" (
245
"a" int(11) NOT NULL,
247
) ENGINE=MyISAM DEFAULT CHARSET=latin1
251
Database Table In_use Name_locked
252
mysql general_log 0 0
253
create table t1(n int);
254
insert into t1 values (1);
256
Database Table In_use Name_locked
258
mysql general_log 0 0
260
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
261
show create table t1;
263
t1 CREATE TABLE "t1" (
264
"a" int(11) NOT NULL,
267
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
268
alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0;
269
show create table t1;
271
t1 CREATE TABLE "t1" (
272
"a" int(11) NOT NULL,
275
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test'
276
ALTER TABLE t1 AVG_ROW_LENGTH=0 CHECKSUM=0 COMMENT="" MIN_ROWS=0 MAX_ROWS=0 PACK_KEYS=DEFAULT DELAY_KEY_WRITE=0 ROW_FORMAT=default;
277
show create table t1;
279
t1 CREATE TABLE "t1" (
280
"a" int(11) NOT NULL,
283
) ENGINE=MyISAM DEFAULT CHARSET=latin1
285
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));
286
show columns from t1;
287
Field Type Null Key Default Extra
288
a decimal(9,2) YES NULL
289
b decimal(9,0) YES NULL
290
e double(9,2) YES NULL
291
f double(5,0) YES NULL
292
h float(3,2) YES NULL
293
i float(3,0) YES NULL
294
show full columns from t1;
295
Field Type Collation Null Key Default Extra Privileges Comment
296
a decimal(9,2) NULL YES NULL
297
b decimal(9,0) NULL YES NULL
298
e double(9,2) NULL YES NULL
299
f double(5,0) NULL YES NULL
300
h float(3,2) NULL YES NULL
301
i float(3,0) NULL YES NULL
304
type_bool bool not null default 0,
305
type_tiny tinyint not null auto_increment primary key,
306
type_short smallint(3),
307
type_mediumint mediumint,
309
type_decimal decimal(5,2),
310
type_numeric numeric(5,2),
313
type_varchar varchar(10),
314
type_timestamp timestamp not null,
315
type_date date not null default '0000-00-00',
316
type_time time not null default '00:00:00',
317
type_datetime datetime not null default '0000-00-00 00:00:00',
319
type_enum enum ('red', 'green', 'blue'),
320
type_set enum ('red', 'green', 'blue'),
321
type_tinyblob tinyblob,
323
type_medium_blob mediumblob,
324
type_long_blob longblob,
326
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
327
show create table t1;
329
t1 CREATE TABLE "t1" (
330
"type_bool" tinyint(1) NOT NULL,
331
"type_tiny" tinyint(4) NOT NULL AUTO_INCREMENT,
332
"type_short" smallint(3),
333
"type_mediumint" mediumint(9),
334
"type_bigint" bigint(20),
335
"type_decimal" decimal(5,2),
336
"type_numeric" decimal(5,2),
337
"empty_char" char(0),
339
"type_varchar" varchar(10),
340
"type_timestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
341
"type_date" date NOT NULL,
342
"type_time" time NOT NULL,
343
"type_datetime" datetime NOT NULL,
345
"type_enum" enum('red','green','blue'),
346
"type_set" enum('red','green','blue'),
347
"type_tinyblob" tinyblob,
349
"type_medium_blob" mediumblob,
350
"type_long_blob" longblob,
351
PRIMARY KEY ("type_tiny"),
352
KEY "type_short" ("type_short")
353
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
354
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
356
type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob
357
0 1 NULL NULL NULL NULL NULL NULL NULL NULL 2003-02-07 10:00:01 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL
359
create table t1 (a int not null);
360
create table t2 select max(a) from t1;
361
show columns from t2;
362
Field Type Null Key Default Extra
363
max(a) int(11) YES NULL
365
create table t1 (c decimal, d double, f float, r real);
366
show columns from t1;
367
Field Type Null Key Default Extra
368
c decimal(10,0) YES NULL
373
create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
374
show columns from t1;
375
Field Type Null Key Default Extra
376
c decimal(3,3) YES NULL
377
d double(3,3) YES NULL
378
f float(3,3) YES NULL
380
CREATE TABLE ```ab``cd``` (i INT);
381
SHOW CREATE TABLE ```ab``cd```;
383
`ab`cd` CREATE TABLE "`ab`cd`" (
385
) ENGINE=MyISAM DEFAULT CHARSET=latin1
386
DROP TABLE ```ab``cd```;
387
CREATE TABLE ```ab````cd``` (i INT);
388
SHOW CREATE TABLE ```ab````cd```;
390
`ab``cd` CREATE TABLE "`ab``cd`" (
392
) ENGINE=MyISAM DEFAULT CHARSET=latin1
393
DROP TABLE ```ab````cd```;
394
CREATE TABLE ```a` (i INT);
395
SHOW CREATE TABLE ```a`;
397
`a CREATE TABLE "`a" (
399
) ENGINE=MyISAM DEFAULT CHARSET=latin1
401
CREATE TABLE `a.1` (i INT);
402
SHOW CREATE TABLE `a.1`;
404
a.1 CREATE TABLE "a.1" (
406
) ENGINE=MyISAM DEFAULT CHARSET=latin1
408
select @@max_heap_table_size;
409
@@max_heap_table_size
412
a int(11) default NULL,
413
KEY a USING BTREE (a)
416
b int(11) default NULL,
420
a int(11) default NULL,
421
b int(11) default NULL,
422
KEY a USING BTREE (a),
425
insert into t1 values (1),(2);
426
insert into t2 values (1),(2);
427
insert into t3 values (1,1),(2,2);
429
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
430
t1 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
431
t2 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
432
t3 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
433
insert into t1 values (3),(4);
434
insert into t2 values (3),(4);
435
insert into t3 values (3,3),(4,4);
437
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
438
t1 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
439
t2 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
440
t3 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
441
insert into t1 values (5);
442
insert into t2 values (5);
443
insert into t3 values (5,5);
445
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
446
t1 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
447
t2 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
448
t3 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
449
delete from t1 where a=3;
450
delete from t2 where b=3;
451
delete from t3 where a=3;
453
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
454
t1 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
455
t2 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
456
t3 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
461
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
462
t1 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
463
t2 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
464
t3 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
465
insert into t1 values (5);
466
insert into t2 values (5);
467
insert into t3 values (5,5);
469
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
470
t1 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
471
t2 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
472
t3 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
473
delete from t1 where a=5;
474
delete from t2 where b=5;
475
delete from t3 where a=5;
477
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
478
t1 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
479
t2 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
480
t3 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
481
drop table t1, t2, t3;
482
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
483
SHOW CREATE TABLE t1;
485
t1 CREATE TABLE "t1" (
488
) ENGINE=MEMORY DEFAULT CHARSET=latin1
490
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
491
SHOW CREATE TABLE t1;
493
t1 CREATE TABLE "t1" (
495
KEY "i" ("i") USING HASH
496
) ENGINE=MEMORY DEFAULT CHARSET=latin1
498
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
499
SHOW CREATE TABLE t1;
501
t1 CREATE TABLE "t1" (
503
KEY "i" ("i") USING BTREE
504
) ENGINE=MEMORY DEFAULT CHARSET=latin1
506
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
507
SHOW CREATE TABLE t1;
509
t1 CREATE TABLE "t1" (
512
) ENGINE=MyISAM DEFAULT CHARSET=latin1
514
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
515
SHOW CREATE TABLE t1;
517
t1 CREATE TABLE "t1" (
519
KEY "i" ("i") USING BTREE
520
) ENGINE=MyISAM DEFAULT CHARSET=latin1
522
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
523
SHOW CREATE TABLE t1;
525
t1 CREATE TABLE "t1" (
528
) ENGINE=MyISAM DEFAULT CHARSET=latin1
529
ALTER TABLE t1 ENGINE=MEMORY;
530
SHOW CREATE TABLE t1;
532
t1 CREATE TABLE "t1" (
535
) ENGINE=MEMORY DEFAULT CHARSET=latin1
537
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
538
SHOW CREATE TABLE t1;
540
t1 CREATE TABLE "t1" (
542
KEY "i" ("i") USING BTREE
543
) ENGINE=MyISAM DEFAULT CHARSET=latin1
544
ALTER TABLE t1 ENGINE=MEMORY;
545
SHOW CREATE TABLE t1;
547
t1 CREATE TABLE "t1" (
549
KEY "i" ("i") USING BTREE
550
) ENGINE=MEMORY DEFAULT CHARSET=latin1
553
field1 text NOT NULL,
554
PRIMARY KEY(field1(1000))
557
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
558
def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
559
def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
560
def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
561
def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
562
def STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 8
563
def STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
564
def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
565
def STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63
566
def STATISTICS PACKED Packed 253 10 0 Y 0 0 8
567
def STATISTICS NULLABLE Null 253 3 0 N 1 0 8
568
def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
569
def STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
570
def STATISTICS INDEX_COMMENT Index_Comment 253 1024 0 N 1 0 8
571
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
572
t1 0 PRIMARY 1 field1 A 0 1000 NULL BTREE
577
PRIMARY KEY USING HASH (c1),
578
INDEX USING BTREE(c2)
580
SHOW CREATE TABLE t1;
582
t1 CREATE TABLE "t1" (
583
"c1" int(11) NOT NULL,
584
"c2" int(11) NOT NULL,
585
PRIMARY KEY ("c1") USING HASH,
586
KEY "c2" ("c2") USING BTREE
587
) ENGINE=MyISAM DEFAULT CHARSET=latin1
590
SHOW TABLE STATUS like 't1';
591
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
592
t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
593
show create table t1;
594
ERROR HY000: Incorrect information in file: './test/t1.frm'
595
drop table if exists t1;
597
# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
599
DROP DATABASE IF EXISTS mysqltest1;
600
CREATE DATABASE mysqltest1;
603
CREATE TABLE t1(a INT);
604
CREATE TABLE t2(a INT);
613
SHOW OPEN TABLES FROM mysqltest1;
614
Database Table In_use Name_locked
618
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
619
Database Table In_use Name_locked
621
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
622
Database Table In_use Name_locked
625
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
626
Database Table In_use Name_locked
631
DROP DATABASE mysqltest1;
634
SHOW TABLES FROM non_existing_database;
635
ERROR 42000: Unknown database 'non_existing_database'
637
SHOW TABLES FROM no_such_database;
638
ERROR 42000: Unknown database 'no_such_database'
639
SHOW COLUMNS FROM no_such_table;
640
ERROR 42S02: Table 'test.no_such_table' doesn't exist
642
show variables like "log_queries_not_using_indexes";
644
log_queries_not_using_indexes ON
645
select 1 from information_schema.tables limit 1;
648
show status like 'slow_queries';
651
set global log_queries_not_using_indexes=OFF;
652
show variables like "log_queries_not_using_indexes";
654
log_queries_not_using_indexes OFF
655
select 1 from information_schema.tables limit 1;
658
show status like 'slow_queries';
661
set global log_queries_not_using_indexes=ON;
662
show variables like "log_queries_not_using_indexes";
664
log_queries_not_using_indexes ON
665
select 1 from information_schema.tables limit 1;
668
show status like 'slow_queries';
671
show variables like 'myisam_recover_options';
673
myisam_recover_options OFF
677
create database `mysqlttest\1`;
678
create table `mysqlttest\1`.`a\b` (a int);
679
show tables from `mysqlttest\1`;
680
Tables_in_mysqlttest\1
682
show fields from `mysqlttest\1`.`a\b`;
683
Field Type Null Key Default Extra
685
show columns from `a\b` from `mysqlttest\1`;
686
Field Type Null Key Default Extra
688
show keys from `mysqlttest\1`.`a\b`;
689
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
690
drop table `mysqlttest\1`.`a\b`;
691
drop database `mysqlttest\1`;
692
show engine foobar status;
693
ERROR 42000: Unknown table engine 'foobar'
694
show engine foobar logs;
695
ERROR 42000: Unknown table engine 'foobar'
696
show engine foobar mutex;
697
ERROR 42000: Unknown table engine 'foobar'
698
show engine mutex status;
699
ERROR 42000: Unknown table engine 'mutex'
700
show engine csv status;
702
show engine csv logs;
704
show engine csv mutex;
707
drop table if exists `été`;
708
create table `été` (field1 int);
710
Tables_in_test Table_type
714
show columns from `#mysql50#????????`;
715
Got one of the listed errors