diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-03-12 20:11:33 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-03-14 12:40:00 +0100 |
commit | e0d3d4059fb6266cd295791601ecabbfd07dba97 (patch) | |
tree | c003a77b72bce2c6f155492d75758b4f3149c78f /sql/item.h | |
parent | 75ac5789b4f6b0b3c95829130c7865247d0e7edc (diff) | |
download | mariadb-git-e0d3d4059fb6266cd295791601ecabbfd07dba97.tar.gz |
cleanup: add Item::convert_time_to_datetime() helper
will be used in following commits
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 <ma_dyncol.h> @@ -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. |