summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-10 10:35:12 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-10 10:35:12 +0400
commitc2509a1588ee1dc7351b67b2f9149003540015c4 (patch)
tree23609156a993241b6254719e41b58de91aa1ca38 /sql/item_timefunc.cc
parente30b6a983fe135dd1af0c79c81dbdb5b14b881c8 (diff)
downloadmariadb-git-c2509a1588ee1dc7351b67b2f9149003540015c4.tar.gz
MDEV-13972 crash in Item_func_sec_to_time::get_date
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 0ed1506bbee..eeb373a75ee 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1733,9 +1733,18 @@ overflow:
ltime->hour= TIME_MAX_HOUR+1;
check_time_range(ltime, decimals, &unused);
- make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- err->ptr(), err->length(),
- MYSQL_TIMESTAMP_TIME, NullS);
+ if (!err)
+ {
+ ErrConvInteger err2(sec, unsigned_flag);
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ &err2, MYSQL_TIMESTAMP_TIME, NullS);
+ }
+ else
+ {
+ ErrConvString err2(err);
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ &err2, MYSQL_TIMESTAMP_TIME, NullS);
+ }
return 0;
}