~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/r/show_check.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
Import upstream version 2010.03.1347

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
-- 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.
 
10
check table t1;
 
11
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
12
def                                     Table   8       512     7       Y       0       31      45
 
13
def                                     Op      8       40      5       Y       0       31      45
 
14
def                                     Msg_type        8       40      6       Y       0       31      45
 
15
def                                     Msg_text        8       1020    2       Y       0       31      45
 
16
Table   Op      Msg_type        Msg_text
 
17
test.t1 check   status  OK
 
18
insert into t1 values (5,5,5);
 
19
check table t1;
 
20
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
21
def                                     Table   8       512     7       Y       0       31      45
 
22
def                                     Op      8       40      5       Y       0       31      45
 
23
def                                     Msg_type        8       40      6       Y       0       31      45
 
24
def                                     Msg_text        8       1020    2       Y       0       31      45
 
25
Table   Op      Msg_type        Msg_text
 
26
test.t1 check   status  OK
 
27
show index from t1;
 
28
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       256     2       N       1       0       45
 
30
def     data_dictionary show_indexes    show_indexes    Unique  Unique  8       20      5       N       1       0       45
 
31
def     data_dictionary show_indexes    show_indexes    Key_name        Key_name        8       256     7       N       1       0       45
 
32
def     data_dictionary show_indexes    show_indexes    Seq_in_index    Seq_in_index    5       20      1       N       32769   0       63
 
33
def     data_dictionary show_indexes    show_indexes    Column_name     Column_name     8       256     1       N       1       0       45
 
34
Table   Unique  Key_name        Seq_in_index    Column_name
 
35
t1      TRUE    PRIMARY 1       a
 
36
t1      FALSE   b       1       b
 
37
t1      FALSE   b       2       c
 
38
insert into t1 values (5,5,5);
 
39
ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
 
40
-- Here we enable metadata just to check that the collation of the
 
41
-- resultset is non-binary for string type. This should be changed
 
42
-- after Bug#29394 is implemented.
 
43
alter table t1 engine="default";
 
44
alter table t1 engine="default";
 
45
drop table t1;
 
46
-- Here we enable metadata just to check that the collation of the
 
47
-- resultset is non-binary for string type. This should be changed
 
48
-- after Bug#29394 is implemented.
 
49
show variables like "server_id%";
 
50
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       256     9       N       1       0       45
 
52
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_VALUE  Value   8       4096    1       N       1       0       45
 
53
Variable_name   Value
 
54
server_id       1
 
55
show variables like "SERVER_id%";
 
56
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       256     9       N       1       0       45
 
58
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_VALUE  Value   8       4096    1       N       1       0       45
 
59
Variable_name   Value
 
60
server_id       1
 
61
show variables like "this_doesn't_exists%";
 
62
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       256     0       N       1       0       45
 
64
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_VALUE  Value   8       4096    0       N       1       0       45
 
65
Variable_name   Value
 
66
show table status from test like "this_doesn't_exists%";
 
67
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       20      0       N       32769   0       63
 
69
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Schema  Schema  8       256     0       N       1       0       45
 
70
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Name    Name    8       256     0       N       1       0       45
 
71
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Type    Type    8       256     0       N       1       0       45
 
72
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Engine  Engine  8       256     0       N       1       0       45
 
73
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Version Version 8       256     0       N       1       0       45
 
74
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Rows    Rows    8       256     0       N       1       0       45
 
75
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Avg_row_length  Avg_row_length  8       256     0       N       1       0       45
 
76
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Table_size      Table_size      8       256     0       N       1       0       45
 
77
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Auto_increment  Auto_increment  8       256     0       N       1       0       45
 
78
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
79
show databases;
 
80
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
81
def     data_dictionary schema_names    SCHEMA_NAMES    SCHEMA_NAME     Database        8       256     18      N       1       0       45
 
82
Database
 
83
data_dictionary
 
84
information_schema
 
85
mysql
 
86
test
 
87
show databases like "test%";
 
88
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
89
def     data_dictionary schema_names    SCHEMA_NAMES    SCHEMA_NAME     Database (test%)        8       256     4       N       1       0       45
 
90
Database (test%)
 
91
test
 
92
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));
 
93
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);
 
94
-- Here we enable metadata just to check that the collation of the
 
95
-- resultset is non-binary for string type. This should be changed
 
96
-- after Bug#29394 is implemented.
 
