Commit 2c53a70e authored by Sergey Glukhov's avatar Sergey Glukhov

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.
parent a4107449
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;
-- 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;
......@@ -2771,8 +2771,8 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
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
......
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