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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

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