foreign key creation fails
Bug #332290 reported by
Marcus Eriksson
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Invalid
|
High
|
Stewart Smith | ||
MySQL Server |
Unknown
|
Unknown
|
Bug Description
CREATE TABLE `messages` (
`message_id` int NOT NULL AUTO_INCREMENT,
`message_text` varchar(255),
`next_message_id` int,
PRIMARY KEY (`message_id`)
) ENGINE=InnoDB
drizzle> alter table messages add constraint fk_next_message foreign key (next_message_id) references messages;
ERROR 1005 (HY000): Can't create table 'hibtest.
Changed in drizzle: | |
assignee: | nobody → stewart-flamingspork |
importance: | Undecided → High |
milestone: | none → cirrus |
Changed in drizzle: | |
milestone: | cirrus → aloha |
To post a comment you must log in.
Confirmed on trunk.
$ ../client/drizzle --user=root --port=9306
Welcome to the Drizzle client.. Commands end with ; or \g.
Your Drizzle connection id is 1
Server version: 7.0.0 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
drizzle> use test
Database changed
drizzle> create table messages (
-> message_id int not null auto_increment,
-> message_text varchar(255),
-> next_message_id int,
-> primary key(message_id)
-> ) engine=innodb;
Query OK, 0 rows affected (0.00 sec)
drizzle> alter table messages add constraint fk_next_message foreign key (next_message_id)
-> references messages;
ERROR 1005 (HY000): Can't create table 'test.#sql-37c_1' (errno: 150)
drizzle>
-Padraig