From 1216f9fc7098c9e300178f476a01e161213e3e36 Mon Sep 17 00:00:00 2001 From: Gagan Goel Date: Wed, 3 Jun 2020 20:35:44 -0400 Subject: [PATCH] For INSERT ... SELECT, don't use the is_cache_insert flag when starting bulk insert. This will invoke cpimport for the query instead of batch inserts mode. This is intentional as batch inserts currently have an edge case mentioned in MCOL-4037 that needs to be fixed. --- dbcon/mysql/ha_mcs.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbcon/mysql/ha_mcs.cpp b/dbcon/mysql/ha_mcs.cpp index 4e0212bfa..73f594812 100644 --- a/dbcon/mysql/ha_mcs.cpp +++ b/dbcon/mysql/ha_mcs.cpp @@ -1329,7 +1329,8 @@ ha_mcs_cache::ha_mcs_cache(handlerton *hton, TABLE_SHARE *table_arg, MEM_ROOT *m ha_mcs_cache::~ha_mcs_cache() { - delete cache_handler; + if (cache_handler) + delete cache_handler; } /* @@ -1593,7 +1594,7 @@ void ha_mcs_cache::start_bulk_insert(ha_rows rows, uint flags) bzero(&cache_handler->copy_info, sizeof(cache_handler->copy_info)); return cache_handler->start_bulk_insert(rows, flags); } - return parent::start_bulk_insert_from_cache(rows, flags); + return parent::start_bulk_insert(rows, flags); }