David Kellerman
Joined: 19 Jun 2009 Posts: 1
|
Posted: Fri Jun 19, 2009 2:54 am Post subject: MySQL 5.1-23-RC ALTER TABLE problem |
|
|
Hi,
I've been using MySQL 5.1-23-RC for several months now with no problems, but I'm having problems using it with a new application (JAMWiki).
The database definitions have some circular FOREIGN KEY references, and the application uses ALTER TABLE commands to set these up. One of the tables ends up with a CONSTRAINT that has a bad table reference. (It looks like a temporary table name of some sort.)
Here's a stripped down test case that shows the problem:
Code: |
CREATE TABLE jam_topic (
topic_id INTEGER NOT NULL,
current_version_id INTEGER,
CONSTRAINT jam_p_topic PRIMARY KEY (topic_id)
);
CREATE TABLE jam_topic_version (
topic_version_id INTEGER NOT NULL,
topic_id INTEGER NOT NULL,
CONSTRAINT jam_p_topic_ver PRIMARY KEY (topic_version_id),
CONSTRAINT jam_f_topicv_topic FOREIGN KEY (topic_id) REFERENCES jam_topic(topic_id)
);
|
The output from a SHOW CREATE TABLE (cleaned up a bit):
Code: |
CREATE TABLE "jam_topic_version" (
"topic_version_id" int(11) NOT NULL,
"topic_id" int(11) NOT NULL,
PRIMARY KEY ("topic_version_id"),
KEY "jam_f_topicv_topic" ("topic_id"),
CONSTRAINT "jam_f_topicv_topic" FOREIGN KEY ("topic_id")
REFERENCES "_sql2-20e0043c-209" ("topic_id")
)
CREATE TABLE "jam_topic" (
"topic_id" int(11) NOT NULL,
"current_version_id" int(11) DEFAULT NULL,
PRIMARY
KEY ("topic_id"),
KEY "jam_f_topic_topicv" ("current_version_id"),
CONSTRAINT "jam_f_topic_topicv" FOREIGN KEY ("current_version_id")
REFERENCES "jam_topic_version" ("topic_version_id")
)
|
Can someone tell me if this a known problem with the 5.1-23-RC release, or if I have something messed up in my configuration?
Thanks,
David |
|