13
show variables where variable_name like "skip_show_database";
9
16
select * from information_schema.SCHEMATA where schema_name > 'm';
10
17
select schema_name from information_schema.schemata;
11
18
show databases like 't%';
20
show databases where `database` = 't%';
14
22
# Test for information_schema.tables &
26
34
where table_schema = "mysqltest" and table_name like "t%";
28
36
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
37
show keys from t3 where Key_name = "a_data";
30
39
show tables like 't%';
31
40
--replace_column 8 # 12 # 13 #
33
42
show full columns from t3 like "a%";
43
show full columns from mysql.db like "Insert%";
34
44
select * from information_schema.COLUMNS where table_name="t1"
35
45
and column_name= "a";
46
show columns from mysqltest.t1 where field like "%a%";
37
48
connect (user3,localhost,mysqltest_2,,);
58
71
--replace_column 5 #
59
72
select * from information_schema.COLLATIONS
60
73
where COLLATION_NAME like 'latin1%';
75
SHOW COLLATION LIKE 'latin1%';
77
SHOW COLLATION WHERE collation like 'latin1%';
62
79
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
63
80
where COLLATION_NAME like 'latin1%';
83
100
select table_type from information_schema.tables
84
101
where table_schema="mysql" and table_name="user";
103
# test for 'show open tables ... where'
104
show open tables where `table` like "user";
105
# test for 'show status ... where'
106
show status where variable_name like "%database%";
107
# test for 'show variables ... where'
108
show variables where variable_name like "skip_show_databas";
111
# Bug #7981:SHOW GLOBAL STATUS crashes server
113
# We don't actually care about the value, just that it doesn't crash.
115
show global status like "Threads_running";
87
118
# Bug #7215 information_schema: columns are longtext instead of varchar
88
119
# Bug #7217 information_schema: columns are varbinary() instead of timestamp
125
156
# with SELECT SUM() ... GROUP BY queries
127
158
SELECT table_schema, count(*) FROM information_schema.TABLES
128
WHERE table_name NOT LIKE 'ndb_%' AND
129
table_name NOT LIKE 'falcon%' AND
130
table_name NOT LIKE 'MEMCACHED%'
131
GROUP BY TABLE_SCHEMA;
159
WHERE table_name NOT LIKE 'ndb_%' AND table_name NOT LIKE 'falcon%' GROUP BY TABLE_SCHEMA;
134
162
# Bug #9434 SHOW CREATE DATABASE information_schema;
145
173
from information_schema.columns
146
174
where table_name='t1';
148
create table t1(f1 int, f2 int, f3 BIGINT, f4 int,
149
f5 BIGINT, f6 int, f7 int);
176
create table t1(f1 tinyint, f2 SMALLINT, f3 mediumint, f4 int,
177
f5 BIGINT, f6 BIT, f7 bit(64));
150
178
select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
151
179
from information_schema.columns
152
180
where table_name='t1';
195
# Bug #12636: SHOW TABLE STATUS with where condition containing a subquery
196
# over information schema
199
CREATE TABLE t1 (a int);
200
CREATE TABLE t2 (b int);
202
--replace_column 8 # 12 # 13 #
203
SHOW TABLE STATUS FROM test
204
WHERE name IN ( SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
205
WHERE TABLE_SCHEMA='test' AND TABLE_TYPE='BASE TABLE');
167
210
# Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
169
212
--error ER_PARSE_ERROR
170
213
alter database information_schema;
171
214
--error ER_DBACCESS_DENIED_ERROR
172
215
drop database information_schema;
173
use information_schema;
217
drop table information_schema.tables;
219
alter table information_schema.tables;
179
221
# Bug #9683 INFORMATION_SCH: Creation of temporary table allowed in Information_schema DB
208
250
# Bug#14271 I_S: columns has no size for (var)binary columns
210
create table t1(f1 varbinary(32), f2 varbinary(64));
252
create table t1(f1 binary(32), f2 varbinary(64));
211
253
select character_maximum_length, character_octet_length
212
254
from information_schema.columns where table_name='t1';
220
262
table_schema='information_schema' and
221
263
(column_type = 'varchar(7)' or column_type = 'varchar(20)'
222
264
or column_type = 'varchar(27)')
223
group by column_type order by column_type, num;
265
group by column_type order by num;
226
268
# Bug#19236 bad COLUMNS.CHARACTER_MAXIMUM_LENGHT and CHARACTER_OCTET_LENGTH
228
create table t1(f1 char(1) not null, f2 char(9) not null);
270
create table t1(f1 char(1) not null, f2 char(9) not null)
271
default character set utf8;
229
272
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
230
273
information_schema.columns where table_schema='test' and table_name = 't1';
258
301
c2.table_name = t.table_name AND
259
302
c2.column_name LIKE '%SCHEMA%'
261
AND t.table_name NOT LIKE 'falcon%'
262
AND t.table_name NOT LIKE 'MEMCACHED%';
304
AND t.table_name NOT LIKE 'falcon%';
263
305
SELECT t.table_name, c1.column_name
264
306
FROM information_schema.tables t
274
316
c2.table_name = t.table_name AND
275
317
c2.column_name LIKE '%SCHEMA%'
277
AND t.table_name NOT LIKE 'falcon%'
278
AND t.table_name NOT LIKE 'MEMCACHED%';
319
AND t.table_name NOT LIKE 'falcon%';
281
322
# Bug#21231: query with a simple non-correlated subquery over
290
331
# Bug#23299 Some queries against INFORMATION_SCHEMA with subqueries fail
292
create table t1 (f1 int);
293
create table t2 (f1 int, f2 int);
333
create table t1 (f1 int(11));
334
create table t2 (f1 int(11), f2 int(11));
295
336
select table_name from information_schema.tables
296
337
where table_schema = 'test' and table_name not in
313
354
on t.table_schema = c1.table_schema AND t.table_name = c1.table_name
314
355
where t.table_schema = 'information_schema' AND
315
356
t.table_name not like 'falcon%' AND
316
t.table_name not like 'MEMCACHED%' AND
317
357
c1.ordinal_position =
318
358
(select isnull(c2.column_type) -
319
359
isnull(group_concat(c2.table_schema, '.', c2.table_name)) +
391
431
select * from information_schema.tables where table_name = NULL;
392
432
select * from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_SCHEMA` = NULL;
393
433
select * from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_NAME` = NULL;
396
--echo # Test that the query is visible to self and others.
399
SELECT info FROM information_schema.processlist WHERE id = CONNECTION_ID();
402
# test that SHOW PROCESSLIST works correctly
404
--replace_column 1 # 2 # 3 # 6 # 7 #
408
# do a query on the PROCESSLIST table in I_S to ensure it works correctly
410
SELECT info, command, db
411
FROM information_schema.processlist
412
WHERE id = CONNECTION_ID();
415
# do a query on the CHARACTER_SET table in I_S
418
FROM information_schema.character_sets
419
ORDER BY character_set_name;
422
# perform a query on the COLLATIONS table
425
FROM information_schema.collations
426
ORDER BY collation_name;
429
# perform a query on COLLATION_CHARACTER_SET_APPLICABILITY
432
FROM information_schema.collation_character_set_applicability
433
ORDER BY collation_name;
436
# perform a query on COLUMNS
438
SELECT table_name, column_name
439
FROM information_schema.columns
440
WHERE table_name NOT LIKE 'MEMCACHED%'
444
# perform a query on KEY_COLUMN_USAGE
447
FROM information_schema.key_column_usage;
450
# perform a query on REFERENTIAL_CONSTRAINTS
453
FROM information_schema.referential_constraints;
456
# query the SCHEMATA table
458
SELECT catalog_name, schema_name
459
FROM information_schema.schemata
460
ORDER BY schema_name;
463
# Query the STATUS and VARIABLES related
464
# I_S related tables.
466
--replace_column 1 # 2 #
468
FROM information_schema.session_status
469
ORDER BY variable_name;
471
--replace_column 1 # 2 #
474
#--replace_column 1 # 2 #
476
#FROM information_schema.session_variables
477
#ORDER BY variable_name;
479
#--replace_column 1 # 2 #
482
--replace_column 1 # 2 #
484
FROM information_schema.global_status
485
ORDER BY variable_name;
487
#--replace_column 1 # 2 #
489
#FROM information_schema.global_variables
490
#ORDER BY variable_name;
493
# query TABLE_CONSTRAINTS table
496
FROM information_schema.table_constraints;
501
SELECT table_schema, table_name
502
FROM information_schema.tables
503
WHERE table_name NOT LIKE 'MEMCACHED%'
507
# do a query on the PLUGINS table in I_S to ensure it works correctly
508
# how do we test for this if the contents of this table can change
509
# depend on what plugins are configured for use?