Drizzledump adding extra ')' to CREATE TABLE output when dealing with foreign keys

Bug #685003 reported by Patrick Crews
6
This bug affects 1 person
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='utf8_general_ci';

Related branches

Changed in drizzle:
status: New → Confirmed
assignee: nobody → Andrew Hutchings (linuxjedi)
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

ok, this is due to an epic regex fail :(

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.