summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
author <Li-Bing.Song@sun.com>2009-08-12 11:54:05 +0800
committer <Li-Bing.Song@sun.com>2009-08-12 11:54:05 +0800
commitf5be2159fea9800c0d75046ab9c632abb401e9f0 (patch)
tree0ded16cb38fd34669a6d7bfcdbd59037cd6b0ec0 /mysql-test/include
parent4b80599a6250dc7244953038078e79a53ff5647b (diff)
downloadmariadb-git-f5be2159fea9800c0d75046ab9c632abb401e9f0.tar.gz
BUG#45516 SQL thread does not use database charset properly
Replication SQL thread does not set database default charset to thd->variables.collation_database properly, when executing LOAD DATA binlog. This bug can be repeated by using "LOAD DATA" command in STATEMENT mode. This patch adds code to find the default character set of the current database then assign it to thd->db_charset when slave server begins to execute a relay log. The test of this bug is added into rpl_loaddata_charset.test
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/rpl_loaddata_charset.inc35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/include/rpl_loaddata_charset.inc b/mysql-test/include/rpl_loaddata_charset.inc
new file mode 100644
index 00000000000..f94ff4ed069
--- /dev/null
+++ b/mysql-test/include/rpl_loaddata_charset.inc
@@ -0,0 +1,35 @@
+connection master;
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest;
+--enable_warnings
+
+CREATE DATABASE mysqltest CHARSET UTF8;
+USE mysqltest;
+CREATE TABLE t (cl varchar(100)) CHARSET UTF8;
+
+if (!$LOAD_LOCAL)
+{
+ LOAD DATA INFILE '../std_data_ln/loaddata_utf8.dat' INTO TABLE t
+ FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+}
+if ($LOAD_LOCAL)
+{
+ LOAD DATA LOCAL INFILE './std_data/loaddata_utf8.dat' INTO TABLE t
+ FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+}
+
+save_master_pos;
+echo ----------content on master----------;
+SELECT hex(cl) FROM t;
+
+connection slave;
+sync_with_master;
+echo ----------content on slave----------;
+USE mysqltest;
+SELECT hex(cl) FROM t;
+
+connection master;
+DROP DATABASE mysqltest;
+save_master_pos;
+connection slave;
+sync_with_master;