mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
384407aaeb
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
59 lines
1.3 KiB
SQL
Executable file
59 lines
1.3 KiB
SQL
Executable file
#
|
|
# 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;
|
|
|