97
analyze table t1;
 
98
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
99
def                                     Table   8       512     7       Y       0       31      45
 
100
def                                     Op      8       40      7       Y       0       31      45
 
101
def                                     Msg_type        8       40      6       Y       0       31      45
 
102
def                                     Msg_text        8       1020    2       Y       0       31      45
 
103
Table   Op      Msg_type        Msg_text
 
104
test.t1 analyze status  OK
 
105
show index from t1;
 
106
Table   Unique  Key_name        Seq_in_index    Column_name
 
107
t1      TRUE    PRIMARY 1       f1
 
108
t1      TRUE    PRIMARY 2       f2
 
109
t1      TRUE    PRIMARY 3       f3
 
110
t1      TRUE    PRIMARY 4       f4
 
111
show index from t1;
 
112
Table   Unique  Key_name        Seq_in_index    Column_name
 
113
t1      TRUE    PRIMARY 1       f1
 
114
t1      TRUE    PRIMARY 2       f2
 
115
t1      TRUE    PRIMARY 3       f3
 
116
t1      TRUE    PRIMARY 4       f4
 
117
drop table t1;
 
118
create temporary table t1 (a int not null);
 
119
show create table t1;
 
120
Table   Create Table
 
121
t1      CREATE TEMPORARY TABLE `t1` (
 
122
  `a` int NOT NULL
 
123
) ENGINE=DEFAULT
 
124
alter table t1 rename t2;
 
125
show create table t2;
 
126
Table   Create Table
 
127
t2      CREATE TEMPORARY TABLE `t2` (
 
128
  `a` int NOT NULL
 
129
) ENGINE=DEFAULT
 
130
drop table t2;
 
131
create table t1 (
 
132
name char(20) default 'O''Brien' comment 'O''Brien as default',
 
133
c int not null comment 'int column',
 
134
`c-b` int comment 'name with a minus',
 
135
`space 2` int comment 'name with a space'
 
136
  ) comment = 'it\'s a table' ;
 
137
show create table t1;
 
138
Table   Create Table
 
139
t1      CREATE TABLE `t1` (
 
140
  `name` varchar(20) 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'
 
145
show columns from t1;
 
146
Field   Type    Null    Default Default_is_NULL On_Update
 
147
name    VARCHAR TRUE    O'Brien FALSE   
 
148
c       INTEGER FALSE   O'Brien FALSE   
 
149
c-b     INTEGER TRUE    O'Brien TRUE    
 
150
space 2 INTEGER TRUE    O'Brien TRUE    
 
151
drop table t1;
 
152
create table t1 (a int not null, unique aa (a));
 
153
show create table t1;
 
154
Table   Create Table
 
155
t1      CREATE TABLE `t1` (
 
156
  `a` int NOT NULL,
 
157
  UNIQUE KEY `aa` (`a`)
 
158
) ENGINE=DEFAULT
 
159
drop table t1;
 
160
create table t1 (a int not null, primary key (a));
 
161
show create table t1;
 
162
Table   Create Table
 
163
t1      CREATE TABLE `t1` (
 
164
  `a` int NOT NULL,
 
165
  PRIMARY KEY (`a`)
 
166
) ENGINE=DEFAULT
 
167
drop table t1;
 
168
create temporary table t1 (a int not null, b VARCHAR(10), INDEX (b) ) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
 
169
show create table t1;
 
170
Table   Create Table
 
171
t1      CREATE TEMPORARY TABLE `t1` (
 
172
  `a` int NOT NULL,
 
173
  `b` varchar(10) DEFAULT NULL,
 
174
  KEY `b` (`b`)
 
175
) ENGINE=MyISAM ROW_FORMAT=FIXED COMMENT='test'
 
176
alter table t1 ROW_FORMAT=dynamic;
 
177
show create table t1;
 
178
Table   Create Table
 
179
t1      CREATE TEMPORARY TABLE `t1` (
 
180
  `a` int NOT NULL,
 
181
  `b` varchar(10) DEFAULT NULL,
 
182
  KEY `b` (`b`)
 
183
) ENGINE=MyISAM ROW_FORMAT=DYNAMIC COMMENT='test'
 
184
ALTER TABLE t1 COMMENT="" ROW_FORMAT=default;
 
185
show create table t1;
 
186
Table   Create Table
 
187
t1      CREATE TEMPORARY TABLE `t1` (
 
188
  `a` int NOT NULL,
 
189
  `b` varchar(10) DEFAULT NULL,
 
190
  KEY `b` (`b`)
 
191
) ENGINE=MyISAM
 
192
drop table t1;
 
193
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
show columns from t1;
 
195
Field   Type    Null    Default Default_is_NULL On_Update
 
196
a       DECIMAL TRUE            TRUE    
 
197
b       DECIMAL TRUE            TRUE    
 
198
e       DOUBLE  TRUE            TRUE    
 
199
f       DOUBLE  TRUE            TRUE    
 
200
h       DOUBLE  TRUE            TRUE    
 
201
i       DOUBLE  TRUE            TRUE    
 
202
show columns from t1;
 
203
Field   Type    Null    Default Default_is_NULL On_Update
 
204
a       DECIMAL TRUE            TRUE    
 
205
b       DECIMAL TRUE            TRUE    
 
206
e       DOUBLE  TRUE            TRUE    
 
207
f       DOUBLE  TRUE            TRUE    
 
208
h       DOUBLE  TRUE            TRUE    
 
209
i       DOUBLE  TRUE            TRUE    
 
210
drop table t1;
 
211
create temporary table t1 (
 
212
type_int int,
 
213
type_bigint bigint,
 
214
type_decimal decimal(5,2),
 
215
type_numeric numeric(5,2),
 
216
empty_char char(0),
 
217
type_char char(2),
 
218
type_varchar varchar(10),
 
219
type_timestamp timestamp not null,
 
220
type_date date,
 
221
type_datetime datetime,
 
222
type_enum enum ('red', 'green', 'blue'),
 
223
type_set enum ('red', 'green', 'blue'),
 
224
type_blob blob,
 
225
index(type_int)
 
226
) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
 
227
show create table t1;
 
228
Table   Create Table
 
229
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) DEFAULT NULL,
 
