Drizzledump adding extra ')' to CREATE TABLE output when dealing with foreign keys
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
High
|
Andrew Hutchings | ||
7.0 |
Fix Released
|
High
|
Andrew Hutchings |
Bug Description
Attempting to use drizzledump to dump a MySQL table with a foreign key like this: (including referenced table so it will be useful)
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, PRIMARY KEY(a), KEY b_key1 (b)) ENGINE=Innodb;
CREATE TABLE t2(a INT NOT NULL, b INT , PRIMARY KEY(a), KEY b_key (b),
CONSTRAINT fk_constraint_t2 FOREIGN KEY (b) REFERENCES t1(b) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=Innodb;
Results in drizzledump output like this:
CREATE TABLE `t2` (
`a` INT NOT NULL,
`b` INT DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b_key` (`b`),
CONSTRAINT `fk_constraint_t2` FOREIGN KEY (`b`) REFERENCES `t1` (`b`) ON DELETE SET NULL ON UPDATE CASCADE
) <--- See this little guy here? He don't belong ; )
) ENGINE='InnoDB' COLLATE=
Related branches
- Andrew Hutchings: Needs Fixing
-
Diff: 166 lines (+65/-8)3 files modifiedclient/drizzledump_data.cc (+30/-3)
client/drizzledump_data.h (+3/-1)
client/drizzledump_mysql.cc (+32/-4)
Changed in drizzle: | |
status: | New → Confirmed |
assignee: | nobody → Andrew Hutchings (linuxjedi) |
ok, this is due to an epic regex fail :(