[Commits] 54e1520a2af: postreview
revision-id: 54e1520a2af058e32f4876d93528d3e225b958a1 (mariadb-10.3.6-180-g54e1520a2af) parent(s): 5f88aae2d679dc37e8e2b4700d4cd0267e03b248 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-05-15 09:42:00 +0200 message: postreview --- sql/item.h | 6 ++++++ sql/item_func.h | 33 +++++---------------------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/sql/item.h b/sql/item.h index 3ebb92b3afb..54f228468a7 100644 --- a/sql/item.h +++ b/sql/item.h @@ -718,6 +718,12 @@ class Item: public Value_source, value= NULL; return value; } + bool get_date_from_item(Item *item, MYSQL_TIME *ltime, ulonglong fuzzydate) + { + bool rc= item->get_date(ltime, fuzzydate); + null_value= MY_TEST(rc || item->null_value); + return rc; + } /* This method is used if the item was not null but convertion to TIME/DATE/DATETIME failed. We return a zero date if allowed, diff --git a/sql/item_func.h b/sql/item_func.h index 9544978eb31..376f8fc16a1 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1615,36 +1615,13 @@ class Item_func_rollup_const :public Item_func { name= a->name; } - 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; - } + double val_real() { return val_real_from_item(args[0]); } + longlong val_int() { return val_int_from_item(args[0]); } + String *val_str(String *str) { return val_str_from_item(args[0], str); } my_decimal *val_decimal(my_decimal *dec) - { - my_decimal *res= args[0]->val_decimal(dec); - null_value= args[0]->null_value; - return res; - } + { return val_decimal_from_item(args[0], dec); } bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) - { - bool rc= args[0]->get_date(ltime, fuzzydate); - null_value= args[0]->null_value; - return rc; - } + { return get_date_from_item(args[0], ltime, fuzzydate); } const char *func_name() const { return "rollup_const"; } bool const_item() const { return 0; } const Type_handler *type_handler() const { return args[0]->type_handler(); }
participants (1)
-
Oleksandr Byelkin