~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/information_schema.test

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
--enable_warnings
11
11
 
12
12
 
13
 
show variables where variable_name like "skip_show_database";
14
 
 
15
 
 
16
13
select * from information_schema.SCHEMATA where schema_name > 'm';
17
14
select schema_name from information_schema.schemata;
18
15
show databases like 't%';
19
16
show databases;
20
 
show databases where `database` = 't%';
21
17
 
22
18
# Test for information_schema.tables &
23
19
# show tables
34
30
where table_schema = "mysqltest" and table_name like "t%";
35
31
 
36
32
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
37
 
show keys from t3 where Key_name = "a_data";
38
33
 
39
34
show tables like 't%';
40
35
--replace_column 8 # 12 # 13 #
42
37
show full columns from t3 like "a%";
43
38
select * from information_schema.COLUMNS where table_name="t1"
44
39
and column_name= "a";
45
 
show columns from mysqltest.t1 where field like "%a%";
46
40
 
47
41
connect (user3,localhost,mysqltest_2,,);
48
42
connection user3;
61
55
 
62
56
select * from information_schema.CHARACTER_SETS
63
57
where CHARACTER_SET_NAME like 'latin1%';
64
 
SHOW CHARACTER SET LIKE 'latin1%';
65
 
SHOW CHARACTER SET WHERE charset like 'latin1%';
66
58
 
67
59
# Test for information_schema.COLLATIONS &
68
60
# SHOW COLLATION
70
62
--replace_column 5 #
71
63
select * from information_schema.COLLATIONS
72
64
where COLLATION_NAME like 'latin1%';
73
 
--replace_column 5 #
74
 
SHOW COLLATION LIKE 'latin1%';
75
 
--replace_column 5 #
76
 
SHOW COLLATION WHERE collation like 'latin1%';
77
65
 
78
66
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
79
67
where COLLATION_NAME like 'latin1%';
99
87
select table_type from information_schema.tables
100
88
where table_schema="mysql" and table_name="user";
101
89
 
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";
108
 
 
109
90
#
110
91
# Bug #7981:SHOW GLOBAL STATUS crashes server
111
92
#
139
120
create table t1
140
121
( x_bigint BIGINT,
141
122
  x_integer INTEGER,
142
 
  x_smallint SMALLINT,
 
123
  x_int int,
143
124
  x_decimal DECIMAL(5,3),
144
125
  x_numeric NUMERIC(5,3),
145
126
  x_real REAL,
172
153
from information_schema.columns
173
154
where table_name='t1';
174
155
drop table t1;
175
 
create table t1(f1 tinyint, f2 SMALLINT, f3 BIGINT, f4 int,
176
 
                f5 BIGINT, f6 TINYINT, f7 SMALLINT);
 
156
create table t1(f1 int, f2 int, f3 BIGINT, f4 int,
 
157
                f5 BIGINT, f6 int, f7 int);
177
158
select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
178
159
from information_schema.columns
179
160
where table_name='t1';
191
172
drop table t1;
192
173
 
193
174
#
194
 
# Bug #12636: SHOW TABLE STATUS with where condition containing a subquery
195
 
#             over information schema
196
 
#
197
 
 
198
 
CREATE TABLE t1 (a int);
199
 
CREATE TABLE t2 (b int);
200
 
 
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');
205
 
 
206
 
DROP TABLE t1,t2;
207
 
 
208
 
#
209
175
# Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
210
176
#
211
177
--error ER_PARSE_ERROR
248
214
#
249
215
# Bug#14271 I_S: columns has no size for (var)binary columns
250
216
#
251
 
create table t1(f1 binary(32), f2 varbinary(64));
 
217
create table t1(f1 varbinary(32), f2 varbinary(64));
252
218
select character_maximum_length, character_octet_length
253
219
from information_schema.columns where table_name='t1';
254
220
drop table t1;
266
232
#
267
233
# Bug#19236 bad COLUMNS.CHARACTER_MAXIMUM_LENGHT and CHARACTER_OCTET_LENGTH
268
234
#
269
 
create table t1(f1 char(1) not null, f2 char(9) not null)
270
 
default character set utf8;
 
235
create table t1(f1 char(1) not null, f2 char(9) not null);
271
236
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
272
237
information_schema.columns where table_schema='test' and table_name = 't1';
273
238
drop table t1;
329
294
#
330
295
# Bug#23299 Some queries against INFORMATION_SCHEMA with subqueries fail
331
296
#
332
 
create table t1 (f1 int(11));
333
 
create table t2 (f1 int(11), f2 int(11));
 
297
create table t1 (f1 int);
 
298
create table t2 (f1 int, f2 int);
334
299
 
335
300
select table_name from information_schema.tables
336
301
where table_schema = 'test' and table_name not in