~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/information_schema.test

  • Committer: Zimin
  • Date: 2010-07-10 02:51:05 UTC
  • mfrom: (1655 build)
  • mto: (1675.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1677.
  • Revision ID: ziminq@gmail.com-20100710025105-ft7s65oz5td4rmxl
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
create table t5 (id int auto_increment primary key);
17
17
insert into t5 values (10);
18
18
 
 
19
--sorted_result
19
20
select table_name from data_dictionary.tables
20
21
where table_schema = "mysqltest" and table_name like "t%";
21
22
 
25
26
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
26
27
show table status;
27
28
show columns from t3 like "a%";
 
29
--sorted_result
28
30
select * from data_dictionary.columns where table_name="t1"
29
31
and column_name= "a";
30
32
 
31
33
connect (user3,localhost,mysqltest_2,,);
32
34
connection user3;
 
35
--sorted_result
33
36
select table_name, column_name from data_dictionary.columns 
34
37
where table_schema = 'mysqltest' and table_name = 't1';
35
38
show columns from mysqltest.t1;
43
46
#
44
47
# Bug#2719 information_schema: errors in "columns"
45
48
#
 
49
--sorted_result
46
50
select column_type from data_dictionary.columns
47
51
where table_schema="data_dictionary" and table_name="COLUMNS" and
48
52
(column_name="character_set_name" or column_name="collation_name");
51
55
# Bug#2718 information_schema: errors in "tables"
52
56
#
53
57
--replace_column 1 #
 
58
--sorted_result
54
59
select count(*) from data_dictionary.tables where 
55
60
table_schema="data_dictionary" and table_name="COLUMNS";
56
61
 
57
62
--replace_column 1 #
 
63
--sorted_result
58
64
select count(*) from data_dictionary.tables
59
65
where table_schema="mysql" and table_name="user";
60
66
 
62
68
# Bug #7215  information_schema: columns are longtext instead of varchar
63
69
# Bug #7217  information_schema: columns are varbinary() instead of timestamp
64
70
#
 
71
--sorted_result
65
72
select table_schema, table_name, column_name from data_dictionary.columns where data_type = 'longtext';
 
73
--sorted_result
66
74
select table_name, column_name, data_type from data_dictionary.columns where data_type = 'datetime';
67
75
 
68
76
#
69
77
# Bug #8164  subquery with data_dictionary.COLUMNS, 100 % CPU
70
78
#
 
79
--sorted_result
71
80
SELECT COUNT(*) FROM data_dictionary.tables A
72
81
WHERE NOT EXISTS 
73
82
(SELECT * FROM data_dictionary.columns B
87
96
  x_real REAL,
88
97
  x_float FLOAT,
89
98
  x_double_precision DOUBLE PRECISION );
 
99
--sorted_result
90
100
SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH
91
101
FROM data_dictionary.columns
92
102
WHERE TABLE_NAME= 't1';
106
116
# Bug #12301 information_schema: NUMERIC_SCALE must be 0 for integer columns
107
117
#
108
118
create table t1(f1 LONGBLOB, f2 LONGTEXT);
 
119
--sorted_result
109
120
select column_name,data_type,CHARACTER_OCTET_LENGTH,
110
121
       CHARACTER_MAXIMUM_LENGTH
111
122
from data_dictionary.columns
113
124
drop table t1;
114
125
create table t1(f1 int, f2 int, f3 BIGINT, f4 int,
115
126
                f5 BIGINT, f6 int, f7 int);
 
127
--sorted_result
116
128
select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
117
129
from data_dictionary.columns
118
130
where table_name='t1';
122
134
# Bug#12518 COLUMN_DEFAULT has wrong value if NOT NULL is set
123
135
#
124
136
create table t1 (a int not null, b int);
 
137
--sorted_result
125
138
select column_name, column_default from data_dictionary.columns
126
139
  where table_schema='test' and table_name='t1';
127
140
use test;
135
148
use test;
136
149
create table t1(id int);
137
150
insert into t1(id) values (1);
 
151
--sorted_result
138
152
select 1 from (select 1 from test.t1) a;
139
153
use data_dictionary;
 
154
--sorted_result
140
155
select 1 from (select 1 from test.t1) a;
141
156
use test;
142
157
drop table t1;
145
160
# Bug#14271 I_S: columns has no size for (var)binary columns
146
161
#
147
162
create table t1(f1 varbinary(32), f2 varbinary(64));
 
163
--sorted_result
148
164
select character_maximum_length, character_octet_length
149
165
from data_dictionary.columns where table_name='t1';
150
166
drop table t1;
163
179
# Bug#19236 bad COLUMNS.CHARACTER_MAXIMUM_LENGHT and CHARACTER_OCTET_LENGTH
164
180
#
165
181
create table t1(f1 char(1) not null, f2 char(9) not null);
 
182
--sorted_result
166
183
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
167
184
data_dictionary.columns where table_schema='test' and table_name = 't1';
168
185
drop table t1;
173
190
set @a:= '.';
174
191
create table t1(f1 char(5));
175
192
create table t2(f1 char(5));
 
193
--sorted_result
176
194
select concat(@a, table_name), @a, table_name
177
195
from data_dictionary.tables where table_schema = 'test';
178
196
drop table t1,t2;
243
261
#
244
262
# Bug#24630  Subselect query crashes mysqld
245
263
#
 
264
--sorted_result
246
265
select 1 as f1 from data_dictionary.tables  where "CHARACTER_SETS"=
247
266
(select cast(table_name as char)  from data_dictionary.tables
248
267
 order by table_name limit 1) limit 1;
297
316
#
298
317
# Bug#30795 Query on data_dictionary.schemas, wrong result
299
318
#
 
319
--sorted_result
300
320
SELECT SCHEMA_NAME FROM data_dictionary.schemas
301
321
WHERE SCHEMA_NAME ='data_dictionary';
302
322
                                                                                                 
303
323
#
304
324
# Bug#31381 Error in retrieving Data from INFORMATION_SCHEMA
305
325
#
 
326
--sorted_result
306
327
SELECT TABLE_COLLATION FROM data_dictionary.tables
307
328
WHERE TABLE_SCHEMA='mysql' and TABLE_NAME= 'db';
308
329
 
310
331
--echo # Test that the query is visible to self and others.
311
332
--echo #
312
333
 
 
334
--sorted_result
313
335
SELECT info FROM data_dictionary.processlist WHERE id = CONNECTION_ID();
314
336
 
315
337
#
316
338
# do a query on the PROCESSLIST table in I_S to ensure it works correctly
317
339
#
 
340
--sorted_result
318
341
SELECT info, command, db
319
342
FROM data_dictionary.processlist
320
343
WHERE id = CONNECTION_ID();