diff options
author | sachin <sachin.setiya@mariadb.com> | 2018-05-30 16:25:44 +0530 |
---|---|---|
committer | sachin <sachin.setiya@mariadb.com> | 2018-07-18 17:13:24 +0530 |
commit | ada54101a7185782657813c553907f61f2a35faf (patch) | |
tree | 89aa3beabdf92dcc6c8b748c1f934a2d8870f1b5 /sql | |
parent | e5c26fdfab3d43ad2b0524a3bf29f59f6fab37d8 (diff) | |
download | mariadb-git-ada54101a7185782657813c553907f61f2a35faf.tar.gz |
MDEV-9266 Creating index on temporaray table breaks replication
Problem:- Create/drop index was logged into binlog.
Goal:- Operation on temporary table should not be binlog when binlog format
is row.
Solution:-
We should add CF_FORCE_ORIGINAL_BINLOG_FORMAT when there is ddl on temp
table.
For optimize, analyze, repair we wont change anything ,Then will
be logged in binlog , But they also dont throw any error if operation fails
Since slave wont be having any temp table , but these operation on tmp
table will be processed without breaking replication.
For rename we need a different logic MDEV-16728 will solve it.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_parse.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 28d11ef2e5c..a9849c7248d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -457,6 +457,9 @@ void init_update_queries(void) sql_command_flags[SQLCOM_TRUNCATE]|= CF_FORCE_ORIGINAL_BINLOG_FORMAT; /* We don't want to replicate DROP for temp tables in row format */ sql_command_flags[SQLCOM_DROP_TABLE]|= CF_FORCE_ORIGINAL_BINLOG_FORMAT; + /* We don't want to replicate CREATE/DROP INDEX for temp tables in row format */ + sql_command_flags[SQLCOM_CREATE_INDEX]|= CF_FORCE_ORIGINAL_BINLOG_FORMAT; + sql_command_flags[SQLCOM_DROP_INDEX]|= CF_FORCE_ORIGINAL_BINLOG_FORMAT; /* One can change replication mode with SET */ sql_command_flags[SQLCOM_SET_OPTION]|= CF_FORCE_ORIGINAL_BINLOG_FORMAT; |