summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_charset_sjis.test
diff options
context:
space:
mode:
authorbar@mysql.com/bar.intranet.mysql.r18.ru <>2006-11-09 14:27:34 +0400
committerbar@mysql.com/bar.intranet.mysql.r18.ru <>2006-11-09 14:27:34 +0400
commita5de478d5153512b52881a23922d1b6a7a89fcab (patch)
treeb32f081e145620bd28a94e6f2294d3e2f0b7ffb7 /mysql-test/t/rpl_charset_sjis.test
parent9870d87f25e4e426a09989c82e5e90c9f4197262 (diff)
downloadmariadb-git-a5de478d5153512b52881a23922d1b6a7a89fcab.tar.gz
Bug#23619 Incorrectly escaped multibyte characters in binary log break replication
Problem: when embedding a character string with introducer with charset X into a SQL query which is generally in character set Y, the string constants were escaped according to their own character set (i.e.X), then after reading such a "mixed" query from binlog, the string constants were unescaped using character set of the query (i.e. Y), instead of X, which gave wrong results or even syntax errors with tricky charsets (e.g. sjis) Fix: when embedding a string constant of charset X into a query of charset Y, the string constant is now escaped according to character Y, instead of its own character set X.
Diffstat (limited to 'mysql-test/t/rpl_charset_sjis.test')
-rw-r--r--mysql-test/t/rpl_charset_sjis.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/rpl_charset_sjis.test b/mysql-test/t/rpl_charset_sjis.test
new file mode 100644
index 00000000000..2469b0db8a2
--- /dev/null
+++ b/mysql-test/t/rpl_charset_sjis.test
@@ -0,0 +1,25 @@
+source include/have_sjis.inc;
+source include/master-slave.inc;
+
+--disable_warnings
+drop table if exists t1;
+drop procedure if exists p1;
+--enable_warnings
+create table t1 (a varchar(255) character set sjis);
+create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a);
+
+SET NAMES binary;
+CALL p1 ('–\\');
+select "--- on master ---";
+select hex(a) from t1 ;
+sync_slave_with_master;
+connection slave;
+select "--- on slave ---";
+select hex(a) from t1;
+connection master;
+drop table t1;
+drop procedure p1;
+sync_slave_with_master;
+connection master;
+
+# End of 5.0 tests