summaryrefslogtreecommitdiff
path: root/mysys/charset.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2009-12-07 16:11:53 +0400
committerAlexander Barkov <bar@mysql.com>2009-12-07 16:11:53 +0400
commit164c7df5b3c77cfb0cb7615b59ccf264840af59c (patch)
treeff4878c9cabf7459ea7ceebf159346be5e984579 /mysys/charset.c
parent9651888e0e2b889f59d0e231903583a86edabc11 (diff)
downloadmariadb-git-164c7df5b3c77cfb0cb7615b59ccf264840af59c.tar.gz
Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
The problem is not actually related to 2byte collation IDs. The same crash happens if you change the collation ID in mysql-test/str_data/Index.xml to a value smaller than 256. Crash happened in SQL parser, because the "ident_map" and "state_map" arrays were not initialized in loadable utf8 collations. Fix: adding proper initialization of the "ident_map" and "state_map" members for loadable utf8 collations.
Diffstat (limited to 'mysys/charset.c')
-rw-r--r--mysys/charset.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index 280b2ad6091..e216f665092 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -255,6 +255,9 @@ static int add_collation(CHARSET_INFO *cs)
{
#if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS)
copy_uca_collation(newcs, &my_charset_utf8_unicode_ci);
+ newcs->ctype= my_charset_utf8_unicode_ci.ctype;
+ if (init_state_maps(newcs))
+ return MY_XML_ERROR;
#endif
}
else