2
# Bug#21114 (Foreign key creation fails to table with name format)
4
# Trying to trick the parser into thinking $FCT(...) is a function call,
5
# which is not in the CREATE TABLE and FOREIGN KEY ... REFERENCES syntax
9
# let $engine_type=InnoDb;
11
# let $FCT= <value_1>;
12
# -- source parser_stress_func.inc
13
# let $FCT= <value_2>;
14
# -- source parser_stress_func.inc
16
# let $FCT= <value_3>;
17
# -- source parser_stress_func.inc
18
# let $FCT= <value_4>;
19
# -- source parser_stress_func.inc
21
eval drop table if exists $FCT;
22
drop table if exists bug21114_child;
27
eval CREATE TABLE $FCT(
31
CONSTRAINT pk PRIMARY KEY (col1, col2)
32
) ENGINE=$engine_type;
34
eval CREATE TABLE bug21114_child(
40
CONSTRAINT fk_fct FOREIGN KEY (fk_col1, fk_col2)
41
REFERENCES $FCT(col1, col2),
42
CONSTRAINT fk_fct_space FOREIGN KEY (fk_col3, fk_col4)
43
REFERENCES $FCT (col1, col2)
44
) ENGINE=$engine_type;
51
eval SHOW CREATE TABLE $FCT;
52
SHOW CREATE TABLE bug21114_child;
55
DROP TABLE bug21114_child;