diff options
author | unknown <bell@sanja.is.com.ua> | 2004-08-31 21:10:57 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-08-31 21:10:57 +0300 |
commit | e6fbc582100591e3fe0e4af8050a3cab9d179c6d (patch) | |
tree | 00228acf5041d7b4ceb585e899cdb4bc1384f24f /sql/sql_yacc.yy | |
parent | 6a8906216db99f9923de264a665dbe64f61b581d (diff) | |
download | mariadb-git-e6fbc582100591e3fe0e4af8050a3cab9d179c6d.tar.gz |
after review patch
mysql-test/r/negation_elimination.result:
new tests of negation elimination
mysql-test/t/negation_elimination.test:
new tests of negation elimination
sql/item.h:
test of boolean functions added
sql/item_cmpfunc.cc:
NOT subtree is already checked, so wee need to return just argument
sql/item_cmpfunc.h:
test of boolean functions added
sql/mysql_priv.h:
'place' to detect WHERE clause
sql/sql_parse.cc:
function for creation negated expression
sql/sql_select.cc:
removed unused function
sql/sql_select.h:
removed unused function
sql/sql_yacc.yy:
'place' to detect WHERE clause
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index afb55463ad1..fa772a9cf11 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2757,13 +2757,11 @@ simple_expr: | '~' expr %prec NEG { $$= new Item_func_bit_neg($2); } | NOT expr %prec NEG { - if (($$= $2->neg_transformer(YYTHD)) == 0) - $$= new Item_func_not($2); + $$= negate_expression(YYTHD, $2); } | '!' expr %prec NEG { - if (($$= $2->neg_transformer(YYTHD)) == 0) - $$= new Item_func_not($2); + $$= negate_expression(YYTHD, $2); } | '(' expr ')' { $$= $2; } | '(' expr ',' expr_list ')' @@ -3606,11 +3604,17 @@ opt_all: where_clause: /* empty */ { Select->where= 0; } - | WHERE expr + | WHERE + { + Select->parsing_place= IN_WHERE; + } + expr { - Select->where= $2; - if ($2) - $2->top_level_item(); + SELECT_LEX *select= Select; + select->where= $3; + select->parsing_place= NO_MATTER; + if ($3) + $3->top_level_item(); } ; |