Commit a2290919 authored by Sergei Golubchik's avatar Sergei Golubchik

potential signedness issue

different fix for 07a33cdc:

Bug #23296299 : HANDLE_FATAL_SIGNAL (SIG=11) IN MY_TOSORT_UTF32
parent 7ae555c1
......@@ -1269,6 +1269,9 @@ CHAR_LENGTH(TRIM(BOTH 0x61 FROM _utf32 0x00000061))
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061));
CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061))
1
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
c
FFFF0000
#
# End of 5.5 tests
#
......@@ -876,6 +876,11 @@ SELECT CHAR_LENGTH(TRIM(BOTH 0x0001 FROM _utf32 0x00000061));
SELECT CHAR_LENGTH(TRIM(BOTH 0x61 FROM _utf32 0x00000061));
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061));
#
# potential signedness issue
#
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
--echo #
--echo # End of 5.5 tests
--echo #
/* Copyright (c) 2003, 2013, Oracle and/or its affiliates
Copyright (c) 2009, 2014, SkySQL Ab.
Copyright (c) 2009, 2016, MariaDB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -1098,7 +1098,7 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)),
static inline void
my_tolower_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256 && uni_plane[page])
*wc= uni_plane[page][*wc & 0xFF].tolower;
}
......@@ -1107,7 +1107,7 @@ my_tolower_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
static inline void
my_toupper_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256 && uni_plane[page])
*wc= uni_plane[page][*wc & 0xFF].toupper;
}
......@@ -1116,7 +1116,7 @@ my_toupper_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
static inline void
my_tosort_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256)
{
if (uni_plane[page])
......@@ -1727,7 +1727,7 @@ my_uni_utf32(CHARSET_INFO *cs __attribute__((unused)),
static inline void
my_tolower_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256 && uni_plane[page])
*wc= uni_plane[page][*wc & 0xFF].tolower;
}
......@@ -1736,7 +1736,7 @@ my_tolower_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
static inline void
my_toupper_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256 && uni_plane[page])
*wc= uni_plane[page][*wc & 0xFF].toupper;
}
......@@ -1745,7 +1745,7 @@ my_toupper_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
static inline void
my_tosort_utf32(MY_UNICASE_INFO *const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256)
{
if (uni_plane[page])
......
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab
Copyright (c) 2009, 2016, MariaDB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -1939,7 +1939,7 @@ MY_UNICASE_INFO *const my_unicase_turkish[256]=
static inline void
my_tosort_unicode(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256)
{
if (uni_plane[page])
......@@ -5024,7 +5024,7 @@ my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)),
static inline void
my_tolower_utf8mb4(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256 && uni_plane[page])
*wc= uni_plane[page][*wc & 0xFF].tolower;
}
......@@ -5033,7 +5033,7 @@ my_tolower_utf8mb4(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
static inline void
my_toupper_utf8mb4(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc)
{
int page= *wc >> 8;
uint page= *wc >> 8;
if (page < 256 && uni_plane[page])
*wc= uni_plane[page][*wc & 0xFF].toupper;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment