~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to tests/t/information_schema_inno.test

  • Committer: Padraig O'Sullivan
  • Date: 2010-03-15 14:05:26 UTC
  • mfrom: (1237.9.99 staging)
  • Revision ID: osullivan.padraig@gmail.com-20100315140526-opbgwdwn6tfecdkq
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
CREATE TABLE t3 (id INT PRIMARY KEY, t2_id INT, INDEX par_ind (t2_id),
16
16
FOREIGN KEY (id, t2_id) REFERENCES t2(t1_id, id)  ON DELETE CASCADE) ENGINE=INNODB;
17
17
 
18
 
select * from information_schema.OLD_TABLE_CONSTRAINTS where
19
 
TABLE_SCHEMA= "test";
20
 
select * from information_schema.OLD_KEY_COLUMN_USAGE where
21
 
TABLE_SCHEMA= "test";
 
18
#select * from information_schema.OLD_TABLE_CONSTRAINTS where
 
19
#TABLE_SCHEMA= "test";
 
20
select * from data_dictionary.indexes where TABLE_SCHEMA= "test";
22
21
 
23
22
drop table t3, t2, t1;
24
23
 
44
43
                FOREIGN KEY (b1, b2) REFERENCES t4(b1, b2)
45
44
                ON UPDATE RESTRICT ON DELETE CASCADE) ENGINE=INNODB;
46
45
                
47
 
select a.CONSTRAINT_SCHEMA, b.TABLE_NAME, CONSTRAINT_TYPE,
48
 
       b.CONSTRAINT_NAME, UNIQUE_CONSTRAINT_SCHEMA, UNIQUE_CONSTRAINT_NAME,
49
 
       MATCH_OPTION, UPDATE_RULE, DELETE_RULE, b.REFERENCED_TABLE_NAME
50
 
from information_schema.OLD_TABLE_CONSTRAINTS a,
51
 
     information_schema.OLD_REFERENTIAL_CONSTRAINTS b
52
 
where a.CONSTRAINT_SCHEMA = 'test' and a.CONSTRAINT_SCHEMA = b.CONSTRAINT_SCHEMA and
53
 
a.CONSTRAINT_NAME = b.CONSTRAINT_NAME;
 
46
#select a.CONSTRAINT_SCHEMA, b.TABLE_NAME, CONSTRAINT_TYPE,
 
47
#       b.CONSTRAINT_NAME, UNIQUE_CONSTRAINT_SCHEMA, UNIQUE_CONSTRAINT_NAME,
 
48
#       MATCH_OPTION, UPDATE_RULE, DELETE_RULE, b.REFERENCED_TABLE_NAME
 
49
#from information_schema.OLD_TABLE_CONSTRAINTS a,
 
50
#     information_schema.OLD_REFERENTIAL_CONSTRAINTS b
 
51
#where a.CONSTRAINT_SCHEMA = 'test' and a.CONSTRAINT_SCHEMA = b.CONSTRAINT_SCHEMA and
 
52
#a.CONSTRAINT_NAME = b.CONSTRAINT_NAME;
54
53
drop tables t5, t4, t3, t2, t1;
55
54
 
56
55
#
71
70
  constraint fk_t1_1 foreign key (idtype) references `t-2` (id)
72
71
) engine=innodb;
73
72
use test;
74
 
select referenced_table_schema, referenced_table_name 
75
 
from information_schema.OLD_key_column_usage
76
 
where constraint_schema = 'db-1';
 
73
#select referenced_table_schema, referenced_table_name 
 
74
#from data_dictionary.indexes
 
75
#where constraint_schema = 'db-1';
77
76
drop database `db-1`;
78
77
 
79
78
#
83
82
create table t2(pid int, foreign key (pid) references t1(id)) engine = Innodb;
84
83
set foreign_key_checks = 0;
85
84
drop table t1;
86
 
select UNIQUE_CONSTRAINT_NAME
87
 
from information_schema.OLD_referential_constraints
88
 
where constraint_schema = schema();
 
85
#select UNIQUE_CONSTRAINT_NAME
 
86
#from data_dictionary.OLD_referential_constraints
 
87
#where constraint_schema = schema();
89
88
drop table t2;
90
89
set foreign_key_checks = 1;