summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-10-03 15:07:53 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-10-03 15:07:53 +0400
commit68354ef272087d589f07ee8892301cd8b9ff6eba (patch)
tree8c2e4703cef47503fd44e9a847748c57050262af /sql/item.cc
parentb737d902a8f4b42e8e515d112aeeb6ebe5ffa91a (diff)
downloadmariadb-git-68354ef272087d589f07ee8892301cd8b9ff6eba.tar.gz
MDEV-6592 Assertion `ltime->day == 0' failed with TIMESTAMP, MAKETIME
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/sql/item.cc b/sql/item.cc
index d58e4d285c5..b191e93808f 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -9015,17 +9015,11 @@ bool Item_cache_temporal::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
int Item_cache_temporal::save_in_field(Field *field, bool no_conversions)
{
- int error;
- if (!has_value())
+ MYSQL_TIME ltime;
+ if (get_date(&ltime, 0))
return set_field_to_null_with_conversions(field, no_conversions);
-
field->set_notnull();
-
- MYSQL_TIME ltime;
- unpack_time(value, &ltime);
- ltime.time_type= mysql_type_to_time_type(field_type());
- error= field->store_time_dec(&ltime, decimals);
-
+ int error= field->store_time_dec(&ltime, decimals);
return error ? error : field->table->in_use->is_error() ? 1 : 0;
}