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
2748 Gleb Shchepa 2009-05-18
Bug#40825: Error 1356 while selecting from a view
with a "HAVING" clause though query works
SELECT from views defined like:
CREATE VIEW v1 (view_column)
AS SELECT c AS alias FROM t1 HAVING alias
fails with an error 1356:
View '...' references invalid table(s) or column(s)
or function(s) or definer/invoker of view lack rights
to use them
CREATE VIEW form with a (column list) substitutes
SELECT column names/aliases with names from a
view column list.
However, alias references in HAVING clause was
not substituted.
The Item_ref::print function has been modified
to write correct aliased names of underlying
items into VIEW definition generation/.frm file.
@ mysql-test/r/view.result
Added test file for bug #40825.
@ mysql-test/t/view.test
Added test file for bug #40825.
@ sql/item.cc
Bug#40825: Error 1356 while selecting from a view
with a "HAVING" clause though query works
The Item_ref::print function has been modified
to write correct aliased names of underlying
items into VIEW definition generation/.frm file.
modified:
mysql-test/r/view.result
mysql-test/t/view.test
sql/item.cc
=== 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 push into mysql-5.0-bugteam branch (Sergey.Glukhov:2748 to 2749)Bug#39793 | Sergey Glukhov | 19 May |