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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.2.11) (2.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20120619104649-9ij634mxm4x8pp4l
Tags: 1:7.1.36-stable-1ubuntu1
* Merge from Debian unstable. (LP: #987575)
  Remaining changes:
  - Added upstart script.
* debian/drizzle.upstart: dropped logger since upstart logs job
  output now.

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