~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/show_check.test

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# check that CSV engine was compiled in, as the result of the test
 
2
# depends on the presence of the log tables (which are CSV-based).
 
3
--source include/have_csv.inc
 
4
 
1
5
#
2
6
# Test of some show commands
3
7
#
18
22
--echo -- after Bug#29394 is implemented.
19
23
 
20
24
--enable_metadata
21
 
check table t1;
 
25
check table t1 fast;
 
26
check table t1 fast;
 
27
check table t1 changed;
22
28
insert into t1 values (5,5,5);
23
 
check table t1;
 
29
check table t1 changed;
 
30
check table t1 medium;
 
31
check table t1 extended;
24
32
show index from t1;
25
33
--disable_metadata
26
34
--error ER_DUP_ENTRY
31
39
--echo -- after Bug#29394 is implemented.
32
40
 
33
41
--enable_metadata
34
 
alter table t1 engine="default";
 
42
optimize table t1;
35
43
--disable_metadata
36
 
alter table t1 engine="default";
 
44
optimize table t1;
37
45
drop table t1;
38
46
 
39
47
#show variables;
43
51
--echo -- after Bug#29394 is implemented.
44
52
 
45
53
--enable_metadata
46
 
show variables like "server_id%";
47
 
show variables like "SERVER_id%";
 
54
show variables like "wait_timeout%";
 
55
show variables like "WAIT_timeout%";
48
56
show variables like "this_doesn't_exists%";
49
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
50
57
show table status from test like "this_doesn't_exists%";
51
58
show databases;
52
59
show databases like "test%";
67
74
--disable_metadata
68
75
show index from t1;
69
76
 
 
77
--echo -- Here we enable metadata just to check that the collation of the
 
78
--echo -- resultset is non-binary for string type. This should be changed
 
79
--echo -- after Bug#29394 is implemented.
 
80
 
 
81
--enable_metadata
 
82
 
 
83
repair table t1;
 
84
--disable_metadata
70
85
show index from t1;
71
86
drop table t1;
72
87
 
75
90
#
76
91
 
77
92
create temporary table t1 (a int not null);
78
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
79
93
show create table t1;
80
94
alter table t1 rename t2;
81
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
82
95
show create table t2;
83
96
drop table t2;
84
97
 
88
101
  `c-b` int comment 'name with a minus',
89
102
  `space 2` int comment 'name with a space'
90
103
  ) comment = 'it\'s a table' ;
91
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
92
104
show create table t1;
93
 
show columns from t1;
 
105
show full columns from t1;
94
106
drop table t1;
95
107
 
96
108
create table t1 (a int not null, unique aa (a));
97
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
98
109
show create table t1;
99
110
drop table t1;
100
111
create table t1 (a int not null, primary key (a));
101
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
102
 
show create table t1;
103
 
drop table t1;
104
 
 
105
 
create temporary table t1 (a int not null, b VARCHAR(10), INDEX (b) ) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
106
 
show create table t1;
107
 
alter table t1 ROW_FORMAT=dynamic;
108
 
show create table t1;
109
 
ALTER TABLE t1 COMMENT="" ROW_FORMAT=default;
 
112
show create table t1;
 
113
drop table t1;
 
114
 
 
115
flush tables;
 
116
show open tables;
 
117
create table t1(n int);
 
118
insert into t1 values (1);
 
119
show open tables;
 
120
drop table t1;
 
121
 
 
122
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
 
123
show create table t1;
 
124
alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0;
 
125
show create table t1;
 
126
ALTER TABLE t1 AVG_ROW_LENGTH=0 CHECKSUM=0 COMMENT="" MIN_ROWS=0 MAX_ROWS=0 PACK_KEYS=DEFAULT DELAY_KEY_WRITE=0 ROW_FORMAT=default;
110
127
show create table t1;
111
128
drop table t1;
112
129
 
113
130
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));
114
131
show columns from t1;
115
 
show columns from t1;
 
132
show full columns from t1;
116
133
drop table t1;
117
134
 
118
135
#
119
136
# Do a create table that tries to cover all types and options
120
137
#
121
 
