summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2006-03-20 14:43:02 +0400
committerunknown <bar@mysql.com>2006-03-20 14:43:02 +0400
commit7913527eb8c9c9722a343e0fde54a4e271fae222 (patch)
tree6f4fcac8a9253b59ace7ac331f8f1c75bb46de80 /sql/table.cc
parent367442f754a97d87077c99bc5805b41da5ac7119 (diff)
downloadmariadb-git-7913527eb8c9c9722a343e0fde54a4e271fae222.tar.gz
Bug#18004 Connecting crashes server when default charset is UCS2
table.cc: Fixing to use system_charset_info instead of default_charset_info. Crash happened because the "ctype" array is empty in UCS2, and thus cannot be used with my_isspace(). The reason why UCS2 appeared in this context was because of of default_charset_info variable incorrectly substituted to my_isspace(). As functions check_db_name(), check_table_name() and check_column_name() always get values in utf8, system_charset_info must be used instead. ctype_ucs2_def.test, ctype_ucs2_def-master.opt, ctype_ucs2_def.result: new file sql/table.cc: Bug#18004 Connecting crashes server when default charset is UCS2 Use of default_charset_info was wrong. Functions check_db_name, check_table_name and check_column_name get values of system_charset_info character set (utf8).
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc
index de539205ffd..8ac64ac198d 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1423,7 +1423,7 @@ bool check_db_name(char *name)
while (*name)
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
- last_char_is_space= my_isspace(default_charset_info, *name);
+ last_char_is_space= my_isspace(system_charset_info, *name);
if (use_mb(system_charset_info))
{
int len=my_ismbchar(system_charset_info, name,
@@ -1469,7 +1469,7 @@ bool check_table_name(const char *name, uint length)
while (name != end)
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
- last_char_is_space= my_isspace(default_charset_info, *name);
+ last_char_is_space= my_isspace(system_charset_info, *name);
if (use_mb(system_charset_info))
{
int len=my_ismbchar(system_charset_info, name, end);
@@ -1500,7 +1500,7 @@ bool check_column_name(const char *name)
while (*name)
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
- last_char_is_space= my_isspace(default_charset_info, *name);
+ last_char_is_space= my_isspace(system_charset_info, *name);
if (use_mb(system_charset_info))
{
int len=my_ismbchar(system_charset_info, name,