~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/randgen/conf/drizzle/subquery_materialization_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
# Note: usage of date/time columns has been removed
 
19
# for the time being.  Feel free to experiment to
 
20
# add them back in later.  This would require altering
 
21
# the gendata file, conf/drizzle/drizzle.zz
 
22
 
 
23
# meant to be run with the gendata file: conf/drizzle/drizzle.zz
 
24
 
 
25
 
 
26
query:
 
27
        SELECT select_option outer_select_item
 
28
        FROM outer_from
 
29
        WHERE subquery_expression outer_logical_expr outer_condition_top
 
30
        outer_having outer_order_by ;
 
31
 
 
32
outer_logical_expr:
 
33
        AND | OR | XOR ;
 
34
 
 
35
outer_select_item:
 
36
        OUTR . field_name AS X |
 
37
        aggregate_function OUTR . field_name ) AS X;
 
38
 
 
39
aggregate_function:
 
40
        AVG( |
 
41
        COUNT(DISTINCT | COUNT( |
 
42
        MIN( | MIN(DISTINCT |
 
43
        MAX( | MAX(DISTINCT |
 
44
        STD( | STDDEV_POP( | STDDEV_SAMP( |
 
45
        SUM( | SUM(DISTINCT |
 
46
        VAR_POP( | VAR_SAMP( | VARIANCE( |
 
47
        AVG(DISTINCT ;
 
48
 
 
49
aggregate_function_disabled_unpredictable_value:
 
50
        GROUP_CONCAT( | ;
 
51
 
 
52
outer_from:
 
53
        outer_table_name AS OUTR |
 
54
        outer_table_name AS OUTR2 LEFT JOIN outer_table_name AS OUTR ON ( outer_join_condition );
 
55
 
 
56
outer_join_condition:
 
57
        OUTR2 . int_field_name arithmetic_operator OUTR . int_field_name |
 
58
        OUTR2 . char_field_name arithmetic_operator OUTR . char_field_name ;
 
59
 
 
60
outer_order_by:
 
61
        ORDER BY OUTR . field_name , OUTR . `pk` ;
 
62
 
 
63
outer_group_by:
 
64
        | GROUP BY OUTR . field_name ;
 
65
 
 
66
outer_having:
 
67
        | HAVING X arithmetic_operator value;
 
68
 
 
69
outer_having_disabled_bug38072:
 
70
        | HAVING X arithmetic_operator value ;
 
71
 
 
72
limit:
 
73
        | LIMIT digit ;
 
74
 
 
75
select_inner_body:
 
76
        FROM inner_from
 
77
        WHERE inner_condition_top
 
78
        inner_order_by;
 
79
 
 
80
select_inner:
 
81
        SELECT select_option inner_select_item
 
82
        select_inner_body;
 
83
 
 
84
inner_order_by:
 
85
        | ORDER BY INNR . field_name ;
 
86
 
 
87
inner_select_item:
 
88
        INNR . int_field_name AS Y ;
 
89
 
 
90
inner_from:
 
91
        inner_table_name AS INNR |
 
92
        inner_table_name AS INNR2 LEFT JOIN inner_table_name AS INNR ON ( inner_join_condition );
 
93
 
 
94
inner_join_condition:
 
95
        INNR2 . int_field_name arithmetic_operator INNR . int_field_name |
 
96
        INNR2 . char_field_name arithmetic_operator INNR . char_field_name ; 
 
97
 
 
98
outer_condition_top:
 
99
        outer_condition_bottom |
 
100
        ( outer_condition_bottom logical_operator outer_condition_bottom ) |
 
101
        outer_condition_bottom logical_operator outer_condition_bottom ;
 
102
 
 
103
outer_condition_bottom:
 
104
        OUTR . expression ;
 
105
 
 
106
expression:
 
107
        field_name null_operator |
 
108
        int_field_name int_expression |
 
109
        char_field_name char_expression ;
 
110
 
 
111
int_expression:
 
112
        arithmetic_operator digit ;
 
113
 
 
114
 
 
115
char_expression:
 
116
        arithmetic_operator _varchar(1);
 
117
 
 
118
inner_condition_top:
 
119
        INNR . expression |
 
120
        OUTR . expression |
 
121
        inner_condition_bottom logical_operator inner_condition_bottom |
 
122
        inner_condition_bottom logical_operator outer_condition_bottom ;
 
123
 
 
124
inner_condition_bottom:
 
125
        INNR . expression |
 
126
        INNR . int_field_name arithmetic_operator INNR . int_field_name |
 
127
        INNR . char_field_name arithmetic_operator INNR . char_field_name ;
 
128
 
 
129
null_operator: IS NULL | IS NOT NULL ;
 
130
 
 
131
logical_operator:
 
132
        AND | OR | OR NOT | XOR | AND NOT ;
 
133
 
 
134
arithmetic_operator:
 
135
        = | > | < | <> | >= | <= ;
 
136
 
 
137
subquery_expression:
 
138
        OUTR . int_field_name IN ( SELECT select_option INNR . int_field_name AS Y select_inner_body ) |
 
139
        OUTR . char_field_name IN ( SELECT select_option INNR . char_field_name AS Y select_inner_body ) |
 
140
        ( OUTR . int_field_name , OUTR . int_field_name ) IN ( SELECT select_option INNR . int_field_name AS X , INNR . int_field_name AS Y select_inner_body ) |
 
141
        ( OUTR . char_field_name , OUTR . char_field_name ) IN ( SELECT select_option INNR . char_field_name AS X , INNR . char_field_name AS Y select_inner_body ) ;
 
142
 
 
143
field_name:
 
144
        int_field_name | char_field_name ;
 
145
 
 
146
int_field_name:
 
147
    `pk` | `col_int_key` | `col_int` |
 
148
    `col_bigint` | `col_bigint_key` |
 
149
    `col_int_not_null` | `col_int_not_null_key` ;
 
150
 
 
151
char_field_name:
 
152
        `col_char_10` | `col_char_10_key` | `col_text_not_null` | `col_text_not_null_key` |
 
153
        `col_text_key` | `col_text` | `col_char_10_not_null_key` | `col_char_10_not_null` |
 
154
        `col_char_1024` | `col_char_1024_key` | `col_char_1024_not_null` | `col_char_1024_not_null_key` ;
 
155
 
 
156
char_field_name_disabled:
 
157
# need to explore enum more before enabling this
 
158
        `col_enum` | `col_enum_key` | `col_enum_not_null` | `col_enum_not_null_key` ;
 
159
 
 
160
outer_table_name:
 
161
        AA | BB | AA | BB | C | D | CC | DD | A ;
 
162
 
 
163
inner_table_name:
 
164
        BB | CC | DD | BB | CC | DD | C | D | A ;
 
165
 
 
166
value: _digit | _date | _time | _datetime | _varchar(1) | NULL ;
 
167
 
 
168
select_option: 
 
169
        | DISTINCT ;