[Commits] 7e3d58c: MDEV-9143 JSON_xxx functions.

Alexey Botchkov holyfoot at askmonty.org
Mon Oct 24 11:41:12 EEST 2016


revision-id: 7e3d58c06cd09185a10c6f8748c086e91a359b0e (mariadb-10.2.2-54-g7e3d58c)
parent(s): a1f0a33931f873af43ffa812a3efc13f4b494256
committer: Alexey Botchkov
timestamp: 2016-10-24 12:37:34 +0400
message:

MDEV-9143 JSON_xxx functions.

        Item_bool fixed so that it handles negation modifications
        better.

---
 mysql-test/r/parser_precedence.result | 2 +-
 sql/item.cc                           | 8 ++++++++
 sql/item.h                            | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/mysql-test/r/parser_precedence.result b/mysql-test/r/parser_precedence.result
index 5225dad..4330c8a 100644
--- a/mysql-test/r/parser_precedence.result
+++ b/mysql-test/r/parser_precedence.result
@@ -369,7 +369,7 @@ select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE;
 0	1	0
 Testing that NOT is associative
 select NOT NOT TRUE, NOT NOT NOT FALSE;
-TRUE	NOT NOT NOT FALSE
+NOT NOT TRUE	NOT NOT NOT FALSE
 1	1
 Testing that IS has precedence over NOT
 select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE;
diff --git a/sql/item.cc b/sql/item.cc
index 448e34b..2388679 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2900,6 +2900,14 @@ void Item_int::print(String *str, enum_query_type query_type)
 }
 
 
+Item *Item_bool::neg_transformer(THD *thd)
+{
+  value= !value;
+  name= 0;
+  return this;
+}
+
+
 Item_uint::Item_uint(THD *thd, const char *str_arg, uint length):
   Item_int(thd, str_arg, length)
 {
diff --git a/sql/item.h b/sql/item.h
index 7644235..ab70fdb 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -3008,6 +3008,7 @@ class Item_bool :public Item_int
   Item_bool(THD *thd, const char *str_arg, longlong i):
     Item_int(thd, str_arg, i, 1) {}
   bool is_bool_type() { return true; }
+  Item *neg_transformer(THD *thd);
 };
 
 


More information about the commits mailing list