~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/show_check.test

Style cleanup

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;
46
54
show variables like "server_id%";
47
55
show variables like "SERVER_id%";
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%";
90
97
  ) comment = 'it\'s a table' ;
91
98
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
92
99
show create table t1;
93
 
show columns from t1;
 
100
show full columns from t1;
94
101
drop table t1;
95
102
 
96
103
create table t1 (a int not null, unique aa (a));
102
109
show create table t1;
103
110
drop table t1;
104
111
 
 
112
flush tables;
 
113
show open tables;
 
114
create table t1(n int);
 
115
insert into t1 values (1);
 
116
show open tables;
 
117
drop table t1;
 
118
 
105
119
create temporary table t1 (a int not null, b VARCHAR(10), INDEX (b) ) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
106
120
show create table t1;
107
121
alter table t1 ROW_FORMAT=dynamic;
108
122
show create table t1;
109
 
ALTER TABLE t1 COMMENT="", ROW_FORMAT='default';
 
123
ALTER TABLE t1 COMMENT="" ROW_FORMAT=default;
110
124
show create table t1;
111
125
drop table t1;
112
126
 
113
127
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
128
show columns from t1;
115
 
show columns from t1;
 
129
show full columns from t1;
116
130
drop table t1;
117
131
 
118
132
#
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;
193
207
CREATE TEMPORARY TABLE t1 (
194
208
 a int default NULL,
195
209
 KEY a USING BTREE (a)
196
 
) ENGINE=MEMORY;
 
210
) ENGINE=HEAP;
197
211
 
198
212
CREATE TEMPORARY TABLE t2 (
199
213
 b int default NULL,
200
214
 index(b)
201
 
) ENGINE=MEMORY;
 
215
) ENGINE=HEAP;
202
216
 
203
217
CREATE TEMPORARY 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;
299
313
DROP TABLE t1;
300
314
 
301
315
#
 
316
# BUG 12183 -  SHOW OPEN TABLES behavior doesn't match grammar
 
317
# First we close all open tables with FLUSH tables and then we open some.
 
318
#
 
319
 
 
320
--echo
 
321
--echo # Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
 
322
--echo
 
323
 
 
324
# NOTE: SHOW OPEN TABLES does not sort result list by database or table names.
 
325
# Tables are listed in the order they were opened. We can not use the system
 
326
# database (mysql) for the test here, because we have no control over the order
 
327
# of opening tables in it. Consequently, we can not use 'SHOW OPEN TABLES'.
 
328
 
 
329
--disable_warnings
 
330
DROP DATABASE IF EXISTS mysqltest1;
 
331
--enable_warnings
 
332
 
 
333
CREATE DATABASE mysqltest1;
 
334
use mysqltest1;
 
335
 
 
336
--echo
 
337
 
 
338
CREATE TABLE t1(a INT);
 
339
CREATE TABLE t2(a INT);
 
340
 
 
341
--echo
 
342
 
 
343
--disable_ps_protocol
 
344
FLUSH TABLES;
 
345
 
 
346
--echo
 
347
 
 
348
SELECT 1 FROM t1;
 
349
SELECT 1 FROM t2;
 
350
 
 
351
--echo
 
352
 
 
353
SHOW OPEN TABLES FROM mysqltest1;
 
354
 
 
355
--echo
 
356
 
 
357
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
 
358
 
 
359
--echo
 
360
 
 
361
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
 
362
 
 
363
--echo
 
364
 
 
365
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
 
366
 
 
367
--echo
 
368
 
 
369
FLUSH TABLES;
 
370
--enable_ps_protocol
 
371
 
 
372
--echo
 
373
 
 
374
DROP DATABASE mysqltest1;
 
375
use test;
 
376
 
 
377
--echo
 
378
 
 
379
#
302
380
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
303
381
#
304
 
--error ER_BAD_DB_ERROR
 
382
--error 1049
305
383
SHOW TABLES FROM non_existing_database;
306
384
 
307
385
--echo End of 4.1 tests
336
414
drop database `mysqlttest\1`;
337
415
 
338
416
#
339
 
# Bug#25081 show TABLES on table with latin chars in name fails
 
417
# Bug#24392: SHOW ENGINE MUTEX STATUS is a synonym for SHOW INNODB STATUS
 
418
#
 
419
 
 
420
--error ER_UNKNOWN_STORAGE_ENGINE
 
421
show engine foobar status;
 
422
--error 1064
 
423
show engine foobar logs;
 
424
--error 1064
 
425
show engine foobar mutex;
 
426
 
 
427
--error ER_UNKNOWN_STORAGE_ENGINE
 
428
show engine mutex status;
 
429
 
 
430
show engine csv status;
 
431
 
 
432
#
 
433
# Bug#25081 SHOW FULL TABLES on table with latin chars in name fails
340
434
#
341
435
--disable_warnings
342
436
drop table if exists `été`;
343
437
--enable_warnings
344
438
create table `été` (field1 int);
345
 
show tables;
 
439
show full tables;
346
440
drop table `été`;
347
441
 
348
442
#