~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/information_schema.test

  • Committer: Brian Aker
  • Date: 2010-02-19 20:32:03 UTC
  • mto: (1273.13.97 build)
  • mto: This revision was merged to the branch mainline in revision 1309.
  • Revision ID: brian@gaz-20100219203203-r35xkf1q3qhodqpy
Remove the old columns I_S table.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
--replace_column 8 # 12 # 13 #
27
27
#show table status;
28
28
show columns from t3 like "a%";
29
 
select * from information_schema.old_COLUMNS where table_name="t1"
 
29
select * from data_dictionary.columns where table_name="t1"
30
30
and column_name= "a";
31
31
 
32
32
connect (user3,localhost,mysqltest_2,,);
33
33
connection user3;
34
 
select table_name, column_name, privileges from information_schema.old_columns 
 
34
select table_name, column_name from data_dictionary.columns 
35
35
where table_schema = 'mysqltest' and table_name = 't1';
36
36
show columns from mysqltest.t1;
37
37
connect (user4,localhost,mysqltest_3,,mysqltest);
50
50
#
51
51
# Bug#2719 information_schema: errors in "columns"
52
52
#
53
 
select column_type from information_schema.old_columns
 
53
select column_type from data_dictionary.columns
54
54
where table_schema="information_schema" and table_name="COLUMNS" and
55
55
(column_name="character_set_name" or column_name="collation_name");
56
56
 
120
120
create table t1(f1 LONGBLOB, f2 LONGTEXT);
121
121
select column_name,data_type,CHARACTER_OCTET_LENGTH,
122
122
       CHARACTER_MAXIMUM_LENGTH
123
 
from information_schema.old_columns
 
123
from data_dictionary.columns
124
124
where table_name='t1';
125
125
drop table t1;
126
126
create table t1(f1 int, f2 int, f3 BIGINT, f4 int,
127
127
                f5 BIGINT, f6 int, f7 int);
128
128
select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
129
 
from information_schema.old_columns
 
129
from data_dictionary.columns
130
130
where table_name='t1';
131
131
drop table t1;
132
132
 
135
135
#
136
136
create table t1 (a int not null, b int);
137
137
use information_schema;
138
 
select column_name, column_default from information_schema.old_columns
 
138
select column_name, column_default from data_dictionary.columns
139
139
  where table_schema='test' and table_name='t1';
140
140
use test;
141
141
show columns from t1;
177
177
#
178
178
create table t1(f1 varbinary(32), f2 varbinary(64));
179
179
select character_maximum_length, character_octet_length
180
 
from information_schema.old_columns where table_name='t1';
 
180
from data_dictionary.columns where table_name='t1';
181
181
drop table t1;
182
182
 
183
183
##
184
184
## Bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema
185
185
##
186
186
select column_type, group_concat(table_schema, '.', table_name), count(*) as num
187
 
from information_schema.old_columns where
 
187
from data_dictionary.columns where
188
188
table_schema='information_schema' and
189
189
(column_type = 'varchar(7)' or column_type = 'varchar(20)'
190
190
 or column_type = 'varchar(27)')
195
195
#
196
196
create table t1(f1 char(1) not null, f2 char(9) not null);
197
197
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
198
 
information_schema.old_columns where table_schema='test' and table_name = 't1';
 
198
data_dictionary.columns where table_schema='test' and table_name = 't1';
199
199
drop table t1;
200
200
 
201
201
#
215
215
SELECT t.table_name, c1.column_name
216
216
  FROM data_dictionary.tables t
217
217
       INNER JOIN
218
 
       information_schema.old_columns c1
 
218
       data_dictionary.columns c1
219
219
       ON t.table_schema = c1.table_schema AND
220
220
          t.table_name = c1.table_name
221
221
  WHERE t.table_schema = 'information_schema' AND
222
222
        c1.ordinal_position =
223
223
        ( SELECT COALESCE(MIN(c2.ordinal_position),1)
224
 
            FROM information_schema.old_columns c2
 
224
            FROM data_dictionary.columns c2
225
225
            WHERE c2.table_schema = t.table_schema AND
226
226
                  c2.table_name = t.table_name AND
227
227
                  c2.column_name LIKE '%SCHEMA%'
232
232
SELECT t.table_name, c1.column_name
233
233
  FROM data_dictionary.tables t
234
234
       INNER JOIN
235
 
       information_schema.old_columns c1
 
235
       data_dictionary.columns c1
236
236
       ON t.table_schema = c1.table_schema AND
237
237
          t.table_name = c1.table_name
238
238
  WHERE t.table_schema = 'information_schema' AND
239
239
        c1.ordinal_position =
240
240
        ( SELECT COALESCE(MIN(c2.ordinal_position),1)
241
 
            FROM information_schema.old_columns c2
 
241
            FROM data_dictionary.columns c2
242
242
            WHERE c2.table_schema = 'information_schema' AND
243
243
                  c2.table_name = t.table_name AND
244
244
                  c2.column_name LIKE '%SCHEMA%'
264
264
 
265
265
#select table_name from data_dictionary.tables
266
266
#where table_schema = 'test' and table_name not in
267
 
#(select table_name from information_schema.old_columns
 
267
#(select table_name from data_dictionary.columns
268
268
# where table_schema = 'test' and column_name = 'f3')
269
269
#ORDER BY table_name;
270
270
 
281
281
select t.table_name, group_concat(t.table_schema, '.', t.table_name),
282
282
       count(*) as num1
283
283
from data_dictionary.tables t
284
 
inner join information_schema.old_columns c1
 
284
inner join data_dictionary.columns c1
285
285
on t.table_schema = c1.table_schema AND t.table_name = c1.table_name
286
286
where t.table_schema = 'information_schema' AND
287
287
      t.table_name not like 'falcon%' AND
289
289
        (select isnull(c2.column_type) -
290
290
         isnull(group_concat(c2.table_schema, '.', c2.table_name)) +
291
291
         count(*) as num
292
 
         from information_schema.old_columns c2 where
 
292
         from data_dictionary.columns c2 where
293
293
         c2.table_schema='information_schema' and
294
294
         (c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)')
295
295
          group by c2.column_type order by num limit 1)
316
316
  f7 datetime not null,
317
317
  f8 datetime default '2006-01-01'
318
318
);
319
 
#select column_default from information_schema.old_columns where table_name= 't1' ORDER BY column_default;
 
319
#select column_default from data_dictionary.columns where table_name= 't1' ORDER BY column_default;
320
320
show columns from t1;
321
321
drop table t1;
322
322