diff options
author | sachin <sachin.setiya@mariadb.com> | 2018-05-30 16:25:44 +0530 |
---|---|---|
committer | sachin <sachin.setiya@mariadb.com> | 2018-07-12 10:32:58 +0530 |
commit | 9d03fa3bc539d822b1540c8d3ca756964e903e0e (patch) | |
tree | dd988d2b6a860ceddd4cc7dc2cbc1f5c97a98aff /sql/sql_parse.cc | |
parent | ad9d1e8c3f5a8e1b3e222921e825247aa47c4d23 (diff) | |
download | mariadb-git-bb-10.0-9266.tar.gz |
MDEV-9266 Creating index on temporaray table breaks replicationbb-10.0-9266
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/sql_parse.cc')
-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; |