From: Date: November 28 2007 12:35pm Subject: bk commit into 5.1 tree (bar:1.2632) BUG#29562 List-Archive: http://lists.mysql.com/commits/38689 X-Bug: 29562 Message-Id: <200711281135.lASBZUHl003704@bar.myoffice.izhnet.ru> Below is the list of changes that have just been committed into a local 5.1 repository of bar. When bar does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-11-28 15:35:25+04:00, bar@stripped +4 -0 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. mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result@stripped, 2007-11-28 15:35:22+04:00, bar@stripped +19 -1 Recording correct test result mysql-test/suite/rpl_ndb/t/disabled.def@stripped, 2007-11-28 15:35:22+04:00, bar@stripped +0 -1 Enabling test sql/ha_ndbcluster_binlog.cc@stripped, 2007-11-28 15:35:22+04:00, bar@stripped +3 -2 Character set of the NDB helper tables should not rely of the default settings, to avoid creating tables in different character sets on master and slave. Adding explicit character set. UTF8 should be fine. character_set_client should not rely on the default character set settings, which can be ucs2. Helper SQL queries sent by NDB are all in pure ASCII. Setting client_character_set to latin1. sql/log_event.cc@stripped, 2007-11-28 15:35:22+04:00, bar@stripped +1 -0 Adding assert to make sure that binary log does not have queries in character set which parser does not understand (e.g. ucs2). diff -Nrup a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result 2007-07-05 02:30:47 +05:00 +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result 2007-11-28 15:35:22 +04:00 @@ -1,3 +1,9 @@ +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'; Variable_name Value collation_server ucs2_unicode_ci @@ -5,5 +11,17 @@ show variables like "%character_set_ser% Variable_name Value character_set_server ucs2 DROP TABLE IF EXISTS t1; -create table t1 (a int); +create table t1 (a int) ENGINE=NDB; 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 diff -Nrup a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def --- a/mysql-test/suite/rpl_ndb/t/disabled.def 2007-11-14 14:01:40 +04:00 +++ b/mysql-test/suite/rpl_ndb/t/disabled.def 2007-11-28 15:35:22 +04:00 @@ -17,7 +17,6 @@ rpl_ndb_2other : BUG#21842 200 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_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 # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff -Nrup a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc --- a/sql/ha_ndbcluster_binlog.cc 2007-10-30 21:08:11 +04:00 +++ b/sql/ha_ndbcluster_binlog.cc 2007-11-28 15:35:22 +04:00 @@ -775,7 +775,7 @@ static int ndbcluster_create_ndb_apply_s " log_name VARCHAR(255) BINARY NOT NULL, " " start_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, 701, @@ -835,7 +835,7 @@ static int ndbcluster_create_schema_tabl " id INT UNSIGNED NOT NULL," " version 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, 701, @@ -3959,6 +3959,7 @@ restart: i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage); bzero((char*) &row, sizeof(row)); + thd->variables.character_set_client= &my_charset_latin1; injector::transaction trans; // pass table map before epoch { diff -Nrup a/sql/log_event.cc b/sql/log_event.cc --- a/sql/log_event.cc 2007-11-23 17:41:37 +04:00 +++ b/sql/log_event.cc 2007-11-28 15:35:22 +04:00 @@ -1648,6 +1648,7 @@ Query_log_event::Query_log_event(THD* th 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_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+2, thd_arg->variables.collation_connection->number); int2store(charset+4, thd_arg->variables.collation_server->number);