From e4dde6157d59ffbe70a1c61d67aada0073967b02 Mon Sep 17 00:00:00 2001 From: Gagan Goel Date: Thu, 14 May 2020 16:21:49 -0400 Subject: [PATCH] MCOL-4002 Reset cal_connection_info members at the end of ha_mcs_impl_end_bulk_insert() for transactions as well. --- dbcon/mysql/ha_mcs_impl.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index 0fbfb0ca1..358251ddf 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -3832,14 +3832,15 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table) } } - if (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) - { - ci->singleInsert = true; // reset the flag - ci->isLoaddataInfile = false; - ci->tableOid = 0; - ci->rowsHaveInserted = 0; - ci->useCpimport = 1; - } + // MCOL-4002 We earlier had these re-initializations set only for + // non-transactions, i.e.: + // !(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + // However, we should be resetting these members anyways. + ci->singleInsert = true; // reset the flag + ci->isLoaddataInfile = false; + ci->tableOid = 0; + ci->rowsHaveInserted = 0; + ci->useCpimport = 1; return rc; }