235
  `type_char` varchar(2) DEFAULT NULL,
 
236
  `type_varchar` varchar(10) 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,
 
242
  `type_blob` blob,
 
243
  KEY `type_int` (`type_int`)
 
244
) ENGINE=MyISAM ROW_FORMAT=FIXED COMMENT='test'
 
245
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
 
246
select * from t1;
 
247
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
 
248
NULL    NULL    NULL    NULL    NULL    NULL    NULL    2003-02-07 10:00:01     NULL    NULL    NULL    NULL    NULL
 
249
drop table t1;
 
250
create table t1 (a int not null);
 
251
create table t2 select max(a) from t1;
 
252
show columns from t2;
 
253
Field   Type    Null    Default Default_is_NULL On_Update
 
254
max(a)  INTEGER TRUE            TRUE    
 
255
drop table t1,t2;
 
256
create table t1 (c decimal, d double, f float, r real);
 
257
show columns from t1;
 
258
Field   Type    Null    Default Default_is_NULL On_Update
 
259
c       DECIMAL TRUE            TRUE    
 
260
d       DOUBLE  TRUE            TRUE    
 
261
f       DOUBLE  TRUE            TRUE    
 
262
r       DOUBLE  TRUE            TRUE    
 
263
drop table t1;
 
264
create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
 
265
show columns from t1;
 
266
Field   Type    Null    Default Default_is_NULL On_Update
 
267
c       DECIMAL TRUE            TRUE    
 
268
d       DOUBLE  TRUE            TRUE    
 
269
f       DOUBLE  TRUE            TRUE    
 
270
drop table t1;
 
271
CREATE TABLE ```ab``cd``` (i INT);
 
272
SHOW CREATE TABLE ```ab``cd```;
 
273
Table   Create Table
 
274
`ab`cd` CREATE TABLE ```ab``cd``` (
 
275
  `i` int DEFAULT NULL
 
276
) ENGINE=DEFAULT
 
277
DROP TABLE ```ab``cd```;
 
278
CREATE TABLE ```ab````cd``` (i INT);
 
279
SHOW CREATE TABLE ```ab````cd```;
 
280
Table   Create Table
 
281
`ab``cd`        CREATE TABLE ```ab````cd``` (
 
282
  `i` int DEFAULT NULL
 
283
) ENGINE=DEFAULT
 
284
DROP TABLE ```ab````cd```;
 
285
CREATE TABLE ```a` (i INT);
 
286
SHOW CREATE TABLE ```a`;
 
287
Table   Create Table
 
288
`a      CREATE TABLE ```a` (
 
289
  `i` int DEFAULT NULL
 
290
) ENGINE=DEFAULT
 
