summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-01-17 20:13:45 -0800
committerunknown <igor@olga.mysql.com>2007-01-17 20:13:45 -0800
commitaf3216862354eea44e594eb9216252c7b260fb3e (patch)
tree5c9fbe39dd901f2e87ebe248ac26c2bde025d765 /sql/item_cmpfunc.h
parent759a028c20412d26802d479724de932a288a3e43 (diff)
downloadmariadb-git-af3216862354eea44e594eb9216252c7b260fb3e.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. mysql-test/r/sp-code.result: Adjusted results after the fix of bug 25580. mysql-test/r/subselect.result: Adjusted results after the fix of bug 25580. mysql-test/r/view.result: Added a test case for bug #25580. mysql-test/t/view.test: Added a test case for bug #25580. sql/item_cmpfunc.cc: 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 the NOT expression into extra parenthesis to avoid incorrect stored representations of views that use the '!' operators. sql/item_cmpfunc.h: 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 the NOT expression into extra parenthesis to avoid incorrect stored representations of views that use the '!' operators.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h1
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;