~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/show_check.test

  • Committer: Monty Taylor
  • Date: 2009-04-25 19:24:49 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 1003.
  • Revision ID: mordred@inaugust.com-20090425192449-0htujbt2r9jzupn5
Moved heap.

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
 
90
105
  ) comment = 'it\'s a table' ;
91
106
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
92
107
show create table t1;
93
 
show columns from t1;
 
108
show full columns from t1;
94
109
drop table t1;
95
110
 
96
111
create table t1 (a int not null, unique aa (a));
102
117
show create table t1;
103
118
drop table t1;
104
119
 
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';
 
120
flush tables;
 
121
show open tables;
 
122
create table t1(n int);
 
123
insert into t1 values (1);
 
124
show open tables;
 
125
drop table t1;
 
126
 
 
127
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;
 
128
show create table t1;
 
129
alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0;
 
130
show create table t1;
 
131
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
132
show create table t1;
111
133
drop table t1;
112
134
 
113
135
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
136
show columns from t1;
115
 
show columns from t1;
 
137
show full columns from t1;
116
138
drop table t1;
117
139
 
118
140
#
119
141
# Do a create table that tries to cover all types and options
120
142
#
121
 
create temporary table t1 (
 
143
create table t1 (
122
144
type_int int,
123
145
type_bigint bigint,
124
146
type_decimal decimal(5,2),
133
155
type_set enum ('red', 'green', 'blue'),
134
156
type_blob blob,
135
157
index(type_int)
136
 
) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
 
158
) 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
159
 
138
160
# Not tested above: RAID_# UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
139
161
show create table t1;
185
207
 
186
208
 
187
209
#
188
 
# Test for bug #2719 "MEMORY tables status shows wrong or missing data."
 
210
# Test for bug #2719 "Heap tables status shows wrong or missing data."
189
211
#
190
212
 
191
213
select @@max_heap_table_size;
192
214
 
193
 
CREATE TEMPORARY TABLE t1 (
 
215
CREATE TABLE t1 (
194
216
 a int default NULL,
195
217
 KEY a USING BTREE (a)
196
 
) ENGINE=MEMORY;
 
218
) ENGINE=HEAP;
197
219
 
198
 
CREATE TEMPORARY TABLE t2 (
 
220
CREATE TABLE t2 (
199
221
 b int default NULL,
200
222
 index(b)
201
 
) ENGINE=MEMORY;
 
223
) ENGINE=HEAP;
202
224
 
203
 
CREATE TEMPORARY TABLE t3 (
 
225
CREATE TABLE t3 (
204
226
 a int default NULL,
205
227
 b int default NULL,
206
228
 KEY a USING BTREE (a),
207
229
 index(b)
208
 
) ENGINE=MEMORY;
 
230
) ENGINE=HEAP;
209
231
 
210
232
insert into t1 values (1),(2);
211
233
insert into t2 values (1),(2);
212
234
insert into t3 values (1,1),(2,2);
213
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
235
--replace_column 6 # 7 # 8 # 9 #
214
236
show table status;
215
237
insert into t1 values (3),(4);
216
238
insert into t2 values (3),(4);
217
239
insert into t3 values (3,3),(4,4);
218
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
240
--replace_column 6 # 7 # 8 # 9 #
219
241
show table status;
220
242
insert into t1 values (5);
221
243
insert into t2 values (5);
222
244
insert into t3 values (5,5);
223
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
245
--replace_column 6 # 7 # 8 # 9 #
224
246
show table status;
225
247
delete from t1 where a=3;
226
248
delete from t2 where b=3;
227
249
delete from t3 where a=3;
228
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
250
--replace_column 6 # 7 # 8 # 9 # 10 #
229
251
show table status;
230
252
truncate table t1;
231
253
truncate table t2;
232
254
truncate table t3;
233
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
255
--replace_column 6 # 7 # 8 # 9 #
234
256
show table status;
235
257
insert into t1 values (5);
236
258
insert into t2 values (5);
237
259
insert into t3 values (5,5);
238
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
260
--replace_column 6 # 7 # 8 # 9 #
239
261
show table status;
240
262
delete from t1 where a=5;
241
263
delete from t2 where b=5;
242
264
delete from t3 where a=5;
243
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
265
--replace_column 6 # 7 # 8 # 9 # 10 #
244
266
show table status;
245
267
 
246
268
drop table t1, t2, t3;
247
269
 
248
270
# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was
249
271
# 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;
 
272
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
 
