summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-05-13 14:04:32 +0300
committermonty@mysql.com <>2005-05-13 14:04:32 +0300
commitb54d7d04bd13498b5bc5e8e109f5690aeb10ec5d (patch)
treee79a2291f34c9b4f5b7aa00b0d318368038008da /sql/sql_yacc.yy
parent1494f0ab6815075840728839dad528a37082def6 (diff)
downloadmariadb-git-b54d7d04bd13498b5bc5e8e109f5690aeb10ec5d.tar.gz
Fixes during review
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy29
1 files changed, 10 insertions, 19 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index abe7a716a69..28d3560e5f0 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2467,7 +2467,14 @@ select_from:
select_options:
/* empty*/
- | select_option_list;
+ | select_option_list
+ {
+ if (test_all_bits(Select->options, SELECT_ALL | SELECT_DISTINCT))
+ {
+ net_printf(Lex->thd, ER_WRONG_USAGE, "ALL", "DISTINCT");
+ YYABORT;
+ }
+ }
select_option_list:
select_option_list select_option
@@ -2481,15 +2488,7 @@ select_option:
YYABORT;
Lex->lock_option= TL_READ_HIGH_PRIORITY;
}
- | DISTINCT
- {
- if (Select->options & SELECT_ALL)
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- Select->options|= SELECT_DISTINCT;
- }
+ | DISTINCT { Select->options|= SELECT_DISTINCT; }
| SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; }
| SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; }
| SQL_BUFFER_RESULT
@@ -2509,15 +2508,7 @@ select_option:
{
Lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
}
- | ALL
- {
- if (Select->options & SELECT_DISTINCT)
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- Select->options|= SELECT_ALL;
- }
+ | ALL { Select->options|= SELECT_ALL; }
;
select_lock_type: