#At file:///home/gluh/MySQL/mysql-5.1-bugteam/ based on revid:bernt.johnsen@stripped
2974 Sergey Glukhov 2009-06-25
Bug#45485 replication different between master/slaver using procedure with gbk
In Item_param::set_from_user_var
value.cs_info.character_set_client is set
to 'fromcs' value. It's wrong, it should be set to
thd->variables.character_set_client.
@ mysql-test/r/ctype_gbk_binlog.result
test result
@ mysql-test/t/ctype_gbk_binlog.test
test case
@ sql/item.cc
In Item_param::set_from_user_var
value.cs_info.character_set_client is set
to 'fromcs' value. It's wrong, it should be set to
thd->variables.character_set_client.
added:
mysql-test/r/ctype_gbk_binlog.result
mysql-test/t/ctype_gbk_binlog.test
modified:
sql/item.cc
=== added file 'mysql-test/r/ctype_gbk_binlog.result'
--- a/mysql-test/r/ctype_gbk_binlog.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/ctype_gbk_binlog.result 2009-06-25 06:22:39 +0000
@@ -0,0 +1,26 @@
+SET NAMES gbk;
+CREATE TABLE t1 (
+f1 BLOB
+) ENGINE=MyISAM DEFAULT CHARSET=gbk;
+CREATE PROCEDURE p1(IN val BLOB)
+BEGIN
+SET @tval = val;
+SET @sql_cmd = CONCAT_WS(' ', 'insert into t1(f1) values(?)');
+PREPARE stmt FROM @sql_cmd;
+EXECUTE stmt USING @tval;
+DEALLOCATE PREPARE stmt;
+END|
+SET @`tcontent`:=_binary 0x50434B000900000000000000E9000000 COLLATE `binary`/*!*/;
+CALL p1(@`tcontent`);
+FLUSH LOGS;
+DROP PROCEDURE p1;
+RENAME TABLE t1 to t2;
+SELECT hex(f1) FROM t2;
+hex(f1)
+50434B000900000000000000E9000000
+SELECT hex(f1) FROM t1;
+hex(f1)
+50434B000900000000000000E9000000
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP TABLE t2;
=== added file 'mysql-test/t/ctype_gbk_binlog.test'
--- a/mysql-test/t/ctype_gbk_binlog.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/ctype_gbk_binlog.test 2009-06-25 06:22:39 +0000
@@ -0,0 +1,36 @@
+-- source include/have_log_bin.inc
+-- source include/have_gbk.inc
+
+SET NAMES gbk;
+--character_set gbk
+
+CREATE TABLE t1 (
+ f1 BLOB
+) ENGINE=MyISAM DEFAULT CHARSET=gbk;
+
+delimiter |;
+CREATE PROCEDURE p1(IN val BLOB)
+BEGIN
+ SET @tval = val;
+ SET @sql_cmd = CONCAT_WS(' ', 'insert into t1(f1) values(?)');
+ PREPARE stmt FROM @sql_cmd;
+ EXECUTE stmt USING @tval;
+ DEALLOCATE PREPARE stmt;
+END|
+delimiter ;|
+
+SET @`tcontent`:=_binary 0x50434B000900000000000000E9000000 COLLATE `binary`/*!*/;
+CALL p1(@`tcontent`);
+
+FLUSH LOGS;
+DROP PROCEDURE p1;
+RENAME TABLE t1 to t2;
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MYSQL_BINLOG --force-if-open --short-form $MYSQLD_DATADIR/master-bin.000001 | $MYSQL
+SELECT hex(f1) FROM t2;
+SELECT hex(f1) FROM t1;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP TABLE t2;
=== modified file 'sql/item.cc'
--- a/sql/item.cc 2009-06-17 14:56:44 +0000
+++ b/sql/item.cc 2009-06-25 06:22:39 +0000
@@ -2771,8 +2771,8 @@ bool Item_param::set_from_user_var(THD *
CHARSET_INFO *tocs= thd->variables.collation_connection;
uint32 dummy_offset;
- value.cs_info.character_set_of_placeholder=
- value.cs_info.character_set_client= fromcs;
+ value.cs_info.character_set_of_placeholder= fromcs;
+ value.cs_info.character_set_client= thd->variables.character_set_client;
/*
Setup source and destination character sets so that they
are different only if conversion is necessary: this will
Attachment: [text/bzr-bundle] bzr/sergey.glukhov@sun.com-20090625062239-hv5mnabnnfy3wggu.bundle