summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-08-29 23:14:46 +0300
committerunknown <bell@sanja.is.com.ua>2004-08-29 23:14:46 +0300
commitf45c482aa9a546ca6ad0f258aa0a8358522f5c2f (patch)
tree15e9f105403916895459b6c2b74f5c03ab99f91c /sql/sql_yacc.yy
parentebf4ce0501486f5eba7b69fe77fb1c49bbd22763 (diff)
downloadmariadb-git-f45c482aa9a546ca6ad0f258aa0a8358522f5c2f.tar.gz
NOT elimination moved in parsing (suggested by Monty)
sql/item_cmpfunc.cc: NOT elimination moved in parsing (we do not need fix fields in it and PS processing) sql/item_cmpfunc.h: NOT elimination moved in parsing (we do not need fix fields in it and PS processing) sql/sql_select.cc: NOT elimination moved in parsing (we do not need fix fields in it and PS processing) sql/sql_yacc.yy: NOT elimination moved in parsing
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy12
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 1c057e03a11..afb55463ad1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2755,8 +2755,16 @@ simple_expr:
| '+' expr %prec NEG { $$= $2; }
| '-' expr %prec NEG { $$= new Item_func_neg($2); }
| '~' expr %prec NEG { $$= new Item_func_bit_neg($2); }
- | NOT expr %prec NEG { $$= new Item_func_not($2); }
- | '!' expr %prec NEG { $$= new Item_func_not($2); }
+ | NOT expr %prec NEG
+ {
+ if (($$= $2->neg_transformer(YYTHD)) == 0)
+ $$= new Item_func_not($2);
+ }
+ | '!' expr %prec NEG
+ {
+ if (($$= $2->neg_transformer(YYTHD)) == 0)
+ $$= new Item_func_not($2);
+ }
| '(' expr ')' { $$= $2; }
| '(' expr ',' expr_list ')'
{