~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/randgen/conf/drizzle/subquery_drizzle.yy

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

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: select;
 
19
 
 
20
query_disabled:
 
21
        EXPLAIN select;
 
22
 
 
23
select: 
 
24
        SELECT select_option outer_select_item
 
25
        FROM outer_from
 
26
        WHERE subquery_expression logical_operator outer_condition_top
 
27
        outer_group_by outer_having outer_order_by limit;
 
28
 
 
29
outer_select_item:
 
30
        OUTR . field_name AS X |
 
31
        aggregate_function OUTR . field_name ) AS X;
 
32
 
 
33
aggregate_function:
 
34
        AVG( |
 
35
        COUNT(DISTINCT | COUNT( |
 
36
        MIN( | MIN(DISTINCT |
 
37
        MAX( | MAX(DISTINCT |
 
38
        STD( | STDDEV_POP( | STDDEV_SAMP( |
 
39
        SUM( | SUM(DISTINCT |
 
40
        VAR_POP( | VAR_SAMP( | VARIANCE( ;
 
41
 
 
42
aggregate_function_disabled_false_positives:
 
43
        GROUP_CONCAT( | ;
 
44
 
 
45
aggregate_function_disabled:
 
46
 AVG(DISTINCT ;
 
47
 
 
48
outer_from:
 
49
        outer_table_name AS OUTR ;
 
50
 
 
51
outer_from_disabled_unnecessary_complication:
 
52
        outer_table_name AS OUTR2 LEFT JOIN outer_table_name AS OUTR ON ( outer_join_condition );
 
53
 
 
54
outer_join_condition:
 
55
        OUTR2 . int_field_name arithmetic_operator OUTR . int_field_name |
 
56
        OUTR2 . char_field_name arithmetic_operator OUTR . char_field_name ;
 
57
 
 
58
outer_order_by:
 
59
        ORDER BY OUTR . field_name , OUTR . `pk` ;
 
60
 
 
61
outer_group_by:
 
62
        | GROUP BY OUTR . field_name ;
 
63
 
 
64
outer_group_by_disabled_ha_reset:
 
65
        GROUP BY OUTR . field_name WITH ROLLUP;
 
66
 
 
67
outer_having:
 
68
        | HAVING X arithmetic_operator value ;
 
69
 
 
70
limit:
 
71
        | LIMIT digit ;
 
72
 
 
73
select_inner_body:
 
74
        FROM inner_from
 
75
        WHERE inner_condition_top
 
76
        inner_order_by;
 
77
 
 
78
select_inner:
 
79
        SELECT select_option inner_select_item
 
80
        select_inner_body;
 
81
 
 
82
select_inner_one_row:
 
83
        SELECT select_option inner_select_item
 
84
        select_inner_body LIMIT 1;
 
85
 
 
86
select_inner_two_cols:
 
87
        SELECT select_option inner_select_item , INNR . field_name AS Z 
 
88
        select_inner_body;
 
89
 
 
90
inner_order_by:
 
91
        | ORDER BY INNR . field_name ;
 
92
 
 
93
inner_group_by:
 
94
        | | | ;
 
95
inner_group_by_disabled:
 
96
        | GROUP BY INNR . field_name |
 
97
        GROUP BY INNR . field_name WITH ROLLUP;
 
98
 
 
99
inner_having:
 
100
        | | | HAVING X arithmetic_operator value;
 
101
 
 
102
inner_select_item:
 
103
        INNR . field_name AS Y ;
 
104
 
 
105
inner_select_item_disabled_causes_semijoin_not_to_kick_in;
 
106
        aggregate_function INNR . field_name ) AS Y ;
 
107
 
 
108
inner_from:
 
109
        inner_table_name AS INNR ;
 
110
 
 
111
inner_from_disabled_unnecessary_complication:
 
112
        inner_table_name AS INNR2 LEFT JOIN inner_table_name AS INNR ON ( inner_join_condition );
 
113
 
 
114
inner_join_condition:
 
115
        INNR2 . int_field_name arithmetic_operator INNR . int_field_name |
 
116
        INNR2 . char_field_name arithmetic_operator INNR . char_field_name ;
 
117
 
 
118
outer_condition_top:
 
119
        outer_condition_bottom |
 
120
        ( outer_condition_bottom logical_operator outer_condition_bottom ) |
 
121
        outer_condition_bottom logical_operator outer_condition_bottom ;
 
122
 
 
123
outer_condition_bottom:
 
124
        OUTR . expression ;
 
125
 
 
126
expression:
 
127
        field_name null_operator |
 
128
        int_field_name int_expression |
 
129
        char_field_name char_expression ;
 
130
 
 
131
int_expression:
 
132
        arithmetic_operator digit ;
 
133
 
 
134
char_expression:
 
135
        arithmetic_operator _char(1);
 
136
 
 
137
inner_condition_top:
 
138
        INNR . expression |
 
139
        OUTR . expression |
 
140
        inner_condition_bottom logical_operator inner_condition_bottom |
 
141
        inner_condition_bottom logical_operator outer_condition_bottom ;
 
142
 
 
143
inner_condition_bottom:
 
144
        INNR . expression |
 
145
        INNR . int_field_name arithmetic_operator INNR . int_field_name |
 
146
        INNR . char_field_name arithmetic_operator INNR . char_field_name;
 
147
 
 
148
null_operator: IS NULL | IS NOT NULL ;
 
149
 
 
150
logical_operator: AND | OR | OR NOT;
 
151
 
 
152
logical_operator_disabled_bug37899: XOR;
 
153
 
 
154
logical_operator_disabled_bug37896: AND NOT ;
 
155
 
 
156
arithmetic_operator: = | > | < | <> | >= | <= ;
 
157
 
 
158
subquery_expression:
 
159
        EXISTS ( select_inner ) |
 
160
        NOT EXISTS ( select_inner ) |
 
161
        OUTR . field_name IN ( select_inner ) |
 
162
        ( OUTR . field_name , OUTR . field_name ) IN ( select_inner_two_cols ) |
 
163
        OUTR . field_name NOT IN ( select_inner ) |
 
164
        ( OUTR . field_name , OUTR . field_name ) NOT IN ( select_inner_two_cols ) |
 
165
        OUTR . field_name arithmetic_operator ( select_inner_one_row ) |
 
166
        OUTR . field_name arithmetic_operator subquery_word ( select_inner );
 
167
 
 
168
subquery_expression_disabled_crash_in_item_subselect:
 
169
        value IN ( select_inner );
 
170
 
 
171
subquery_expression_disabled_bug37894:
 
172
        value NOT IN ( select_inner );
 
173
 
 
174
subquery_word: SOME | ANY | ALL ;
 
175
 
 
176
field_name:
 
177
        int_field_name | char_field_name;
 
178
 
 
179
field_name_disabled_Field_newdate_assert: date_field_name;
 
180
 
 
181
# dates are disabled as they aren't in the
 
182
# gendata file (drizzle.zz)
 
183
date_field_name_disabled:
 
184
        `col_date_key` | `col_date_nokey` ;
 
185
 
 
186
date_field_name_disabled_Field_datetime_assert:
 
187
        `col_datetime_key` | `col_datetime_nokey` ;
 
188
 
 
189
date_field_name_disabled_convert_const_item:
 
190
        `col_time_key` ,
 
191
        `col_time_nokey` ;
 
192
 
 
193
int_field_name:
 
194
    `pk` | `col_int_key` | `col_int` |
 
195
    `col_bigint` | `col_bigint_key` |
 
196
    `col_int_not_null` | `col_int_not_null_key` ;
 
197
 
 
198
char_field_name:
 
199
        `col_char` | `col_text_not_null` | `col_text_not_null_key` |
 
200
        `col_text_key` | `col_text` | `col_char_not_null_key` | `col_char_not_null` ;
 
201
 
 
202
char_field_name_disabled:
 
203
# need to explore enum more before enabling this
 
204
        `col_enum` | `col_enum_key` | `col_enum_not_null` | `col_enum_not_null_key` ;
 
205
 
 
206
outer_table_name:
 
207
        AA | BB | small_table ;
 
208
 
 
209
inner_table_name:
 
210
        BB | CC | DD | small_table ;
 
211
 
 
212
small_table:
 
213
        A | B | C | C | C | D | D | D ;
 
214
 
 
215
value: _digit | _date | _time | _datetime | _char(1) | NULL ;
 
216
 
 
217
select_option: | ;
 
218
 
 
219
select_option_disabled_triggers_materialization_assert:
 
220
        | DISTINCT ;