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
22
eval drop table if exists $FCT;
23
drop table if exists bug21114_child;
29
eval CREATE TABLE $FCT(
33
CONSTRAINT pk PRIMARY KEY (col1, col2)
34
) ENGINE $engine_type;
36
eval CREATE TABLE bug21114_child(
42
CONSTRAINT fk_fct FOREIGN KEY (fk_col1, fk_col2)
43
REFERENCES $FCT(col1, col2),
44
CONSTRAINT fk_fct_space FOREIGN KEY (fk_col3, fk_col4)
45
REFERENCES $FCT (col1, col2)
46
) ENGINE $engine_type;
53
eval SHOW CREATE TABLE $FCT;
54
SHOW CREATE TABLE bug21114_child;
57
DROP TABLE bug21114_child;