List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:May 19 2009 6:32am
Subject:bzr commit into mysql-5.0-bugteam branch (Sergey.Glukhov:2749)
Bug#39793
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.0-bugteam/ based on revid:gshchepa@stripped

 2749 Sergey Glukhov	2009-05-19
      Bug#39793 Foreign keys not constructed when column has a '#' in a comment or default value
      Internal InnoDN FK parser does not recognize '\'' as quotation symbol.
      Suggested fix is to add '\'' symbol check for quotation condition
      (dict_strip_comments() function).
     @ innobase/dict/dict0dict.c
        Internal InnoDN FK parser does not recognize '\'' as quotation symbol.
        Suggested fix is to add '\'' symbol check for quotation condition
        (dict_strip_comments() function).
     @ mysql-test/r/innodb_mysql.result
        test result
     @ mysql-test/t/innodb_mysql.test
        test case

    modified:
      innobase/dict/dict0dict.c
      mysql-test/r/innodb_mysql.result
      mysql-test/t/innodb_mysql.test
=== modified file 'innobase/dict/dict0dict.c'
--- a/innobase/dict/dict0dict.c	2008-12-13 00:40:31 +0000
+++ b/innobase/dict/dict0dict.c	2009-05-19 06:32:21 +0000
@@ -2829,7 +2829,7 @@ scan_more:
 		} else if (quote) {
 			/* Within quotes: do not look for
 			starting quotes or comments. */
-		} else if (*sptr == '"' || *sptr == '`') {
+		} else if (*sptr == '"' || *sptr == '`' || *sptr == '\'') {
 			/* Starting quote: remember the quote character. */
 			quote = *sptr;
 		} else if (*sptr == '#'

=== modified file 'mysql-test/r/innodb_mysql.result'
--- a/mysql-test/r/innodb_mysql.result	2009-03-27 06:24:32 +0000
+++ b/mysql-test/r/innodb_mysql.result	2009-05-19 06:32:21 +0000
@@ -1291,4 +1291,16 @@ SAVEPOINT s4;
 ROLLBACK;
 ROLLBACK TO SAVEPOINT s4;
 ERROR 42000: SAVEPOINT s4 does not exist
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY COMMENT 'My ID#', f2 INTEGER DEFAULT NULL, f3 CHAR(10) DEFAULT 'My ID#', CONSTRAINT f2_ref FOREIGN KEY (f2) REFERENCES t1 (f1)) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f1` int(11) NOT NULL COMMENT 'My ID#',
+  `f2` int(11) default NULL,
+  `f3` char(10) default 'My ID#',
+  PRIMARY KEY  (`f1`),
+  KEY `f2_ref` (`f2`),
+  CONSTRAINT `f2_ref` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
 End of 5.0 tests

=== modified file 'mysql-test/t/innodb_mysql.test'
--- a/mysql-test/t/innodb_mysql.test	2009-03-27 06:24:32 +0000
+++ b/mysql-test/t/innodb_mysql.test	2009-05-19 06:32:21 +0000
@@ -1054,4 +1054,13 @@ ROLLBACK;
 --error 1305
 ROLLBACK TO SAVEPOINT s4;
 
+#
+# Bug#39793 Foreign keys not constructed when column has a '#' in a comment or default value
+#
+
+#This statement should be written on a single line for proper testing
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY COMMENT 'My ID#', f2 INTEGER DEFAULT NULL, f3 CHAR(10) DEFAULT 'My ID#', CONSTRAINT f2_ref FOREIGN KEY (f2) REFERENCES t1 (f1)) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
 --echo End of 5.0 tests


Attachment: [text/bzr-bundle] bzr/sergey.glukhov@sun.com-20090519063221-y5h10oavajlwnrkv.bundle
Thread
bzr commit into mysql-5.0-bugteam branch (Sergey.Glukhov:2749)Bug#39793Sergey Glukhov19 May