diff options
author | <Li-Bing.Song@sun.com> | 2009-08-12 13:31:56 +0800 |
---|---|---|
committer | <Li-Bing.Song@sun.com> | 2009-08-12 13:31:56 +0800 |
commit | dc4b7b89436ac40362d62c661f0d28ca01ad132a (patch) | |
tree | c1bfc62465c2dabdae842d3de168f004e7510489 /sql/log_event.cc | |
parent | 501c7d2e4f2c99e12b7eec96b555f45eb763885d (diff) | |
parent | f5be2159fea9800c0d75046ab9c632abb401e9f0 (diff) | |
download | mariadb-git-dc4b7b89436ac40362d62c661f0d28ca01ad132a.tar.gz |
Manual Merge
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 9 |
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; |