From e0d3d4059fb6266cd295791601ecabbfd07dba97 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Mar 2018 20:11:33 +0100 Subject: cleanup: add Item::convert_time_to_datetime() helper will be used in following commits --- sql/item.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sql/item.h') diff --git a/sql/item.h b/sql/item.h index 40350ba1a2c..ed00522fa53 100644 --- a/sql/item.h +++ b/sql/item.h @@ -27,6 +27,7 @@ #include "sql_const.h" /* RAND_TABLE_BIT, MAX_FIELD_NAME */ #include "field.h" /* Derivation */ #include "sql_type.h" +#include "sql_time.h" C_MODE_START #include @@ -1361,6 +1362,14 @@ public: bool get_time(MYSQL_TIME *ltime) { return get_date(ltime, TIME_TIME_ONLY | TIME_INVALID_DATES); } // Get date with automatic TIME->DATETIME conversion + bool convert_time_to_datetime(THD *thd, MYSQL_TIME *ltime, ulonglong fuzzydate) + { + MYSQL_TIME tmp; + if (time_to_datetime_with_warn(thd, ltime, &tmp, fuzzydate)) + return null_value= true; + *ltime= tmp; + return false; + } bool get_date_with_conversion(MYSQL_TIME *ltime, ulonglong fuzzydate); /* Get time with automatic DATE/DATETIME to TIME conversion. -- cgit v1.2.1