diff --git a/mysql-test/main/func_extract.result b/mysql-test/main/func_extract.result index dc71f6ae27a..7c1fd5009ca 100644 --- a/mysql-test/main/func_extract.result +++ b/mysql-test/main/func_extract.result @@ -1470,5 +1470,13 @@ DROP FUNCTION params; DROP FUNCTION select01; DROP FUNCTION select02; # +# MDEV-32891 Assertion `value <= ((ulonglong) 0xFFFFFFFFL) * 10000ULL' failed in str_to_DDhhmmssff_internal +# +SELECT EXTRACT(HOUR_MICROSECOND FROM '42949672955000x1'); +EXTRACT(HOUR_MICROSECOND FROM '42949672955000x1') +NULL +Warnings: +Warning 1292 Incorrect interval value: '42949672955000x1' +# # End of 10.5 tests # diff --git a/mysql-test/main/func_extract.test b/mysql-test/main/func_extract.test index dd808443f58..6167780b9bf 100644 --- a/mysql-test/main/func_extract.test +++ b/mysql-test/main/func_extract.test @@ -511,6 +511,13 @@ DROP FUNCTION params; DROP FUNCTION select01; DROP FUNCTION select02; +--echo # +--echo # MDEV-32891 Assertion `value <= ((ulonglong) 0xFFFFFFFFL) * 10000ULL' failed in str_to_DDhhmmssff_internal +--echo # + +SELECT EXTRACT(HOUR_MICROSECOND FROM '42949672955000x1'); + + --echo # --echo # End of 10.5 tests --echo # diff --git a/sql-common/my_time.c b/sql-common/my_time.c index eff39cd5eae..2f74235614c 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -961,7 +961,7 @@ str_to_DDhhmmssff_internal(my_bool neg, const char *str, size_t length, { /* String given as one number; assume HHMMSS format */ date[0]= 0; - DBUG_ASSERT(value <= ((ulonglong) UINT_MAX32) * 10000ULL); + DBUG_ASSERT(value / 10000 <= ((ulonglong) UINT_MAX32)); date[1]= (ulong) (value/10000); date[2]= (ulong) (value/100 % 100); date[3]= (ulong) (value % 100);