summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-08-06 10:53:55 +0400
committerAlexander Barkov <bar@mariadb.com>2019-08-06 10:53:55 +0400
commit13f36fffeaecf316435fc497b0f3ae2a5d58d749 (patch)
tree96e50a09c675ae0a1322a7c9626683ba380119b1 /sql-common
parentc99f9766b11bda7eb15d6875f2f1e64c2d01b461 (diff)
downloadmariadb-git-13f36fffeaecf316435fc497b0f3ae2a5d58d749.tar.gz
MDEV-19301 Assertion `!is_valid_datetime() || fraction_remainder(((item->decimals) < (6) ? (item->decimals) : (6))) == 0' failed in Datetime_truncation_not_needed::Datetime_truncation_not_needed
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/my_time.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index b8054aa2c23..22ea32e5076 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -1728,7 +1728,11 @@ longlong number_to_datetime_or_date(longlong nr, ulong sec_part,
!check_date(time_res, nr || sec_part, flags, was_cut))
{
if (time_res->time_type == MYSQL_TIMESTAMP_DATE && sec_part != 0)
- *was_cut= MYSQL_TIME_NOTE_TRUNCATED;
+ {
+ /* Date format, but with fractional digits, e.g. 20010203.5 */
+ *was_cut= MYSQL_TIME_NOTE_TRUNCATED;
+ time_res->second_part= 0;
+ }
return nr;
}