291
DROP TABLE ```a`;
 
292
CREATE TABLE `a.1` (i INT);
 
293
SHOW CREATE TABLE `a.1`;
 
294
Table   Create Table
 
295
a.1     CREATE TABLE `a.1` (
 
296
  `i` int DEFAULT NULL
 
297
) ENGINE=DEFAULT
 
298
DROP TABLE `a.1`;
 
299
select @@max_heap_table_size;
 
300
@@max_heap_table_size
 
301
1048576
 
302
CREATE TEMPORARY TABLE t1 (
 
303
a int default NULL,
 
304
KEY a USING BTREE (a)
 
305
) ENGINE=MEMORY;
 
306
CREATE TEMPORARY TABLE t2 (
 
307
b int default NULL,
 
308
index(b)
 
309
) ENGINE=MEMORY;
 
310
CREATE TEMPORARY TABLE t3 (
 
311
a int default NULL,
 
312
b int default NULL,
 
313
KEY a USING BTREE (a),
 
314
index(b)
 
315
) ENGINE=MEMORY;
 
316
insert into t1 values (1),(2);
 
317
insert into t2 values (1),(2);
 
318
insert into t3 values (1,1),(2,2);
 
319
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  #       #       #       #       #
 
324
insert into t1 values (3),(4);
 
325
insert into t2 values (3),(4);
 
326
insert into t3 values (3,3),(4,4);
 
327
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  #       #       #       #       #
 
332
insert into t1 values (5);
 
333
insert into t2 values (5);
 
334
insert into t3 values (5,5);
 
335
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  #       #       #       #       #
 
340
delete from t1 where a=3;
 
341
delete from t2 where b=3;
 
342
delete from t3 where a=3;
 
343
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  #       #       #       #       #
 
348
truncate table t1;
 
349
truncate table t2;
 
350
truncate table t3;
 
351
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  #       #       #       #       #
 
356
insert into t1 values (5);
 
357
insert into t2 values (5);
 
358
insert into t3 values (5,5);
 
359
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  #       #       #       #       #
 
364
delete from t1 where a=5;
 
365
delete from t2 where b=5;
 
366
delete from t3 where a=5;
 
367
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  #       #       #       #       #
 
372
drop table t1, t2, t3;
 
373
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
 
374
SHOW CREATE TABLE t1;
 
375
Table   Create Table
 
376
t1      CREATE TEMPORARY TABLE `t1` (
 
377
  `i` int DEFAULT NULL,
 
378
  KEY `i` (`i`)
 
379
) ENGINE=MEMORY
 
380
DROP TABLE t1;
 
381
CREATE TEMPORARY TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
 
382
SHOW CREATE TABLE t1;
 
383
Table   Create Table
 
384
t1      CREATE TEMPORARY TABLE `t1` (
 
385
  `i` int DEFAULT NULL,
 
386
  KEY `i` (`i`) USING HASH
 
387
) ENGINE=MEMORY
 
388
DROP TABLE t1;
 
389
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
 
390
SHOW CREATE TABLE t1;
 
391
Table   Create Table
 
392
t1      CREATE TEMPORARY TABLE `t1` (
 
393
  `i` int DEFAULT NULL,
 
394
  KEY `i` (`i`) USING BTREE
 
395
) ENGINE=MEMORY
 
396
DROP TABLE t1;
 
397
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
398
SHOW CREATE TABLE t1;
 
399
Table   Create Table
 
400
t1      CREATE TEMPORARY TABLE `t1` (
 
401
  `i` int DEFAULT NULL,
 
402
  KEY `i` (`i`)
 
403
) ENGINE=MyISAM
 
404
DROP TABLE t1;
 
405
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
 
406
SHOW CREATE TABLE t1;
 
407
Table   Create Table
 
408
t1      CREATE TEMPORARY TABLE `t1` (
 
409
  `i` int DEFAULT NULL,
 
410
  KEY `i` (`i`) USING BTREE
 
411
) ENGINE=MyISAM
 
412
DROP TABLE t1;
 
413
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
414
SHOW CREATE TABLE t1;
 
415
Table   Create Table
 
416
t1      CREATE TEMPORARY TABLE `t1` (
 
417
  `i` int DEFAULT NULL,
 
418
  KEY `i` (`i`)
 
419
) ENGINE=MyISAM
 
