summaryrefslogtreecommitdiff
path: root/mysql-test/include/parser_bug21114.inc
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2006-11-02 11:01:53 -0700
committerunknown <malff/marcsql@weblab.(none)>2006-11-02 11:01:53 -0700
commit384407aaeb37dafe4826c31006cd47c611da0da2 (patch)
tree6858415854d15b55cafbf65946d71a1878a9459b /mysql-test/include/parser_bug21114.inc
parent83d5beec5d93b950684a88d64657ef771ed9008d (diff)
downloadmariadb-git-384407aaeb37dafe4826c31006cd47c611da0da2.tar.gz
Bug#21114 (Foreign key creation fails to table with name format)
Due to the complexity of this change, everything is documented in WL#3565 This patch is the third iteration, it takes into account the comments received to date. mysql-test/r/func_math.result: Improved test coverage mysql-test/r/view.result: Name collision, x() is a geometry native in function mysql-test/t/func_math.test: Improved test coverage mysql-test/t/view.test: Name collision, x() is a geometry native in function sql/item_create.cc: Revised the create_func implementation sql/item_create.h: Revised the create_func implementation sql/item_geofunc.h: Explicit Item allocation in the thread memory pool. sql/lex.h: Removed function parsing from the lexical parser sql/lex_symbol.h: Removed function parsing from the lexical parser sql/mysql_priv.h: Server initialization and shutdown sql/mysqld.cc: Server initialization and shutdown sql/share/errmsg.txt: New error messages sql/sql_yacc.yy: Removed function parsing from the lexical parser tests/mysql_client_test.c: Spaces are no longer significant for function calls mysql-test/include/parser_bug21114.inc: New tests mysql-test/r/parser.result: New tests mysql-test/r/parser_bug21114_innodb.result: New tests mysql-test/t/parser.test: New tests mysql-test/t/parser_bug21114_innodb.test: New tests
Diffstat (limited to 'mysql-test/include/parser_bug21114.inc')
-rwxr-xr-xmysql-test/include/parser_bug21114.inc59
1 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/include/parser_bug21114.inc b/mysql-test/include/parser_bug21114.inc
new file mode 100755
index 00000000000..eb709d5cc03
--- /dev/null
+++ b/mysql-test/include/parser_bug21114.inc
@@ -0,0 +1,59 @@
+#
+# Bug#21114 (Foreign key creation fails to table with name format)
+#
+# Trying to trick the parser into thinking $FCT(...) is a function call,
+# which is not in the CREATE TABLE and FOREIGN KEY ... REFERENCES syntax
+#
+# Usage :
+#
+# let $engine_type=InnoDb;
+# let $verbose=1;
+# let $FCT= <value_1>;
+# -- source parser_stress_func.inc
+# let $FCT= <value_2>;
+# -- source parser_stress_func.inc
+# let $verbose=0;
+# let $FCT= <value_3>;
+# -- source parser_stress_func.inc
+# let $FCT= <value_4>;
+# -- source parser_stress_func.inc
+
+-- disable_warnings
+eval drop table if exists $FCT;
+drop table if exists bug21114_child;
+-- enable_warnings
+
+--disable_query_log
+--disable_result_log
+
+eval CREATE TABLE $FCT(
+ col1 int not null,
+ col2 int not null,
+ col3 varchar(10),
+ CONSTRAINT pk PRIMARY KEY (col1, col2)
+) ENGINE $engine_type;
+
+eval CREATE TABLE bug21114_child(
+ pk int not null,
+ fk_col1 int not null,
+ fk_col2 int not null,
+ fk_col3 int not null,
+ fk_col4 int not null,
+ CONSTRAINT fk_fct FOREIGN KEY (fk_col1, fk_col2)
+ REFERENCES $FCT(col1, col2),
+ CONSTRAINT fk_fct_space FOREIGN KEY (fk_col3, fk_col4)
+ REFERENCES $FCT (col1, col2)
+) ENGINE $engine_type;
+
+--enable_query_log
+--enable_result_log
+
+if ($verbose)
+{
+ eval SHOW CREATE TABLE $FCT;
+ SHOW CREATE TABLE bug21114_child;
+}
+
+DROP TABLE bug21114_child;
+eval DROP TABLE $FCT;
+