summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-01-15 07:58:50 +0400
committerAlexander Barkov <bar@mariadb.com>2020-01-16 09:59:39 +0400
commit497ee3384889ce4a3974f50a0c187304cb96c803 (patch)
tree3b144a3bef4e07f56b87cc11b6088fd995a33a72 /sql/item_timefunc.cc
parentcc3135cf83c07971665cd0c2225c40b74c5d2778 (diff)
downloadmariadb-git-497ee3384889ce4a3974f50a0c187304cb96c803.tar.gz
MDEV-21497 Make Field_time, Field_datetime, Field_timestamp abstract
- Making classes Field_time, Field_datetime, Field_timestamp abstract - Adding instantiable Field_time0, Field_datetime0, Field_timestamp0 classes - Removing redundant cast in field_conv.cc, item_timefunc.cc, sp.cc in calls for set_time() and get_timestamp() - Replacing store_TIME() to store_timestamp() in log.cc and removing redundant cast
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index c73db2f7ed1..b999035705c 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1214,7 +1214,7 @@ bool Item_func_unix_timestamp::get_timestamp_value(my_time_t *seconds,
{
if ((null_value= field->is_null()))
return 1;
- *seconds= ((Field_timestamp*)field)->get_timestamp(second_part);
+ *seconds= field->get_timestamp(second_part);
return 0;
}
}
@@ -1270,7 +1270,7 @@ longlong Item_func_unix_timestamp::val_int_endpoint(bool left_endp, bool *incl_e
DBUG_ASSERT(arg_count == 1 &&
args[0]->type() == Item::FIELD_ITEM &&
args[0]->field_type() == MYSQL_TYPE_TIMESTAMP);
- Field_timestamp *field=(Field_timestamp *)(((Item_field*)args[0])->field);
+ Field *field= ((Item_field*)args[0])->field;
/* Leave the incl_endp intact */
ulong unused;
my_time_t ts= field->get_timestamp(&unused);
@@ -1644,7 +1644,7 @@ int Item_func_now_local::save_in_field(Field *field, bool no_conversions)
ulong sec_part= decimals ? thd->query_start_sec_part() : 0;
sec_part-= my_time_fraction_remainder(sec_part, decimals);
field->set_notnull();
- ((Field_timestamp*)field)->store_TIME(ts, sec_part);
+ field->store_timestamp(ts, sec_part);
return 0;
}
else