← Back to team overview

maria-developers team mailing list archive

Rewiew requested.

 

Hi, Sergey.

I'd like your opinion about this difference in the result of the null.test:

----------------------------------------------------------------------------------------------

--- /home/hf/wgit/cmt-mdev-9143/mysql-test/r/null.result 2016-10-23 13:33:54.050093010 +0400 +++ /home/hf/wgit/cmt-mdev-9143/mysql-test/r/null.reject 2016-10-24 17:31:55.553248271 +0400
@@ -1584,7 +1584,7 @@
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
 Warnings:
-Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (((`test`.`t1`.`c1` is not null) >= <cache>((not(1)))) is not null) +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (((`test`.`t1`.`c1` is not null) >= 0) is not null)
 SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL;
 c1
 1

----------------------------------------------------------------------------------------------

I mean i made a change in the code that changed the test result, which is normally not good.

Though i think here we rather have an improvement.

What do you think? Would you approve that change in the result?

See below for the patch that caused all this:

----------------------------------------------------------------------------------------------

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);
};

----------------------------------------------------------------------------------------------


Best regards.

HF




Follow ups