Commit abf1fc9b authored by bar@mysql.com's avatar bar@mysql.com

Bug#14527: Partitions: table unreadable if partition name = c-cedilla

sql_partition.cc:
  Changeing THD charset to utf8 when parsing a frm file.
partition_charset.test, partition_charset.result:
  new file
parent 64461db1
drop table if exists t1;
set names utf8;
create table t1 (s1 int)
partition by list (s1)
(partition c values in (1),
partition Ç values in (3));
insert into t1 values (1),(3);
select * from t1;
s1
1
3
flush tables;
set names latin1;
select * from t1;
s1
1
3
drop table t1;
#
# Test for character set related things in combination
# with the partition storage engine
#
-- source include/have_partition.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
set names utf8;
create table t1 (s1 int)
partition by list (s1)
(partition c values in (1),
partition Ç values in (3));
insert into t1 values (1),(3);
select * from t1;
flush tables;
set names latin1;
select * from t1;
drop table t1;
...@@ -3630,11 +3630,13 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf, ...@@ -3630,11 +3630,13 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
Item *thd_free_list= thd->free_list; Item *thd_free_list= thd->free_list;
bool result= TRUE; bool result= TRUE;
partition_info *part_info; partition_info *part_info;
CHARSET_INFO *old_character_set_client= thd->variables.character_set_client;
LEX *old_lex= thd->lex; LEX *old_lex= thd->lex;
LEX lex; LEX lex;
DBUG_ENTER("mysql_unpack_partition"); DBUG_ENTER("mysql_unpack_partition");
thd->lex= &lex; thd->lex= &lex;
thd->variables.character_set_client= system_charset_info;
lex_start(thd, part_buf, part_info_len); lex_start(thd, part_buf, part_info_len);
/* /*
We need to use the current SELECT_LEX since I need to keep the We need to use the current SELECT_LEX since I need to keep the
...@@ -3760,6 +3762,7 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf, ...@@ -3760,6 +3762,7 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
end: end:
thd->free_list= thd_free_list; thd->free_list= thd_free_list;
thd->lex= old_lex; thd->lex= old_lex;
thd->variables.character_set_client= old_character_set_client;
DBUG_RETURN(result); DBUG_RETURN(result);
} }
......
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