bug#29562 default collation of ucs2_unicode_ci crashes slave

Problem: some pieces of code relied on the default character
set settings, which didn't work in case of default character set
ucs2.
Fix: Specifying character set explicitly, not to depend on
the default settings.
parent 038a093c
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show variables like 'collation_server'; show variables like 'collation_server';
Variable_name Value Variable_name Value
collation_server ucs2_unicode_ci collation_server ucs2_unicode_ci
...@@ -5,5 +11,17 @@ show variables like "%character_set_ser%"; ...@@ -5,5 +11,17 @@ show variables like "%character_set_ser%";
Variable_name Value Variable_name Value
character_set_server ucs2 character_set_server ucs2
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
create table t1 (a int); create table t1 (a int) ENGINE=NDB;
drop table t1; drop table t1;
CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
`nom` char(4) default NULL,
`prenom` char(4) default NULL,
PRIMARY KEY (`nid`))
ENGINE=ndbcluster;
INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
select * from t1 order by nid;
nid nom prenom
1 XYZ1 ABC1
select * from t1 order by nid;
nid nom prenom
1 XYZ1 ABC1
...@@ -17,7 +17,6 @@ rpl_ndb_2other : BUG#21842 2007-08-30 tsmith test has never worked on ...@@ -17,7 +17,6 @@ rpl_ndb_2other : BUG#21842 2007-08-30 tsmith test has never worked on
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB
rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a
rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
......
...@@ -775,7 +775,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd) ...@@ -775,7 +775,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd)
" log_name VARCHAR(255) BINARY NOT NULL, " " log_name VARCHAR(255) BINARY NOT NULL, "
" start_pos BIGINT UNSIGNED NOT NULL, " " start_pos BIGINT UNSIGNED NOT NULL, "
" end_pos BIGINT UNSIGNED NOT NULL, " " end_pos BIGINT UNSIGNED NOT NULL, "
" PRIMARY KEY USING HASH (server_id) ) ENGINE=NDB"); " PRIMARY KEY USING HASH (server_id) ) ENGINE=NDB CHARACTER SET utf8");
const int no_print_error[4]= {ER_TABLE_EXISTS_ERROR, const int no_print_error[4]= {ER_TABLE_EXISTS_ERROR,
701, 701,
...@@ -835,7 +835,7 @@ static int ndbcluster_create_schema_table(THD *thd) ...@@ -835,7 +835,7 @@ static int ndbcluster_create_schema_table(THD *thd)
" id INT UNSIGNED NOT NULL," " id INT UNSIGNED NOT NULL,"
" version INT UNSIGNED NOT NULL," " version INT UNSIGNED NOT NULL,"
" type INT UNSIGNED NOT NULL," " type INT UNSIGNED NOT NULL,"
" PRIMARY KEY USING HASH (db,name) ) ENGINE=NDB"); " PRIMARY KEY USING HASH (db,name) ) ENGINE=NDB CHARACTER SET utf8");
const int no_print_error[4]= {ER_TABLE_EXISTS_ERROR, const int no_print_error[4]= {ER_TABLE_EXISTS_ERROR,
701, 701,
...@@ -3959,6 +3959,7 @@ restart: ...@@ -3959,6 +3959,7 @@ restart:
i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage); i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage);
bzero((char*) &row, sizeof(row)); bzero((char*) &row, sizeof(row));
thd->variables.character_set_client= &my_charset_latin1;
injector::transaction trans; injector::transaction trans;
// pass table map before epoch // pass table map before epoch
{ {
......
...@@ -1648,6 +1648,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, ...@@ -1648,6 +1648,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
DBUG_ASSERT(thd_arg->variables.character_set_client->number < 256*256); DBUG_ASSERT(thd_arg->variables.character_set_client->number < 256*256);
DBUG_ASSERT(thd_arg->variables.collation_connection->number < 256*256); DBUG_ASSERT(thd_arg->variables.collation_connection->number < 256*256);
DBUG_ASSERT(thd_arg->variables.collation_server->number < 256*256); DBUG_ASSERT(thd_arg->variables.collation_server->number < 256*256);
DBUG_ASSERT(thd_arg->variables.character_set_client->mbminlen == 1);
int2store(charset, thd_arg->variables.character_set_client->number); int2store(charset, thd_arg->variables.character_set_client->number);
int2store(charset+2, thd_arg->variables.collation_connection->number); int2store(charset+2, thd_arg->variables.collation_connection->number);
int2store(charset+4, thd_arg->variables.collation_server->number); int2store(charset+4, thd_arg->variables.collation_server->number);
......
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