~ubuntu-branches/ubuntu/vivid/drizzle/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/test_tools/randgen/conf/drizzle/subquery_semijoin_nested_drizzle.yy

  • Committer: Package Import Robot
  • Author(s): Tobias Frost
  • Date: 2013-08-22 20:18:31 UTC
  • mto: (20.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20130822201831-gn3ozsh7o7wmc5tk
Tags: upstream-7.2.3
ImportĀ upstreamĀ versionĀ 7.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2009 Sun Microsystems, Inc. All rights reserved.
 
2
# Use is subject to license terms.
 
3
#
 
4
# This program is free software; you can redistribute it and/or modify
 
5
# it under the terms of the GNU General Public License as published by
 
6
# the Free Software Foundation; version 2 of the License.
 
7
#
 
8
# This program is distributed in the hope that it will be useful, but
 
9
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
11
# General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
 
16
# USA
 
17
 
 
18
query:
 
19
        SELECT select_option grandparent_select_items
 
20
        FROM grandparent_from
 
21
        grandparent_where 
 
22
        grandparent_group_having_order_limit;
 
23
 
 
24
grandparent_select_items:
 
25
        grandparent_select_item;
 
26
 
 
27
grandparent_select_item:
 
28
        GRANDPARENT1 . field_name AS G1;
 
29
 
 
30
grandparent_from:
 
31
        table_name AS GRANDPARENT1 |
 
32
        table_name AS GRANDPARENT1 LEFT JOIN table_name AS GRANDPARENT2 USING ( field_name ) |
 
33
        table_name AS GRANDPARENT1 LEFT JOIN table_name AS GRANDPARENT2 ON ( grandparent_join_condition );
 
34
 
 
35
grandparent_join_condition:
 
36
        GRANDPARENT2 . int_field_name arithmetic_operator GRANDPARENT1 . int_field_name |
 
37
        GRANDPARENT2 . char_field_name arithmetic_operator GRANDPARENT1 . char_field_name ;
 
38
 
 
39
grandparent_where:
 
40
        WHERE grandparent_subquery_expr AND grandparent_condition ;
 
41
 
 
42
grandparent_subquery_expr:
 
43
        GRANDPARENT1 . int_field_name IN ( SELECT select_option PARENT1 . int_field_name AS P1 parent_select_body ) |
 
44
        GRANDPARENT1 . char_field_name IN ( SELECT select_option PARENT1 . char_field_name AS P1 parent_select_body ) |
 
45
        ( GRANDPARENT1 . int_field_name , GRANDPARENT1 . int_field_name ) IN ( SELECT select_option PARENT1 . int_field_name AS P1 , PARENT1 . int_field_name AS P2 parent_select_body ) |
 
46
        ( GRANDPARENT1 . char_field_name , GRANDPARENT1 . char_field_name ) IN ( SELECT select_option PARENT1 . char_field_name AS P1 , PARENT1 . char_field_name AS P2 parent_select_body ) ;
 
47
 
 
48
grandparent_group_having_order_limit:
 
49
        grandparent_group_by grandparent_having grandparent_order_by grandparent_limit |
 
50
        grandparent_group_by grandparent_having grandparent_limit |
 
51
        grandparent_having grandparent_order_by grandparent_limit |
 
52
        grandparent_having ;
 
53
 
 
54
grandparent_group_by:
 
55
        GROUP BY GRANDPARENT1 . field_name ;
 
56
 
 
57
grandparent_order_by:
 
58
        ORDER BY GRANDPARENT1 . field_name ;
 
59
 
 
60
grandparent_having:
 
61
        | HAVING G1 arithmetic_operator value;
 
62
 
 
63
grandparent_limit:
 
64
        | LIMIT digit ;
 
65
 
 
66
parent_select_body:
 
67
        FROM parent_from
 
68
        parent_where
 
69
        parent_order_by;
 
70
 
 
71
parent_from:
 
72
        table_name AS PARENT1 |
 
73
        table_name AS PARENT1 LEFT JOIN table_name AS PARENT2 USING ( field_name ) |
 
74
        table_name AS PARENT1 LEFT JOIN table_name AS PARENT2 ON ( parent_join_condition ) ;
 
75
 
 
76
parent_join_condition:
 
77
        PARENT1 . int_field_name arithmetic_operator PARENT2 . int_field_name |
 
78
        PARENT1 . char_field_name arithmetic_operator PARENT2 . char_field_name ;
 
79
 
 
80
parent_where:
 
81
        | WHERE parent_subquery_expr AND parent_condition
 
82
        | WHERE parent_condition ;
 
83
 
 
84
parent_order_by:
 
85
        | ORDER BY PARENT1 . field_name ;
 
86
 
 
87
parent_subquery_expr:
 
88
        PARENT1 . int_field_name IN ( SELECT select_option CHILD1 . int_field_name AS C1 child_select_body ) |
 
89
        GRANDPARENT1 . int_field_name IN ( SELECT select_option CHILD1 . int_field_name AS C1 child_select_body ) |
 
90
 
 
91
        PARENT1 . char_field_name IN ( SELECT select_option CHILD1 . char_field_name AS C1 child_select_body ) |
 
92
        GRANDPARENT1 . char_field_name IN ( SELECT select_option CHILD1 . char_field_name AS C1 child_select_body ) |
 
93
 
 
94
        ( PARENT1 . int_field_name , PARENT1 . int_field_name ) IN ( SELECT select_option CHILD1 . int_field_name AS C1 , CHILD1 . int_field_name AS C2 child_select_body ) |
 
95
        ( PARENT1 . int_field_name , GRANDPARENT1 . int_field_name ) IN ( SELECT select_option CHILD1 . int_field_name AS C1 , CHILD1 . int_field_name AS C2 child_select_body ) |
 
96
 
 
97
        ( PARENT1 . char_field_name , PARENT1 . char_field_name ) IN ( SELECT select_option CHILD1 . char_field_name AS C1 , CHILD1 . char_field_name AS C2 child_select_body ) ;
 
98
        ( PARENT1 . char_field_name , GRANDPARENT1 . char_field_name ) IN ( SELECT select_option CHILD1 . char_field_name AS C1 , CHILD1 . char_field_name AS C2 child_select_body ) ;
 
99
 
 
100
        ( PARENT1 . char_field_name , PARENT1 . char_field_name ) IN ( SELECT select_option CHILD1 . char_field_name AS C1 , CHILD1 . char_field_name AS C2 child_select_body ) ;
 
101
        ( PARENT1 . int_field_name , PARENT1 . int_field_name ) IN ( SELECT select_option CHILD1 . int_field_name AS C1 , CHILD1 . int_field_name AS C2 child_select_body ) ;
 
102
 
 
103
child_select_body:
 
104
        FROM child_from
 
105
        child_where
 
106
        child_order_by;
 
107
 
 
108
child_from:
 
109
        table_name AS CHILD1 |
 
110
        table_name AS CHILD1 LEFT JOIN table_name AS CHILD2 USING ( field_name ) |
 
111
        table_name AS CHILD1 LEFT JOIN table_name AS CHILD2 ON ( child_join_condition ) ;
 
112
 
 
113
child_join_condition:
 
114
        CHILD1 . int_field_name arithmetic_operator CHILD2 . int_field_name |
 
115
        CHILD1 . char_field_name arithmetic_operator CHILD2 . char_field_name ;
 
116
 
 
117
child_where:
 
118
        | WHERE child_condition ;
 
119
 
 
120
child_order_by:
 
121
        | ORDER BY CHILD1 . field_name ;
 
122
 
 
123
child_condition:
 
124
        ( GRANDPARENT1 . expression ) |
 
125
        ( PARENT1 . expression ) |
 
126
        ( CHILD1 . expression ) |
 
127
        ( child_condition_bottom logical_operator child_condition ) |
 
128
        ( child_condition_bottom logical_operator parent_condition ) |
 
129
        ( child_condition_bottom logical_operator grandparent_condition ) ;
 
130
 
 
131
child_condition_bottom:
 
132
 
 
133
        ( CHILD1 . expression ) |
 
134
 
 
135
        ( CHILD1 . int_field_name arithmetic_operator CHILD1 . int_field_name ) |
 
136
        ( CHILD1 . char_field_name arithmetic_operator CHILD1 . char_field_name ) |
 
137
 
 
138
        ( CHILD1 . int_field_name arithmetic_operator PARENT1 . int_field_name ) |
 
139
        ( CHILD1 . char_field_name arithmetic_operator PARENT1 . char_field_name ) |
 
140
 
 
141
        ( CHILD1 . int_field_name arithmetic_operator GRANDPARENT1 . int_field_name ) |
 
142
        ( CHILD1 . char_field_name arithmetic_operator GRANDPARENT1 . char_field_name ) ;
 
143
 
 
144
grandparent_condition:
 
145
        grandparent_condition_bottom |
 
146
        ( grandparent_condition logical_operator grandparent_condition_bottom ) ;
 
147
 
 
148
grandparent_condition_bottom:
 
149
        GRANDPARENT1 . expression ;
 
150
        
 
151
expression:
 
152
        field_name null_operator |
 
153
        int_field_name int_expression |
 
154
        char_field_name char_expression ;
 
155
 
 
156
int_expression:
 
157
        arithmetic_operator digit ;
 
158
 
 
159
 
 
160
char_expression:
 
161
        arithmetic_operator _varchar(1);
 
162
 
 
163
parent_condition:
 
164
        ( GRANDPARENT1 . expression ) |
 
165
        ( PARENT1 . expression ) |
 
166
        ( parent_condition_bottom logical_operator parent_condition ) |
 
167
        ( parent_condition_bottom logical_operator grandparent_condition ) ;
 
168
 
 
169
parent_condition_bottom:
 
170
        ( PARENT1 . expression ) |
 
171
 
 
172
        ( PARENT1 . int_field_name arithmetic_operator PARENT1 . int_field_name ) |
 
173
        ( PARENT1 . char_field_name arithmetic_operator PARENT1 . char_field_name ) |
 
174
 
 
175
        ( PARENT1 . int_field_name arithmetic_operator GRANDPARENT1 . int_field_name ) |
 
176
        ( PARENT1 . char_field_name arithmetic_operator GRANDPARENT1 . char_field_name ) ;
 
177
 
 
178
null_operator: IS NULL | IS NOT NULL | IS UNKNOWN ;
 
179
 
 
180
logical_operator:
 
181
        AND | OR | OR NOT;
 
182
 
 
183
arithmetic_operator: = | > | < | <> | >= | <= ;
 
184
 
 
185
field_name:
 
186
        int_field_name | char_field_name ;
 
187
 
 
188
int_field_name:
 
189
    `pk` | `col_int_key` | `col_int` |
 
190
    `col_bigint` | `col_bigint_key` | 
 
191
    `col_int_not_null` | `col_int_not_null_key` ;
 
192
 
 
193
char_field_name:
 
194
        `col_char_10` | `col_char_10_key` | `col_text_not_null` | `col_text_not_null_key` |
 
195
        `col_text_key` | `col_text` | `col_char_10_not_null_key` | `col_char_10_not_null` |
 
196
        `col_char_1024` | `col_char_1024_key` | `col_char_1024_not_null` | `col_char_1024_not_null_key` ;
 
197
 
 
198
char_field_name_disabled: 
 
199
# need to explore enum more before enabling this 
 
200
        `col_enum` | `col_enum_key` | `col_enum_not_null` | `col_enum_not_null_key` ;
 
201
 
 
202
table_name:
 
203
        AA | BB | CC | DD | AA | BB | CC | DD | C | D | C | D | A | B ;
 
204
 
 
205
value: _digit | _date | _time | _datetime | _varchar(1) | NULL ;
 
206
 
 
207
select_option: 
 
208
        | DISTINCT ;