create temporary table t1 (
 
138
create table t1 (
122
139
type_int int,
123
140
type_bigint bigint,
124
141
type_decimal decimal(5,2),
127
144
type_char char(2),
128
145
type_varchar varchar(10),
129
146
type_timestamp timestamp not null,
130
 
type_date date,
131
 
type_datetime datetime,
 
147
type_date date not null default '0000-00-00',
 
148
type_time time not null default '00:00:00',
 
149
type_datetime datetime not null default '0000-00-00 00:00:00',
132
150
type_enum enum ('red', 'green', 'blue'),
133
151
type_set enum ('red', 'green', 'blue'),
134
152
type_blob blob,
135
153
index(type_int)
136
 
) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
 
154
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
137
155
 
138
156
# Not tested above: RAID_# UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
139
157
show create table t1;
164
182
#
165
183
 
166
184
CREATE TABLE ```ab``cd``` (i INT);
167
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
168
185
SHOW CREATE TABLE ```ab``cd```;
169
186
DROP TABLE ```ab``cd```;
170
187
 
171
188
CREATE TABLE ```ab````cd``` (i INT);
172
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
173
189
SHOW CREATE TABLE ```ab````cd```;
174
190
DROP TABLE ```ab````cd```;
175
191
 
176
192
CREATE TABLE ```a` (i INT);
177
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
178
193
SHOW CREATE TABLE ```a`;
179
194
DROP TABLE ```a`;
180
195
 
181
196
CREATE TABLE `a.1` (i INT);
182
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
183
197
SHOW CREATE TABLE `a.1`;
184
198
DROP TABLE `a.1`;
185
199
 
186
200
 
187
201
#
188
 
# Test for bug #2719 "MEMORY tables status shows wrong or missing data."
 
202
# Test for bug #2719 "Heap tables status shows wrong or missing data."
189
203
#
190
204
 
191
205
select @@max_heap_table_size;
192
206
 
193
 
CREATE TEMPORARY TABLE t1 (
 
207
CREATE TABLE t1 (
194
208
 a int default NULL,
195
209
 KEY a USING BTREE (a)
196
 
) ENGINE=MEMORY;
 
210
) ENGINE=HEAP;
197
211
 
198
 
CREATE TEMPORARY TABLE t2 (
 
212
CREATE TABLE t2 (
199
213
 b int default NULL,
200
214
 index(b)
201
 
) ENGINE=MEMORY;
 
215
) ENGINE=HEAP;
202
216
 
203
 
CREATE TEMPORARY TABLE t3 (
 
217
CREATE TABLE t3 (
204
218
 a int default NULL,
205
219
 b int default NULL,
206
220
 KEY a USING BTREE (a),
207
221
 index(b)
208
 
) ENGINE=MEMORY;
 
222
) ENGINE=HEAP;
209
223
 
210
224
insert into t1 values (1),(2);
211
225
insert into t2 values (1),(2);
212
226
insert into t3 values (1,1),(2,2);
213
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
227
--replace_column 6 # 7 # 8 # 9 #
214
228
show table status;
215
229
insert into t1 values (3),(4);
216
230
insert into t2 values (3),(4);
217
231
insert into t3 values (3,3),(4,4);
218
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
232
--replace_column 6 # 7 # 8 # 9 #
219
233
show table status;
220
234
insert into t1 values (5);
221
235
insert into t2 values (5);
222
236
insert into t3 values (5,5);
223
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
237
--replace_column 6 # 7 # 8 # 9 #
224
238
show table status;
225
239
delete from t1 where a=3;
226
240
delete from t2 where b=3;
227
241
delete from t3 where a=3;
228
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
242
--replace_column 6 # 7 # 8 # 9 # 10 #
229
243
show table status;
230
244
truncate table t1;
231
245
truncate table t2;
232
246
truncate table t3;
233
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
247
--replace_column 6 # 7 # 8 # 9 #
234
248
show table status;
235
249
insert into t1 values (5);
236
250
insert into t2 values (5);
237
251
insert into t3 values (5,5);
238
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
252
--replace_column 6 # 7 # 8 # 9 #
239
253
show table status;
240
254
delete from t1 where a=5;
241
255
delete from t2 where b=5;
242
256
delete from t3 where a=5;
243
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
257
--replace_column 6 # 7 # 8 # 9 # 10 #
244
258
show table status;
245
259
 
246
260
drop table t1, t2, t3;
247
261
 
248
262
# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was
249
263
# specified during table creation, but not otherwise. (Bug #7235)
250
 
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
251
 
SHOW CREATE TABLE t1;
252
 
DROP TABLE t1;
253
 
CREATE TEMPORARY TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
254
 
SHOW CREATE TABLE t1;
255
 
DROP TABLE t1;
256
 
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
257
 
SHOW CREATE TABLE t1;
258
 
DROP TABLE t1;
259
 
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
260
 
SHOW CREATE TABLE t1;
261
 
DROP TABLE t1;
262
 
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
 
264
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
 
265
SHOW CREATE TABLE t1;
 
266
DROP TABLE t1;
 
267
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
 
268
SHOW CREATE TABLE t1;
 
269
DROP TABLE t1;
 
270
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
 
271
SHOW CREATE TABLE t1;
 
272
DROP TABLE t1;
 
273
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
274
SHOW CREATE TABLE t1;
 
275
DROP TABLE t1;
 
276
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
263
277
SHOW CREATE TABLE t1;
264
278
DROP TABLE t1;
265
279
# Test that when an index is created with the default key algorithm and
266
280
# altered to another storage engine, it gets the default key algorithm
267
281
# for that storage engine, but when it is specified, the specified type is
268
282
# preserved.
269
 
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
283
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
270
284
SHOW CREATE TABLE t1;
271
285
ALTER TABLE t1 ENGINE=MEMORY;
272
286
SHOW CREATE TABLE t1;
273
287
DROP TABLE t1;
274
 
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
 
288
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
275
289
SHOW CREATE TABLE t1;
276
290
ALTER TABLE t1 ENGINE=MEMORY;
277
291
SHOW CREATE TABLE t1;
294
308
  PRIMARY KEY USING HASH (c1),
295
309
  INDEX USING BTREE(c2)
296
310
);
297
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
298
311
SHOW CREATE TABLE t1;
299
312
DROP TABLE t1;
300
313
 
