diff options
author | unknown <aelkin@mysql.com> | 2006-05-15 18:05:23 +0300 |
---|---|---|
committer | unknown <aelkin@mysql.com> | 2006-05-15 18:05:23 +0300 |
commit | b6c7f5f2a80e6123f0106254c6c56af8f33f12d7 (patch) | |
tree | b9200a34dc22548210c1f4a98fe648f407ef18d0 /sql/sql_base.cc | |
parent | df8b4a06028c6eaedc03c7e07c6006bfeb0d8626 (diff) | |
download | mariadb-git-b6c7f5f2a80e6123f0106254c6c56af8f33f12d7.tar.gz |
BUG#14157: utf8 encoding in binlog without set character_set_client: e.g DROP temporary
specific to 5.0 version of the patch is motivated by the fact that a wrapper over
MYSQLLOG::write can not help in 5.0 where query's charset is embedded into event instance in the constructor.
sql/mysql_priv.h:
this 4.1 specific code does not help in 5.0
sql/sql_base.cc:
No wrapper similar to 4.1's version is done since Query_log_event constructor
takes care of encodings in 5.0 whereas log::write method does it in 4.1.
We can introduce an additional constuctor for Query_log_event to pass desired
(i.e system_character_info) charset different from THD's version.
But I am delaying this while there are not more bugs similar to this one reported.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index b6694edea78..c83e847bc8a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -715,9 +715,12 @@ void close_temporary_tables(THD *thd) close_temporary(table, 1); } thd->clear_error(); + CHARSET_INFO *cs_save= thd->variables.character_set_client; + thd->variables.character_set_client= system_charset_info; Query_log_event qinfo(thd, s_query.ptr(), s_query.length() - 1 /* to remove trailing ',' */, 0, FALSE); + thd->variables.character_set_client= cs_save; /* Imagine the thread had created a temp table, then was doing a SELECT, and the SELECT was killed. Then it's not clever to mark the statement above as @@ -728,7 +731,7 @@ void close_temporary_tables(THD *thd) rightfully causing the slave to stop. */ qinfo.error_code= 0; - write_binlog_with_system_charset(thd, &qinfo); + mysql_bin_log.write(&qinfo); } else { |