1
# Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved.
2
# Use is subject to license terms.
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.
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.
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
18
################################################################################
19
# NOTE: This is an older grammar and should not be prioritized over other
20
# grammars (such as optimizer*subquery, outer_join, range_access)
21
# While this is still an effective testing tool, the grammars listed
22
# above should be run first
23
################################################################################
27
SELECT select_option outer_select_item
29
WHERE subquery_expression outer_logical_expr outer_condition_top
30
outer_having outer_order_by ;
36
OUTR . field_name AS x |
37
aggregate_function OUTR . field_name ) AS x;
41
BIT_AND( | BIT_OR( | BIT_XOR( |
42
COUNT(DISTINCT | COUNT( |
45
STD( | STDDEV_POP( | STDDEV_SAMP( |
47
VAR_POP( | VAR_SAMP( | VARIANCE( |
50
aggregate_function_disabled_unpredictable_value:
54
outer_table_name AS OUTR |
55
outer_table_name AS OUTR2 LEFT JOIN outer_table_name AS OUTR ON ( outer_join_condition );
58
OUTR2 . int_field_name arithmetic_operator OUTR . int_field_name |
59
OUTR2 . date_field_name arithmetic_operator OUTR . date_field_name |
60
OUTR2 . char_field_name arithmetic_operator OUTR . char_field_name ;
63
ORDER BY OUTR . field_name , OUTR . `pk` ;
66
| GROUP BY OUTR . field_name ;
69
| HAVING x arithmetic_operator value;
71
outer_having_disabled_bug38072:
72
| HAVING x arithmetic_operator value ;
79
WHERE inner_condition_top
83
SELECT select_option inner_select_item
87
| ORDER BY INNR . field_name ;
90
INNR . int_field_name AS y ;
93
inner_table_name AS INNR |
94
inner_table_name AS INNR2 LEFT JOIN inner_table_name AS INNR ON ( inner_join_condition );
97
INNR2 . int_field_name arithmetic_operator INNR . int_field_name |
98
INNR2 . char_field_name arithmetic_operator INNR . char_field_name |
99
INNR2 . date_field_name arithmetic_operator INNR . date_field_name ;
102
outer_condition_bottom |
103
( outer_condition_bottom logical_operator outer_condition_bottom ) |
104
outer_condition_bottom logical_operator outer_condition_bottom ;
106
outer_condition_bottom:
110
field_name null_operator |
111
int_field_name int_expression |
112
date_field_name date_expression |
113
char_field_name char_expression ;
116
arithmetic_operator digit ;
119
arithmetic_operator date | BETWEEN date AND date;
122
arithmetic_operator _varchar(1);
127
inner_condition_bottom logical_operator inner_condition_bottom |
128
inner_condition_bottom logical_operator outer_condition_bottom ;
130
inner_condition_bottom:
132
INNR . int_field_name arithmetic_operator INNR . int_field_name |
133
INNR . date_field_name arithmetic_operator INNR . date_field_name |
134
INNR . char_field_name arithmetic_operator INNR . char_field_name ;
136
null_operator: IS NULL | IS NOT NULL ;
139
AND | OR | OR NOT | XOR | AND NOT ;
142
= | > | < | <> | >= | <= ;
145
OUTR . int_field_name IN ( SELECT select_option INNR . int_field_name AS y select_inner_body ) |
146
OUTR . char_field_name IN ( SELECT select_option INNR . char_field_name AS y select_inner_body ) |
147
( 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 ) |
148
( 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 ) ;
151
int_field_name | char_field_name | date_field_name;
154
`pk` | `col_int_key` | `col_int_nokey` ;
157
`col_date_key` | `col_date_nokey` | `col_datetime_key` | `col_datetime_nokey` | `col_time_key` | `col_time_nokey` ;
160
`col_varchar_key` | `col_varchar_nokey` ;
168
value: _digit | _date | _time | _datetime | _varchar(1) | NULL ;