summaryrefslogtreecommitdiff
path: root/mysys/charset.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-09-23 14:19:07 +0400
committerAlexander Barkov <bar@mariadb.org>2016-09-23 14:19:07 +0400
commit0f8a1a314d49adfe8e20c5e4d3e98e37b91b068e (patch)
tree285928478f93a3237cda86e935603a022f515a8e /mysys/charset.c
parent6304c0bfc7242ad54d93168e97e82022765934e3 (diff)
downloadmariadb-git-0f8a1a314d49adfe8e20c5e4d3e98e37b91b068e.tar.gz
MDEV-10877 xxx_unicode_nopad_ci collations
Diffstat (limited to 'mysys/charset.c')
-rw-r--r--mysys/charset.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index 2d9df9f47e4..016d0fc3012 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -310,14 +310,18 @@ static int add_collation(struct charset_info_st *cs)
if (!strcmp(cs->csname,"ucs2") )
{
#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS)
- copy_uca_collation(newcs, &my_charset_ucs2_unicode_ci);
+ copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ?
+ &my_charset_ucs2_unicode_nopad_ci :
+ &my_charset_ucs2_unicode_ci);
newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII;
#endif
}
else if (!strcmp(cs->csname, "utf8") || !strcmp(cs->csname, "utf8mb3"))
{
#if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS)
- copy_uca_collation(newcs, &my_charset_utf8_unicode_ci);
+ copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ?
+ &my_charset_utf8_unicode_nopad_ci :
+ &my_charset_utf8_unicode_ci);
newcs->ctype= my_charset_utf8_unicode_ci.ctype;
if (init_state_maps(newcs))
return MY_XML_ERROR;
@@ -326,7 +330,9 @@ static int add_collation(struct charset_info_st *cs)
else if (!strcmp(cs->csname, "utf8mb4"))
{
#if defined (HAVE_CHARSET_utf8mb4) && defined(HAVE_UCA_COLLATIONS)
- copy_uca_collation(newcs, &my_charset_utf8mb4_unicode_ci);
+ copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ?
+ &my_charset_utf8mb4_unicode_nopad_ci :
+ &my_charset_utf8mb4_unicode_ci);
newcs->ctype= my_charset_utf8mb4_unicode_ci.ctype;
newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED;
#endif
@@ -334,14 +340,18 @@ static int add_collation(struct charset_info_st *cs)
else if (!strcmp(cs->csname, "utf16"))
{
#if defined (HAVE_CHARSET_utf16) && defined(HAVE_UCA_COLLATIONS)
- copy_uca_collation(newcs, &my_charset_utf16_unicode_ci);
+ copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ?
+ &my_charset_utf16_unicode_nopad_ci :
+ &my_charset_utf16_unicode_ci);
newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII;
#endif
}
else if (!strcmp(cs->csname, "utf32"))
{
#if defined (HAVE_CHARSET_utf32) && defined(HAVE_UCA_COLLATIONS)
- copy_uca_collation(newcs, &my_charset_utf32_unicode_ci);
+ copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ?
+ &my_charset_utf32_unicode_nopad_ci :
+ &my_charset_utf32_unicode_ci);
newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII;
#endif
}