~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/information_schema_dictionary/tests/r/referential_constraints.result

  • Committer: Brian Aker
  • Date: 2010-10-27 23:24:30 UTC
  • mfrom: (1861.4.9 trunk-drizzle)
  • Revision ID: brian@tangent.org-20101027232430-e9ces9kmhvknr86c
Merge in additions to IS for FK

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
CREATE SCHEMA test_constaints;
 
2
USE test_constaints;
 
3
CREATE TABLE t1(a1 INT NOT NULL,
 
4
a2 INT NOT NULL,
 
5
PRIMARY KEY(a1, a2));
 
6
CREATE TABLE t2(b1 INT,
 
7
b2 INT,
 
8
CONSTRAINT A1 FOREIGN KEY (b1, b2) REFERENCES t1(a1, a2) ON UPDATE CASCADE ON DELETE NO ACTION);
 
9
SELECT CONSTRAINT_NAME, UNIQUE_CONSTRAINT_SCHEMA, UNIQUE_CONSTRAINT_NAME, MATCH_OPTION, UPDATE_RULE, DELETE_RULE
 
10
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS 
 
11
WHERE CONSTRAINT_SCHEMA = 'test_constaints';
 
12
CONSTRAINT_NAME UNIQUE_CONSTRAINT_SCHEMA        UNIQUE_CONSTRAINT_NAME  MATCH_OPTION    UPDATE_RULE     DELETE_RULE
 
13
A1      test_constaints         SIMPLE  CASCADE NO ACTION
 
14
SELECT CONSTRAINT_NAME, CHECK_CLAUSE FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS
 
15
WHERE CONSTRAINT_SCHEMA = 'test_constaints';
 
16
CONSTRAINT_NAME CHECK_CLAUSE
 
17
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME
 
18
FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
 
19
WHERE CONSTRAINT_SCHEMA = 'test_constaints';
 
20
TABLE_SCHEMA    TABLE_NAME      COLUMN_NAME     CONSTRAINT_CATALOG      CONSTRAINT_SCHEMA       CONSTRAINT_NAME
 
21
SELECT TABLE_NAME,CONSTRAINT_NAME
 
22
FROM INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE
 
23
WHERE CONSTRAINT_SCHEMA = 'test_constaints';
 
24
TABLE_NAME      CONSTRAINT_NAME
 
25
DROP TABLE t2;
 
26
DROP TABLE t1;
 
27
DROP SCHEMA test_constaints;