summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorsachin <sachin.setiya@mariadb.com>2018-05-30 16:25:44 +0530
committersachin <sachin.setiya@mariadb.com>2018-07-18 17:13:24 +0530
commitada54101a7185782657813c553907f61f2a35faf (patch)
tree89aa3beabdf92dcc6c8b748c1f934a2d8870f1b5 /sql
parente5c26fdfab3d43ad2b0524a3bf29f59f6fab37d8 (diff)
downloadmariadb-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.cc3
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;