301
314
#
 
315
# BUG 12183 -  SHOW OPEN TABLES behavior doesn't match grammar
 
316
# First we close all open tables with FLUSH tables and then we open some.
 
317
#
 
318
 
 
319
--echo
 
320
--echo # Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
 
321
--echo
 
322
 
 
323
# NOTE: SHOW OPEN TABLES does not sort result list by database or table names.
 
324
# Tables are listed in the order they were opened. We can not use the system
 
325
# database (mysql) for the test here, because we have no control over the order
 
326
# of opening tables in it. Consequently, we can not use 'SHOW OPEN TABLES'.
 
327
 
 
328
--disable_warnings
 
329
DROP DATABASE IF EXISTS mysqltest1;
 
330
--enable_warnings
 
331
 
 
332
CREATE DATABASE mysqltest1;
 
333
use mysqltest1;
 
334
 
 
335
--echo
 
336
 
 
337
CREATE TABLE t1(a INT);
 
338
CREATE TABLE t2(a INT);
 
339
 
 
340
--echo
 
341
 
 
342
--disable_ps_protocol
 
343
FLUSH TABLES;
 
344
 
 
345
--echo
 
346
 
 
347
SELECT 1 FROM t1;
 
348
SELECT 1 FROM t2;
 
349
 
 
350
--echo
 
351
 
 
352
SHOW OPEN TABLES FROM mysqltest1;
 
353
 
 
354
--echo
 
355
 
 
356
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
 
357
 
 
358
--echo
 
359
 
 
360
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
 
361
 
 
362
--echo
 
363
 
 
364
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
 
365
 
 
366
--echo
 
367
 
 
368
FLUSH TABLES;
 
369
--enable_ps_protocol
 
370
 
 
371
--echo
 
372
 
 
373
DROP DATABASE mysqltest1;
 
374
use test;
 
375
 
 
376
--echo
 
377
 
 
378
#
302
379
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
303
380
#
304
381
--error 1049
336
413
drop database `mysqlttest\1`;
337
414
 
338
415
#
339
 
# Bug#25081 show TABLES on table with latin chars in name fails
 
416
# Bug#24392: SHOW ENGINE MUTEX STATUS is a synonym for SHOW INNODB STATUS
 
417
#
 
418
 
 
419
--error ER_UNKNOWN_STORAGE_ENGINE
 
420
show engine foobar status;
 
421
--error ER_UNKNOWN_STORAGE_ENGINE
 
422
show engine foobar logs;
 
423
--error ER_UNKNOWN_STORAGE_ENGINE
 
424
show engine foobar mutex;
 
425
 
 
426
--error ER_UNKNOWN_STORAGE_ENGINE
 
427
show engine mutex status;
 
428
 
 
429
show engine csv status;
 
430
 
 
431
#
 
432
# Bug#25081 SHOW FULL TABLES on table with latin chars in name fails
340
433
#
341
434
--disable_warnings
342
435
drop table if exists `été`;
343
436
--enable_warnings
344
437
create table `été` (field1 int);
345
 
show tables;
 
438
show full tables;
346
439
drop table `été`;
347
440
 
348
441
#