Commit 3ec7bdc2 authored by Sergei Golubchik's avatar Sergei Golubchik Committed by Oleg Smirnov

fixup MDEV-27277 Add a warning when max_sort_length is reached Step#1

fulltest2:

/home/buildbot/buildbot/build/mariadb-11.7.0/strings/ctype-mb.c: In function ‘my_strnxfrm_mb_internal’:
/home/buildbot/buildbot/build/mariadb-11.7.0/strings/ctype-mb.c:504:47: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
       size_t len= (dst + chlen <= de) ? chlen : de - dst;

/home/buildbot/buildbot/build/mariadb-11.7.0/strings/ctype-utf8.c: In function ‘my_strnxfrm_unicode_full_bin’:
/home/buildbot/buildbot/build/mariadb-11.7.0/strings/ctype-utf8.c:318:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if ((de - dst) < nweights * 3)
parent 144226fc
......@@ -501,7 +501,7 @@ my_strnxfrm_ret_t my_strnxfrm_mb_internal(CHARSET_INFO *cs,
else
{
/* Multi-byte character */
size_t len= (dst + chlen <= de) ? chlen : de - dst;
size_t len= (dst + chlen <= de) ? (size_t) chlen : (size_t) (de - dst);
if (dst + chlen > de)
warnings|= MY_STRNXFRM_TRUNCATED_WEIGHT_REAL_CHAR;
memcpy(dst, src, len);
......
......@@ -315,7 +315,7 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs,
if (flags & MY_STRXFRM_PAD_WITH_SPACE)
{
if ((de - dst) < nweights * 3)
if ((uint)(de - dst) < nweights * 3)
rc.m_warnings|= MY_STRNXFRM_TRUNCATED_WEIGHT_TRAILING_SPACE;
for ( ; dst < de && nweights; nweights--)
{
......
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