~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/include/parser_bug21114.inc

Reverted 1103

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Bug#21114 (Foreign key creation fails to table with name format)
3
 
#
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
6
 
#
7
 
# Usage :
8
 
#
9
 
# let $engine_type=InnoDb;
10
 
# let $verbose=1;
11
 
# let $FCT= <value_1>;
12
 
# -- source parser_stress_func.inc
13
 
# let $FCT= <value_2>;
14
 
# -- source parser_stress_func.inc
15
 
# let $verbose=0;
16
 
# let $FCT= <value_3>;
17
 
# -- source parser_stress_func.inc
18
 
# let $FCT= <value_4>;
19
 
# -- source parser_stress_func.inc
20
 
 
21
 
eval drop table if exists $FCT;
22
 
drop table if exists bug21114_child;
23
 
 
24
 
--disable_query_log
25
 
--disable_result_log
26
 
 
27
 
eval CREATE TABLE $FCT(
28
 
  col1 int not null,
29
 
  col2 int not null,
30
 
  col3 varchar(10),
31
 
  CONSTRAINT pk PRIMARY KEY (col1, col2)
32
 
) ENGINE=$engine_type;
33
 
 
34
 
eval CREATE TABLE bug21114_child(
35
 
  pk int not null,
36
 
  fk_col1 int not null,
37
 
  fk_col2 int not null,
38
 
  fk_col3 int not null,
39
 
  fk_col4 int not null,
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;
45
 
 
46
 
--enable_query_log
47
 
--enable_result_log
48
 
 
49
 
if ($verbose)
50
 
{
51
 
  eval SHOW CREATE TABLE $FCT;
52
 
  SHOW CREATE TABLE bug21114_child;
53
 
}
54
 
 
55
 
DROP TABLE bug21114_child;
56
 
eval DROP TABLE $FCT;
57