summaryrefslogtreecommitdiffstats
path: root/storage/mroonga/mysql-test/mroonga/storage/r/foreign_key_alter_add.result
blob: e2e712af4b6407a72737610bd1a166268be23383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
DROP TABLE IF EXISTS articles;
DROP TABLE IF EXISTS comments;
CREATE TABLE comments (
comment int unsigned PRIMARY KEY,
content text NOT NULL
);
CREATE TABLE articles (
content text NOT NULL,
comment int unsigned
);
ALTER TABLE articles ADD FOREIGN KEY (comment) REFERENCES comments (comment);
SHOW CREATE TABLE articles;
Table	Create Table
articles	CREATE TABLE `articles` (
  `content` text NOT NULL,
  `comment` int(10) unsigned DEFAULT NULL,
  KEY `comment` (`comment`),
  CONSTRAINT `comment` FOREIGN KEY (`comment`) REFERENCES `test`.`comments` (`comment`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=Mroonga DEFAULT CHARSET=latin1
SELECT * FROM information_schema.referential_constraints;
CONSTRAINT_CATALOG	CONSTRAINT_SCHEMA	CONSTRAINT_NAME	UNIQUE_CONSTRAINT_CATALOG	UNIQUE_CONSTRAINT_SCHEMA	UNIQUE_CONSTRAINT_NAME	MATCH_OPTION	UPDATE_RULE	DELETE_RULE	TABLE_NAME	REFERENCED_TABLE_NAME
def	test	comment	def	test	PRIMARY	NONE	RESTRICT	RESTRICT	articles	comments
DROP TABLE articles;
DROP TABLE comments;