273
SHOW CREATE TABLE t1;
 
274
DROP TABLE t1;
 
275
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
 
276
SHOW CREATE TABLE t1;
 
277
DROP TABLE t1;
 
278
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
 
279
SHOW CREATE TABLE t1;
 
280
DROP TABLE t1;
 
281
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
282
SHOW CREATE TABLE t1;
 
283
DROP TABLE t1;
 
284
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
263
285
SHOW CREATE TABLE t1;
264
286
DROP TABLE t1;
265
287
# Test that when an index is created with the default key algorithm and
266
288
# altered to another storage engine, it gets the default key algorithm
267
289
# for that storage engine, but when it is specified, the specified type is
268
290
# preserved.
269
 
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
291
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
270
292
SHOW CREATE TABLE t1;
271
293
ALTER TABLE t1 ENGINE=MEMORY;
272
294
SHOW CREATE TABLE t1;
273
295
DROP TABLE t1;
274
 
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
 
296
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
275
297
SHOW CREATE TABLE t1;
276
298
ALTER TABLE t1 ENGINE=MEMORY;
277
299
SHOW CREATE TABLE t1;
299
321
DROP TABLE t1;
300
322
 
301
323
#
 
324
# BUG 12183 -  SHOW OPEN TABLES behavior doesn't match grammar
 
325
# First we close all open tables with FLUSH tables and then we open some.
 
326
#
 
327
 
 
328
--echo
 
329
--echo # Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
 
330
--echo
 
331
 
 
332
# NOTE: SHOW OPEN TABLES does not sort result list by database or table names.
 
333
# Tables are listed in the order they were opened. We can not use the system
 
334
# database (mysql) for the test here, because we have no control over the order
 
335
# of opening tables in it. Consequently, we can not use 'SHOW OPEN TABLES'.
 
336
 
 
337
--disable_warnings
 
338
DROP DATABASE IF EXISTS mysqltest1;
 
339
--enable_warnings
 
340
 
 
341
CREATE DATABASE mysqltest1;
 
342
use mysqltest1;
 
343
 
 
344
--echo
 
345
 
 
346
CREATE TABLE t1(a INT);
 
347
CREATE TABLE t2(a INT);
 
348
 
 
349
--echo
 
350
 
 
351
--disable_ps_protocol
 
352
FLUSH TABLES;
 
353
 
 
354
--echo
 
355
 
 
356
SELECT 1 FROM t1;
 
357
SELECT 1 FROM t2;
 
358
 
 
359
--echo
 
360
 
 
361
SHOW OPEN TABLES FROM mysqltest1;
 
362
 
 
363
--echo
 
364
 
 
365
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
 
366
 
 
367
--echo
 
368
 
 
369
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
 
370
 
 
371
--echo
 
372
 
 
373
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
 
374
 
 
375
--echo
 
376
 
 
377
FLUSH TABLES;
 
378
--enable_ps_protocol
 
379
 
 
380
--echo
 
381
 
 
382
DROP DATABASE mysqltest1;
 
383
use test;
 
384
 
 
385
--echo
 
386
 
 
387
#
302
388
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
303
389
#
304
 
--error ER_BAD_DB_ERROR
 
390
--error 1049
305
391
SHOW TABLES FROM non_existing_database;
306
392
 
307
393
--echo End of 4.1 tests
336
422
drop database `mysqlttest\1`;
337
423
 
338
424
#
339
 
# Bug#25081 show TABLES on table with latin chars in name fails
 
425
# Bug#24392: SHOW ENGINE MUTEX STATUS is a synonym for SHOW INNODB STATUS
 
426
#
 
427
 
 
428
--error ER_UNKNOWN_STORAGE_ENGINE
 
429
show engine foobar status;
 
430
--error ER_UNKNOWN_STORAGE_ENGINE
 
431
show engine foobar logs;
 
432
--error ER_UNKNOWN_STORAGE_ENGINE
 
433
show engine foobar mutex;
 
434
 
 
435
--error ER_UNKNOWN_STORAGE_ENGINE
 
436
show engine mutex status;
 
437
 
 
438
show engine csv status;
 
439
 
 
440
#
 
441
# Bug#25081 SHOW FULL TABLES on table with latin chars in name fails
340
442
#
341
443
--disable_warnings
342
444
drop table if exists `été`;
343
445
--enable_warnings
344
446
create table `été` (field1 int);
345
 
show tables;
 
447
show full tables;
346
448
drop table `été`;
347
449
 
348
450
#