420
ALTER TABLE t1 ENGINE=MEMORY;
 
421
SHOW CREATE TABLE t1;
 
422
Table   Create Table
 
423
t1      CREATE TEMPORARY TABLE `t1` (
 
424
  `i` int DEFAULT NULL,
 
425
  KEY `i` (`i`)
 
426
) ENGINE=MEMORY
 
427
DROP TABLE t1;
 
428
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
 
429
SHOW CREATE TABLE t1;
 
430
Table   Create Table
 
431
t1      CREATE TEMPORARY TABLE `t1` (
 
432
  `i` int DEFAULT NULL,
 
433
  KEY `i` (`i`) USING BTREE
 
434
) ENGINE=MyISAM
 
435
ALTER TABLE t1 ENGINE=MEMORY;
 
436
SHOW CREATE TABLE t1;
 
437
Table   Create Table
 
438
t1      CREATE TEMPORARY TABLE `t1` (
 
439
  `i` int DEFAULT NULL,
 
440
  KEY `i` (`i`) USING BTREE
 
441
) ENGINE=MEMORY
 
442
DROP TABLE t1;
 
443
CREATE TABLE t1(
 
444
field1 text NOT NULL,
 
445
PRIMARY KEY(field1(180))
 
446
);
 
447
show index from t1;
 
448
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       256     2       N       1       0       45
 
450
def     data_dictionary show_indexes    show_indexes    Unique  Unique  8       20      4       N       1       0       45
 
451
def     data_dictionary show_indexes    show_indexes    Key_name        Key_name        8       256     7       N       1       0       45
 
452
def     data_dictionary show_indexes    show_indexes    Seq_in_index    Seq_in_index    5       20      1       N       32769   0       63
 
453
def     data_dictionary show_indexes    show_indexes    Column_name     Column_name     8       256     6       N       1       0       45
 
454
Table   Unique  Key_name        Seq_in_index    Column_name
 
455
t1      TRUE    PRIMARY 1       field1
 
456
drop table t1;
 
457
create table t1 (
 
458
c1 int NOT NULL,
 
459
c2 int NOT NULL,
 
460
PRIMARY KEY USING HASH (c1),
 
461
INDEX USING BTREE(c2)
 
462
);
 
463
SHOW CREATE TABLE t1;
 
464
Table   Create Table
 
465
t1      CREATE TABLE `t1` (
 
466
  `c1` int NOT NULL,
 
467
  `c2` int NOT NULL,
 
468
  PRIMARY KEY (`c1`) USING HASH,
 
469
  KEY `c2` (`c2`) USING BTREE
 
470
) ENGINE=DEFAULT
 
471
DROP TABLE t1;
 
472
SHOW TABLES FROM non_existing_database;
 
473
ERROR 42000: Unknown database 'non_existing_database'
 
474
End of 4.1 tests
 
475
SHOW TABLES FROM no_such_database;
 
476
ERROR 42000: Unknown database 'no_such_database'
 
477
SHOW COLUMNS FROM no_such_table;
 
478
ERROR 42S02: Table 'test.no_such_table' doesn't exist
 
479
show variables like 'myisam_recover_options';
 
480
Variable_name   Value
 
481
End of 5.0 tests
 
482
create database `mysqlttest\1`;
 
483
create table `mysqlttest\1`.`a\b` (a int);
 
484
show tables from `mysqlttest\1`;
 
485
Tables_in_mysqlttest\1
 
486
a\b
 
487
show fields from `mysqlttest\1`.`a\b`;
 
488
Field   Type    Null    Default Default_is_NULL On_Update
 
489
a       INTEGER TRUE            TRUE    
 
490
show columns from `a\b` from `mysqlttest\1`;
 
491
Field   Type    Null    Default Default_is_NULL On_Update
 
492
a       INTEGER TRUE            TRUE    
 
493
show keys from `mysqlttest\1`.`a\b`;
 
494
Table   Unique  Key_name        Seq_in_index    Column_name
 
495
drop table `mysqlttest\1`.`a\b`;
 
496
drop database `mysqlttest\1`;
 
497
drop table if exists `été`;
 
498
create table `été` (field1 int);
 
499
show tables;
 
500
Tables_in_test
 
501
été
 
502
drop table `été`;
 
503
show columns from `#mysql50#????????`;
 
504
Got one of the listed errors
 
505
End of 5.1 tests