MDEV-32891 Assertion `value <= ((ulonglong) 0xFFFFFFFFL) * 10000ULL' failed in str_to_DDhhmmssff_internal

Fixing the wrong assert.
This commit is contained in:
Alexander Barkov 2024-09-20 15:07:39 +04:00
parent 607fc15393
commit 681609d8a0
3 changed files with 16 additions and 1 deletions

View file

@ -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
#

View file

@ -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 #

View file

@ -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);