Skip to content

Commit e9a5b25

Browse files
committed
Merge branch '11.4' into 11.4.2
2 parents 727b549 + 2dfc6c4 commit e9a5b25

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

mysql-test/main/ctype_utf32.result

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,3 +3024,10 @@ HEX(DATE_FORMAT(TIME'11:22:33',@format))
30243024
#
30253025
# End of 10.4 tests
30263026
#
3027+
#
3028+
# MDEV-33729 UBSAN negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strntoll_mb2_or_mb4
3029+
#
3030+
SET NAMES utf8mb3, character_set_connection=utf32;
3031+
SELECT CONV('-AzL8n0Y58m8', -62, -10);
3032+
CONV('-AzL8n0Y58m8', -62, -10)
3033+
-9223372036854775808

mysql-test/main/ctype_utf32.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,3 +1168,10 @@ SELECT HEX(DATE_FORMAT(TIME'11:22:33',@format));
11681168
--echo #
11691169

11701170
--enable_service_connection
1171+
1172+
--echo #
1173+
--echo # MDEV-33729 UBSAN negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strntoll_mb2_or_mb4
1174+
--echo #
1175+
1176+
SET NAMES utf8mb3, character_set_connection=utf32;
1177+
SELECT CONV('-AzL8n0Y58m8', -62, -10);

strings/ctype-ucs2.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,12 @@ my_strntoll_mb2_or_mb4(CHARSET_INFO *cs,
504504

505505
if (negative)
506506
{
507-
if (res > (ulonglong) LONGLONG_MIN)
507+
if (res >= (ulonglong) LONGLONG_MIN)
508+
{
509+
if (res == (ulonglong) LONGLONG_MIN)
510+
return LONGLONG_MIN;
508511
overflow = 1;
512+
}
509513
}
510514
else if (res > (ulonglong) LONGLONG_MAX)
511515
overflow = 1;

0 commit comments

Comments
 (0)