List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:May 9 2006 8:01pm
Subject:bk commit into 4.1 tree (aelkin:1.2462) BUG#14157
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of elkin. When elkin 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
  1.2462 06/05/09 23:01:31 aelkin@stripped +8 -0
  BUG#14157: utf8 encoding in binlog without set character_set_client e.g DROP temporary
  
  Binlog lacks encoding info about DROPped temporary table.
  
  Idea of the fix is to switch temporary to system_charset_info when a temporary table
  is DROPped for binlog. Since that is the server, that automatically, but not the client, who generates the query
  the binlog should be updated on the server's encoding for the coming DROP.
  The `write_binlog_with_system_charset()' is introduced to replace similar problematic places in the code.

  sql/sql_base.cc
    1.268 06/05/09 23:01:28 aelkin@stripped +1 -1
    Idea of the fix is to switch temporary to system_charset_info when a temporary table
    is DROPped for binlog. Since that is the server, not the client, who generates the query
    the binlog should be updated on server's encoding for the coming DROP.

  sql/mysql_priv.h
    1.376 06/05/09 23:01:28 aelkin@stripped +7 -0
    `write_binlog_with_system_charset()' is added to be called when a binlog event
    is created "implicitly" like DROP temporary table is case of closing connection.

  mysql-test/t/rpl_temporary.test
    1.16 06/05/09 23:01:27 aelkin@stripped +12 -0
    Check slave digests binlog with DROP temporary tables created in koi8r.

  mysql-test/t/mysqlbinlog.test
    1.17 06/05/09 23:01:27 aelkin@stripped +10 -1
    Check roll-forward recovery from binlog where there are DROP temporary tables created
    in koi8r.

  mysql-test/r/rpl_temporary.result
    1.14 06/05/09 23:01:27 aelkin@stripped +4 -0
    results changed

  mysql-test/r/mysqlbinlog.result
    1.11 06/05/09 23:01:27 aelkin@stripped +6 -1
    results changed

  mysql-test/r/mix_innodb_myisam_binlog.result
    1.13 06/05/09 23:01:27 aelkin@stripped +3 -2
    results changed

  mysql-test/r/drop_temp_table.result
    1.11 06/05/09 23:01:27 aelkin@stripped +1 -0
    results changed

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	aelkin
# Host:	dsl-hkigw8-feb0de00-199.dhcp.inet.fi
# Root:	/usr_rh9/home/elkin.rh9/MySQL/FIXES/4.1-bug14157-utf8_binlog

--- 1.375/sql/mysql_priv.h	2006-04-07 22:48:18 +03:00
+++ 1.376/sql/mysql_priv.h	2006-05-09 23:01:28 +03:00
@@ -1275,6 +1275,13 @@
   return -1;
 }
 
+inline void write_binlog_with_system_charset(THD * thd, Query_log_event * qinfo)
+{
+  CHARSET_INFO * cs_save= thd->variables.character_set_client;
+  thd->variables.character_set_client= system_charset_info;
+  mysql_bin_log.write(qinfo);
+  thd->variables.character_set_client= cs_save;
+}
 
 /*
   Some functions that are different in the embedded library and the normal

--- 1.267/sql/sql_base.cc	2006-04-23 19:42:21 +03:00
+++ 1.268/sql/sql_base.cc	2006-05-09 23:01:28 +03:00
@@ -615,7 +615,7 @@
         rightfully causing the slave to stop.
       */
       qinfo.error_code= 0;
-      mysql_bin_log.write(&qinfo);
+      write_binlog_with_system_charset(thd, &qinfo);
     }
     else 
     {

--- 1.10/mysql-test/r/mysqlbinlog.result	2006-02-10 15:12:21 +02:00
+++ 1.11/mysql-test/r/mysqlbinlog.result	2006-05-09 23:01:27 +03:00
@@ -101,4 +101,9 @@
 select HEX(f) from t4;
 HEX(f)
 835C
-drop table t1, t2, t03, t04, t3, t4;
+flush logs;
+select * from t5  /* must be (1),(1) */;
+a
+1
+1
+drop table t1, t2, t03, t04, t3, t4, t5;

--- 1.16/mysql-test/t/mysqlbinlog.test	2006-02-10 15:12:22 +02:00
+++ 1.17/mysql-test/t/mysqlbinlog.test	2006-05-09 23:01:27 +03:00
@@ -114,8 +114,17 @@
 select HEX(f) from t04;
 select HEX(f) from t4;
 
+#
+#14157: utf8 encoding in binlog without set character_set_client
+#
+flush logs;
+
+# resulted log is client charset insensitive (latin1 not koi8r) as it must be
+--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000006 | $MYSQL --default-character-set=latin1
+select * from t5  /* must be (1),(1) */;
 
 # clean up
-drop table t1, t2, t03, t04, t3, t4; 
+drop table t1, t2, t03, t04, t3, t4, t5; 
 
 # End of 4.1 tests

--- 1.10/mysql-test/r/drop_temp_table.result	2005-02-15 00:46:44 +02:00
+++ 1.11/mysql-test/r/drop_temp_table.result	2006-05-09 23:01:27 +03:00
@@ -17,6 +17,7 @@
 master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; create temporary table shortn1 (a int)
 master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; create temporary table `table:name` (a int)
 master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; create temporary table shortn2 (a int)
+master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; SET ONE_SHOT CHARACTER_SET_CLIENT=33,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=8
 master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1`
 master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; DO RELEASE_LOCK("a")
 drop database `drop-temp+table-test`;

--- 1.12/mysql-test/r/mix_innodb_myisam_binlog.result	2005-11-17 06:17:34 +02:00
+++ 1.13/mysql-test/r/mix_innodb_myisam_binlog.result	2006-05-09 23:01:27 +03:00
@@ -249,7 +249,8 @@
 master-bin.000001	1117	Query	1	1117	use `test`; DO RELEASE_LOCK("a")
 master-bin.000001	1172	Query	1	1172	use `test`; insert into t0 select GET_LOCK("lock1",null)
 master-bin.000001	1251	Query	1	1251	use `test`; create table t2 (n int) engine=innodb
-master-bin.000001	1323	Query	1	1323	use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
-master-bin.000001	1424	Query	1	1424	use `test`; DO RELEASE_LOCK("lock1")
+master-bin.000001	1323	Query	1	1323	use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=33,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=8
+master-bin.000001	1457	Query	1	1457	use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
+master-bin.000001	1558	Query	1	1558	use `test`; DO RELEASE_LOCK("lock1")
 do release_lock("lock1");
 drop table t0,t2;

--- 1.13/mysql-test/r/rpl_temporary.result	2006-04-23 11:55:04 +03:00
+++ 1.14/mysql-test/r/rpl_temporary.result	2006-05-09 23:01:27 +03:00
@@ -103,3 +103,7 @@
 f
 1
 drop table t1;
+select * from t1;
+a
+1
+drop table t1;

--- 1.15/mysql-test/t/rpl_temporary.test	2006-04-23 11:55:04 +03:00
+++ 1.16/mysql-test/t/rpl_temporary.test	2006-05-09 23:01:27 +03:00
@@ -156,4 +156,16 @@
 connection master; 
 drop table t1;
 
+#
+#14157: utf8 encoding in binlog without set character_set_client
+#
+
+sync_slave_with_master;
+#connection slave;
+select * from t1;
+
+connection master; 
+drop table t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (aelkin:1.2462) BUG#14157Andrei Elkin9 May