diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-11-16 19:18:17 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-11-17 10:14:44 +0400 |
commit | d2ba9edd664e27a97aff1c73da5717d6157789d4 (patch) | |
tree | 59ebc89ac84a7fc5e328f8d16f025c7b7c744b99 /sql/sql_time.cc | |
parent | f92d223fe21485c83c71efe9116c02046f3d3b46 (diff) | |
download | mariadb-git-d2ba9edd664e27a97aff1c73da5717d6157789d4.tar.gz |
MDEV-17740 Extend EXTRACT(x AS DAY*) to understand long time intervals
Diffstat (limited to 'sql/sql_time.cc')
-rw-r--r-- | sql/sql_time.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index ff02bfa0ae4..35a4e1e47c3 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -371,18 +371,14 @@ public: }; -/* Character set-aware version of str_to_datetime_or_date_or_time() */ -bool Temporal::str_to_datetime_or_date_or_time(MYSQL_TIME_STATUS *status, +/* Character set-aware version of ascii_to_datetime_or_date_or_time() */ +bool Temporal::str_to_datetime_or_date_or_time(MYSQL_TIME_STATUS *st, const char *str, size_t length, CHARSET_INFO *cs, date_mode_t fuzzydate) { TemporalAsciiBuffer tmp(str, length, cs); - bool rc= ::str_to_datetime_or_date_or_time(tmp.str, tmp.length, this, - ulonglong(fuzzydate & TIME_MODE_FOR_XXX_TO_DATE), - status); - DBUG_ASSERT(status->warnings || !rc); - return rc; + return ascii_to_datetime_or_date_or_time(st, tmp.str, tmp.length, fuzzydate); } @@ -393,11 +389,17 @@ bool Temporal::str_to_datetime_or_date(MYSQL_TIME_STATUS *status, date_mode_t flags) { TemporalAsciiBuffer tmp(str, length, cs); - bool rc= ::str_to_datetime_or_date(tmp.str, tmp.length, this, - ulonglong(flags & TIME_MODE_FOR_XXX_TO_DATE), - status); - DBUG_ASSERT(status->warnings || !rc); - return rc; + return ascii_to_datetime_or_date(status, tmp.str, tmp.length, flags); +} + + +/* Character set-aware version of ascii_to_temporal() */ +bool Temporal::str_to_temporal(MYSQL_TIME_STATUS *status, + const char *str, size_t length, CHARSET_INFO *cs, + date_mode_t flags) +{ + TemporalAsciiBuffer tmp(str, length, cs); + return ascii_to_temporal(status, tmp.str, tmp.length, flags); } |