From 2bdb40ed646d92e70ef71ce892a2cc18367ae176 Mon Sep 17 00:00:00 2001 From: benthompson15 Date: Fri, 10 Apr 2020 17:43:21 -0500 Subject: [PATCH] add logic for ha_mcs_impl_direct_update_delete_rows to handle delete statements with replication enabled. --- dbcon/mysql/ha_mcs_impl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index e93275be6..00987e353 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -2291,6 +2291,17 @@ int ha_mcs_impl_direct_update_delete_rows(bool execute, ha_rows *affected_rows) cal_impl_if::gp_walk_info gwi; gwi.thd = thd; + if (thd->slave_thread && !get_replication_slave(thd) && ( + thd->lex->sql_command == SQLCOM_INSERT || + thd->lex->sql_command == SQLCOM_INSERT_SELECT || + thd->lex->sql_command == SQLCOM_UPDATE || + thd->lex->sql_command == SQLCOM_UPDATE_MULTI || + thd->lex->sql_command == SQLCOM_DELETE || + thd->lex->sql_command == SQLCOM_DELETE_MULTI || + thd->lex->sql_command == SQLCOM_TRUNCATE || + thd->lex->sql_command == SQLCOM_LOAD)) + return 0; + if (execute) { rc = doUpdateDelete(thd, gwi);