[Commits] 0488401b955: postreview fix
revision-id: 0488401b955a3434ba9ca5450cd0095bd687d5c2 (mariadb-10.3.6-140-g0488401b955) parent(s): 25d6af49a3ab4a6680700bdc47b72c15ab25a78e author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-05-14 12:49:09 +0200 message: postreview fix --- sql/item_cmpfunc.cc | 2 +- sql/item_func.h | 34 ++++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 78a557f5a1b..4a4fd14c4cb 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2829,7 +2829,7 @@ Item_func_nullif::time_op(MYSQL_TIME *ltime) bool Item_func_nullif::is_null() { - return (null_value= (!compare() ? 1 : args[2]->null_value)); + return (null_value= (!compare() ? 1 : args[2]->is_null())); } void Item_func_case::reorder_args(uint start) diff --git a/sql/item_func.h b/sql/item_func.h index c203a21cc2b..392987140f7 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1607,14 +1607,34 @@ class Item_func_rollup_const :public Item_func { name= a->name; } - double val_real() { return args[0]->val_real(); } - longlong val_int() { return args[0]->val_int(); } - String *val_str(String *str) { return args[0]->val_str(str); } - my_decimal *val_decimal(my_decimal *dec) { return args[0]->val_decimal(dec); } + double val_real() + { + double res= args[0]->val_real(); + null_value= args[0]->null_value; + return res; + } + longlong val_int() + { + longlong res= args[0]->val_int(); + null_value= args[0]->null_value; + return res; + } + String *val_str(String *str) + { + String *res= args[0]->val_str(str); + null_value= args[0]->null_value; + return res; + } + my_decimal *val_decimal(my_decimal *dec) + { + my_decimal *res= args[0]->val_decimal(dec); + null_value= args[0]->null_value; + return res; + } bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { bool rc= args[0]->get_date(ltime, fuzzydate); - null_value= rc; + null_value= args[0]->null_value; return rc; } const char *func_name() const { return "rollup_const"; } @@ -1624,9 +1644,7 @@ class Item_func_rollup_const :public Item_func { collation= args[0]->collation; max_length= args[0]->max_length; - decimals=args[0]->decimals; - /* The item could be a NULL constant. */ - null_value= args[0]->is_null(); + decimals=args[0]->decimals; } Item *get_copy(THD *thd) { return get_item_copy<Item_func_rollup_const>(thd, this); }
participants (1)
-
Oleksandr Byelkin