summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-11-23 19:04:42 +0400
committerAlexander Barkov <bar@mariadb.com>2018-11-26 08:10:47 +0400
commit4447a02cf13a49876001a40ca7db8fdedb731fd5 (patch)
tree1ccf39024e26a1efa68237e5d44a2296a990441d /sql/filesort.cc
parent27f3329ff6cb755b600d536347669bef1a7d98b5 (diff)
downloadmariadb-git-4447a02cf13a49876001a40ca7db8fdedb731fd5.tar.gz
MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMPbb-10.4-mdev16991
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index cbe79967647..d0cb77ac63d 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1051,7 +1051,10 @@ Type_handler_temporal_result::make_sort_key(uchar *to, Item *item,
Sort_param *param) const
{
MYSQL_TIME buf;
- if (item->get_date_result(current_thd, &buf, TIME_INVALID_DATES))
+ // This is a temporal type. No nanoseconds. Rounding mode is not important.
+ DBUG_ASSERT(item->cmp_type() == TIME_RESULT);
+ static const Temporal::Options opt(TIME_INVALID_DATES, TIME_FRAC_NONE);
+ if (item->get_date_result(current_thd, &buf, opt))
{
DBUG_ASSERT(item->maybe_null);
DBUG_ASSERT(item->null_value);