Loading mysql-test/r/func_if.result +3 −0 Original line number Diff line number Diff line Loading @@ -64,3 +64,6 @@ select if(1>2,a,avg(a)) from t1; if(1>2,a,avg(a)) 1.5000 drop table t1; SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL; NULLIF(5,5) IS NULL NULLIF(5,5) IS NOT NULL 1 0 mysql-test/t/func_if.test +4 −0 Original line number Diff line number Diff line Loading @@ -47,3 +47,7 @@ insert t1 values (1),(2); select if(1>2,a,avg(a)) from t1; drop table t1; # # Bug #5595 NULLIF() IS NULL returns false if NULLIF() returns NULL # SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL; sql/item_cmpfunc.cc +9 −0 Original line number Diff line number Diff line Loading @@ -654,6 +654,15 @@ Item_func_nullif::val_str(String *str) return res; } bool Item_func_nullif::is_null() { if (!(this->*cmp_func)()) return null_value=1; return 0; } /* CASE expression Return the matching ITEM or NULL if all compares (including else) failed Loading sql/item_cmpfunc.h +1 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,7 @@ class Item_func_nullif :public Item_bool_func2 void fix_length_and_dec(); const char *func_name() const { return "nullif"; } table_map not_null_tables() const { return 0; } bool is_null(); }; Loading Loading
mysql-test/r/func_if.result +3 −0 Original line number Diff line number Diff line Loading @@ -64,3 +64,6 @@ select if(1>2,a,avg(a)) from t1; if(1>2,a,avg(a)) 1.5000 drop table t1; SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL; NULLIF(5,5) IS NULL NULLIF(5,5) IS NOT NULL 1 0
mysql-test/t/func_if.test +4 −0 Original line number Diff line number Diff line Loading @@ -47,3 +47,7 @@ insert t1 values (1),(2); select if(1>2,a,avg(a)) from t1; drop table t1; # # Bug #5595 NULLIF() IS NULL returns false if NULLIF() returns NULL # SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL;
sql/item_cmpfunc.cc +9 −0 Original line number Diff line number Diff line Loading @@ -654,6 +654,15 @@ Item_func_nullif::val_str(String *str) return res; } bool Item_func_nullif::is_null() { if (!(this->*cmp_func)()) return null_value=1; return 0; } /* CASE expression Return the matching ITEM or NULL if all compares (including else) failed Loading
sql/item_cmpfunc.h +1 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,7 @@ class Item_func_nullif :public Item_bool_func2 void fix_length_and_dec(); const char *func_name() const { return "nullif"; } table_map not_null_tables() const { return 0; } bool is_null(); }; Loading