diff options
author | igor@olga.mysql.com <> | 2007-01-17 20:13:45 -0800 |
---|---|---|
committer | igor@olga.mysql.com <> | 2007-01-17 20:13:45 -0800 |
commit | c1927e9a70f38a92a3164f71f4f7ff4449befcea (patch) | |
tree | 5c9fbe39dd901f2e87ebe248ac26c2bde025d765 /sql/item_cmpfunc.h | |
parent | f3b3f1ef73d32d75926266989702dcacdc5a8f73 (diff) | |
download | mariadb-git-c1927e9a70f38a92a3164f71f4f7ff4449befcea.tar.gz |
Fixed bug #25580: incorrect stored representations of views in cases
when they contain the '!' operator.
Added an implementation for the method Item_func_not::print.
The method encloses any NOT expression into extra parentheses to avoid
incorrect stored representations of views that use the '!' operators.
Without this change when a view was created that contained
the expression !0*5 its stored representation contained not this
expression but rather the expression not(0)*5 .
The operator '!' is of a higher precedence than '*', while NOT is
of a lower precedence than '*'. That's why the expression !0*5
is interpreted as not(0)*5, while the expression not(0)*5 is interpreted
as not((0)*5) unless sql_mode is set to HIGH_NOT_PRECEDENCE.
Now we translate !0*5 into (not(0))*5.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r-- | sql/item_cmpfunc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 1d85d08c434..54457d37d18 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -269,6 +269,7 @@ public: enum Functype functype() const { return NOT_FUNC; } const char *func_name() const { return "not"; } Item *neg_transformer(THD *thd); + void print(String *str); }; class Item_maxmin_subselect; |