1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-16861 Split Item::update_null_value() into a new virtual method in Type_handler

This commit is contained in:
Alexander Barkov
2018-07-31 10:09:53 +04:00
parent 28ff7e89c6
commit 2bbee0e1ec
14 changed files with 178 additions and 49 deletions

View File

@ -2617,6 +2617,61 @@ uint32 Type_handler_general_purpose_int::max_display_length(const Item *item)
}
/*************************************************************************/
void Type_handler_row::Item_update_null_value(Item *item) const
{
DBUG_ASSERT(0);
item->null_value= true;
}
void Type_handler_time_common::Item_update_null_value(Item *item) const
{
MYSQL_TIME ltime;
(void) item->get_date(&ltime, TIME_TIME_ONLY);
}
void Type_handler_temporal_with_date::Item_update_null_value(Item *item) const
{
MYSQL_TIME ltime;
(void) item->get_date(&ltime, sql_mode_for_dates(current_thd));
}
void Type_handler_string_result::Item_update_null_value(Item *item) const
{
StringBuffer<MAX_FIELD_WIDTH> tmp;
(void) item->val_str(&tmp);
}
void Type_handler_real_result::Item_update_null_value(Item *item) const
{
(void) item->val_real();
}
void Type_handler_decimal_result::Item_update_null_value(Item *item) const
{
my_decimal tmp;
(void) item->val_decimal(&tmp);
}
void Type_handler_int_result::Item_update_null_value(Item *item) const
{
(void) item->val_int();
}
void Type_handler_bool::Item_update_null_value(Item *item) const
{
(void) item->val_bool();
}
/*************************************************************************/
int Type_handler_time_common::Item_save_in_field(Item *item, Field *field,