~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/pbxt/show_check.result

Merge Stewart.

Show diffs side-by-side

added added

removed removed

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