summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorunknown <Li-Bing.Song@sun.com>2009-08-12 13:31:56 +0800
committerunknown <Li-Bing.Song@sun.com>2009-08-12 13:31:56 +0800
commit7b8d509b2d189cc1574d07291d02941ef7e24a59 (patch)
treec1bfc62465c2dabdae842d3de168f004e7510489 /sql/log_event.cc
parent4d6f57bfca818cca8e5644b2084e8e78d720cdab (diff)
parent0d821fafe99fbaf362529f8237b4a61a6394c0fb (diff)
downloadmariadb-git-7b8d509b2d189cc1574d07291d02941ef7e24a59.tar.gz
Manual Merge
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index e7cbbaba38e..444647d0de4 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2949,6 +2949,8 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
{
LEX_STRING new_db;
int expected_error,actual_error= 0;
+ HA_CREATE_INFO db_options;
+
/*
Colleagues: please never free(thd->catalog) in MySQL. This would
lead to bugs as here thd->catalog is a part of an alloced block,
@@ -2960,6 +2962,13 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
new_db.length= db_len;
new_db.str= (char *) rpl_filter->get_rewrite_db(db, &new_db.length);
thd->set_db(new_db.str, new_db.length); /* allocates a copy of 'db' */
+
+ /*
+ Setting the character set and collation of the current database thd->db.
+ */
+ load_db_opt_by_name(thd, thd->db, &db_options);
+ if (db_options.default_table_charset)
+ thd->db_charset= db_options.default_table_charset;
thd->variables.auto_increment_increment= auto_increment_increment;
thd->variables.auto_increment_offset= auto_increment_offset;