From b7396129c7683a66f1c9b1cb10cc6b3e9e081470 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Fri, 13 Dec 2019 07:33:29 +0000 Subject: [PATCH] MCOL-3672 Fix regression in deletes Deletes appear to only use the direct delete path. This allows that to happen. --- dbcon/mysql/ha_mcs.cpp | 6 +++--- dbcon/mysql/ha_mcs_impl.cpp | 8 +++++++- dbcon/mysql/ha_mcs_impl.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dbcon/mysql/ha_mcs.cpp b/dbcon/mysql/ha_mcs.cpp index d8fd5d8e1..77c71d5bd 100644 --- a/dbcon/mysql/ha_mcs.cpp +++ b/dbcon/mysql/ha_mcs.cpp @@ -360,14 +360,14 @@ int ha_mcs::direct_update_rows_init(List *update_fields) int ha_mcs::direct_update_rows(ha_rows *update_rows) { DBUG_ENTER("ha_mcs::direct_update_rows"); - int rc = ha_mcs_impl_direct_update_delete_rows(update_rows); + int rc = ha_mcs_impl_direct_update_delete_rows(false, update_rows); DBUG_RETURN(rc); } int ha_mcs::direct_update_rows(ha_rows *update_rows, ha_rows *found_rows) { DBUG_ENTER("ha_mcs::direct_update_rows"); - int rc = ha_mcs_impl_direct_update_delete_rows(update_rows); + int rc = ha_mcs_impl_direct_update_delete_rows(false, update_rows); *found_rows = *update_rows; DBUG_RETURN(rc); } @@ -381,7 +381,7 @@ int ha_mcs::direct_delete_rows_init() int ha_mcs::direct_delete_rows(ha_rows *deleted_rows) { DBUG_ENTER("ha_mcs::direct_delete_rows"); - int rc = ha_mcs_impl_direct_update_delete_rows(deleted_rows); + int rc = ha_mcs_impl_direct_update_delete_rows(true, deleted_rows); DBUG_RETURN(rc); } /** diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index b1130f273..d63cc2f05 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -2281,12 +2281,18 @@ int ha_mcs_impl_discover_existence(const char* schema, const char* name) return 0; } -int ha_mcs_impl_direct_update_delete_rows(ha_rows *affected_rows) +int ha_mcs_impl_direct_update_delete_rows(bool execute, ha_rows *affected_rows) { THD* thd = current_thd; + int rc = 0; cal_impl_if::gp_walk_info gwi; gwi.thd = thd; + if (execute) + { + rc = doUpdateDelete(thd, gwi); + } + cal_connection_info* ci = reinterpret_cast(get_fe_conn_info_ptr()); if (ci) { diff --git a/dbcon/mysql/ha_mcs_impl.h b/dbcon/mysql/ha_mcs_impl.h index 692983d5b..f332b8fc8 100644 --- a/dbcon/mysql/ha_mcs_impl.h +++ b/dbcon/mysql/ha_mcs_impl.h @@ -42,7 +42,7 @@ extern int ha_mcs_impl_close_connection (handlerton* hton, THD* thd); extern COND* ha_mcs_impl_cond_push(COND* cond, TABLE* table); extern int ha_mcs_impl_external_lock(THD* thd, TABLE* table, int lock_type); extern int ha_mcs_impl_update_row(); -extern int ha_mcs_impl_direct_update_delete_rows(ha_rows *affected_rows); +extern int ha_mcs_impl_direct_update_delete_rows(bool execute, ha_rows *affected_rows); extern int ha_mcs_impl_delete_row(); extern int ha_mcs_impl_rnd_pos(uchar* buf, uchar* pos); extern int ha_cs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table);