1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-21581 Helper functions and methods for CHARSET_INFO

This commit is contained in:
Alexander Barkov
2020-01-26 20:27:13 +04:00
parent dd68ba74f3
commit f1e13fdc8d
118 changed files with 1416 additions and 1025 deletions

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2019, MariaDB Corporation.
Copyright (c) 2009, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1446,7 +1446,7 @@ my_cset_init_8bit(struct charset_info_st *cs, MY_CHARSET_LOADER *loader)
cs->caseup_multiply= 1;
cs->casedn_multiply= 1;
cs->pad_char= ' ';
if (!cs->to_lower || !cs->to_upper || !cs->ctype || !cs->tab_to_uni)
if (!cs->to_lower || !cs->to_upper || !cs->m_ctype || !cs->tab_to_uni)
return TRUE;
return create_fromuni(cs, loader);
}
@@ -1496,7 +1496,7 @@ int my_mb_ctype_8bit(CHARSET_INFO *cs, int *ctype,
*ctype= 0;
return MY_CS_TOOSMALL;
}
*ctype= cs->ctype[*s + 1];
*ctype= cs->m_ctype[*s + 1];
return 1;
}
@@ -2022,14 +2022,14 @@ my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs,
if (nweights && frmend < strend && (flags & MY_STRXFRM_PAD_WITH_SPACE))
{
uint fill_length= MY_MIN((uint) (strend - frmend), nweights * cs->mbminlen);
cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char);
my_ci_fill(cs, (char*) frmend, fill_length, cs->pad_char);
frmend+= fill_length;
}
my_strxfrm_desc_and_reverse(str, frmend, flags, level);
if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend)
{
size_t fill_length= strend - frmend;
cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char);
my_ci_fill(cs, (char*) frmend, fill_length, cs->pad_char);
frmend= strend;
}
return frmend - str;