diff options
author | unknown <jimw@mysql.com> | 2005-05-09 11:28:57 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-05-09 11:28:57 -0700 |
commit | c90b0ab57721382ed3689e1dfbaa338793df07a0 (patch) | |
tree | a4603694762ae0cf75989b6945f09c60343b9379 /sql/sql_yacc.yy | |
parent | 9a71e2dbc63bebe5c895e559c3a317c372288445 (diff) | |
parent | 8815d6cf60cd12fea0bf79adabced6dd14defd16 (diff) | |
download | mariadb-git-c90b0ab57721382ed3689e1dfbaa338793df07a0.tar.gz |
Merge
include/my_global.h:
Auto merged
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/t/select.test:
Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Auto merged
ndb/src/mgmapi/mgmapi.cpp:
Auto merged
ndb/src/ndbapi/NdbIndexOperation.cpp:
Auto merged
ndb/src/ndbapi/ndberror.c:
Auto merged
ndb/test/ndbapi/testNodeRestart.cpp:
Auto merged
sql/item.h:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/sql_udf.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
configure.in:
Ignore 4.1 version change
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
merge 4.1
ndb/src/ndbapi/ClusterMgr.cpp:
merge
ndb/test/run-test/Makefile.am:
merge
sql/mysql_priv.h:
merge from 4.1
sql/table.cc:
Merge from 4.1
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2231df3f4c1..25a78178995 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4000,7 +4000,15 @@ select_option: YYABORT; Lex->lock_option= TL_READ_HIGH_PRIORITY; } - | DISTINCT { Select->options|= SELECT_DISTINCT; } + | DISTINCT + { + if (Select->options & SELECT_ALL) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + Select->options|= SELECT_DISTINCT; + } | SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; } | SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; } | SQL_BUFFER_RESULT @@ -4020,7 +4028,15 @@ select_option: { Lex->select_lex.options|= OPTION_TO_QUERY_CACHE; } - | ALL {} + | ALL + { + if (Select->options & SELECT_DISTINCT) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + Select->options|= SELECT_ALL; + } ; select_lock_type: |