13
show variables where variable_name like "skip_show_database";
16
9
select * from information_schema.SCHEMATA where schema_name > 'm';
17
10
select schema_name from information_schema.schemata;
18
11
show databases like 't%';
20
show databases where `database` = 't%';
22
14
# Test for information_schema.tables &
34
26
where table_schema = "mysqltest" and table_name like "t%";
36
28
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
37
show keys from t3 where Key_name = "a_data";
39
30
show tables like 't%';
40
31
--replace_column 8 # 12 # 13 #
42
33
show full columns from t3 like "a%";
43
34
select * from information_schema.COLUMNS where table_name="t1"
44
35
and column_name= "a";
45
show columns from mysqltest.t1 where field like "%a%";
47
37
connect (user3,localhost,mysqltest_2,,);
70
58
--replace_column 5 #
71
59
select * from information_schema.COLLATIONS
72
60
where COLLATION_NAME like 'latin1%';
74
SHOW COLLATION LIKE 'latin1%';
76
SHOW COLLATION WHERE collation like 'latin1%';
78
62
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
79
63
where COLLATION_NAME like 'latin1%';
99
83
select table_type from information_schema.tables
100
84
where table_schema="mysql" and table_name="user";
102
# test for 'show open tables ... where'
103
show open tables where `table` like "user";
104
# test for 'show status ... where'
105
show status where variable_name like "%database%";
106
# test for 'show variables ... where'
107
show variables where variable_name like "skip_show_databas";
110
# Bug #7981:SHOW GLOBAL STATUS crashes server
112
# We don't actually care about the value, just that it doesn't crash.
114
show global status like "Threads_running";
117
87
# Bug #7215 information_schema: columns are longtext instead of varchar
118
88
# Bug #7217 information_schema: columns are varbinary() instead of timestamp
155
125
# with SELECT SUM() ... GROUP BY queries
157
127
SELECT table_schema, count(*) FROM information_schema.TABLES
158
WHERE table_name NOT LIKE 'ndb_%' AND table_name NOT LIKE 'falcon%' GROUP BY TABLE_SCHEMA;
128
WHERE table_name NOT LIKE 'ndb_%' AND
129
table_name NOT LIKE 'falcon%' AND
131
GROUP BY TABLE_SCHEMA;
161
134
# Bug #9434 SHOW CREATE DATABASE information_schema;
172
145
from information_schema.columns
173
146
where table_name='t1';
175
create table t1(f1 tinyint, f2 SMALLINT, f3 BIGINT, f4 int,
176
f5 BIGINT, f6 TINYINT, f7 SMALLINT);
148
create table t1(f1 int, f2 int, f3 BIGINT, f4 int,
149
f5 BIGINT, f6 int, f7 int);
177
150
select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
178
151
from information_schema.columns
179
152
where table_name='t1';
194
# Bug #12636: SHOW TABLE STATUS with where condition containing a subquery
195
# over information schema
198
CREATE TABLE t1 (a int);
199
CREATE TABLE t2 (b int);
201
--replace_column 8 # 12 # 13 #
202
SHOW TABLE STATUS FROM test
203
WHERE name IN ( SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
204
WHERE TABLE_SCHEMA='test' AND TABLE_TYPE='BASE TABLE');
209
167
# Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
211
169
--error ER_PARSE_ERROR
212
170
alter database information_schema;
213
171
--error ER_DBACCESS_DENIED_ERROR
214
172
drop database information_schema;
216
drop table information_schema.tables;
218
alter table information_schema.tables;
173
use information_schema;
220
179
# Bug #9683 INFORMATION_SCH: Creation of temporary table allowed in Information_schema DB
261
220
table_schema='information_schema' and
262
221
(column_type = 'varchar(7)' or column_type = 'varchar(20)'
263
222
or column_type = 'varchar(27)')
264
group by column_type order by num;
223
group by column_type order by column_type, num;
267
226
# Bug#19236 bad COLUMNS.CHARACTER_MAXIMUM_LENGHT and CHARACTER_OCTET_LENGTH
269
create table t1(f1 char(1) not null, f2 char(9) not null)
270
default character set utf8;
228
create table t1(f1 char(1) not null, f2 char(9) not null);
271
229
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
272
230
information_schema.columns where table_schema='test' and table_name = 't1';
300
258
c2.table_name = t.table_name AND
301
259
c2.column_name LIKE '%SCHEMA%'
303
AND t.table_name NOT LIKE 'falcon%';
261
AND t.table_name NOT LIKE 'falcon%'
262
AND t.plugin_name IS NULL;
304
263
SELECT t.table_name, c1.column_name
305
264
FROM information_schema.tables t
353
313
on t.table_schema = c1.table_schema AND t.table_name = c1.table_name
354
314
where t.table_schema = 'information_schema' AND
355
315
t.table_name not like 'falcon%' AND
316
t.plugin_name IS NULL AND
356
317
c1.ordinal_position =
357
318
(select isnull(c2.column_type) -
358
319
isnull(group_concat(c2.table_schema, '.', c2.table_name)) +
430
391
select * from information_schema.tables where table_name = NULL;
431
392
select * from `information_schema`.`TABLE_CONSTRAINTS` where `TABLE_SCHEMA` = NULL;
432
393
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
441
(SELECT table_name FROM information_schema.tables
442
WHERE plugin_name IS NULL)
446
# perform a query on KEY_COLUMN_USAGE
449
FROM information_schema.key_column_usage;
452
# perform a query on REFERENTIAL_CONSTRAINTS
455
FROM information_schema.referential_constraints;
458
# query the SCHEMATA table
460
SELECT catalog_name, schema_name
461
FROM information_schema.schemata
462
ORDER BY schema_name;
465
# Query the STATUS and VARIABLES related
466
# I_S related tables.
468
--replace_column 1 # 2 #
470
FROM information_schema.session_status
471
ORDER BY variable_name;
473
--replace_column 1 # 2 #
476
#--replace_column 1 # 2 #
478
#FROM information_schema.session_variables
479
#ORDER BY variable_name;
481
#--replace_column 1 # 2 #
484
--replace_column 1 # 2 #
486
FROM information_schema.global_status
487
ORDER BY variable_name;
489
#--replace_column 1 # 2 #
491
#FROM information_schema.global_variables
492
#ORDER BY variable_name;
495
# query TABLE_CONSTRAINTS table
498
FROM information_schema.table_constraints;
503
SELECT table_schema, table_name
504
FROM information_schema.tables
505
WHERE plugin_name IS NULL
509
# do a query on the PLUGINS table in I_S to ensure it works correctly
510
# how do we test for this if the contents of this table can change
511
# depend on what plugins are configured for use?