From 19b4702a24c04aad8f714a1db3394840e21806a3 Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Tue, 10 Dec 2019 22:39:49 -0600 Subject: [PATCH] This patch fllows the change introduced in the direct_update/delete API in 10.4.11 to fix MDEV-18973 in Spider. --- dbcon/mysql/ha_mcs.cpp | 17 ++++++++++++----- dbcon/mysql/ha_mcs.h | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dbcon/mysql/ha_mcs.cpp b/dbcon/mysql/ha_mcs.cpp index ad5d573af..d8fd5d8e1 100644 --- a/dbcon/mysql/ha_mcs.cpp +++ b/dbcon/mysql/ha_mcs.cpp @@ -338,19 +338,18 @@ int ha_mcs::update_row(const uchar* old_data, uchar* new_data) DBUG_RETURN(rc); } -// WIP /** @brief - Yes, update_row() does what you expect, it updates a row. old_data will have - the previous row record in it, while new_data will have the newest data in it. - Keep in mind that the server can do updates based on ordering if an ORDER BY - clause was used. Consecutive ordering is not guaranteed. + Durect UPDATE/DELETE are the features that allows engine to run UPDATE + or DELETE on its own. There are number of limitations that dissalows + the feature. @details @code @endcode @see + mysql_update()/mysql_delete */ int ha_mcs::direct_update_rows_init(List *update_fields) { @@ -365,6 +364,14 @@ int ha_mcs::direct_update_rows(ha_rows *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); + *found_rows = *update_rows; + DBUG_RETURN(rc); +} + int ha_mcs::direct_delete_rows_init() { DBUG_ENTER("ha_mcs::direct_delete_rows_init"); diff --git a/dbcon/mysql/ha_mcs.h b/dbcon/mysql/ha_mcs.h index 31dcae4af..cd29a165b 100644 --- a/dbcon/mysql/ha_mcs.h +++ b/dbcon/mysql/ha_mcs.h @@ -154,6 +154,7 @@ public: int update_row(const uchar* old_data, uchar* new_data); int direct_update_rows_init(List *update_fields); int direct_update_rows(ha_rows *update_rows); + int direct_update_rows(ha_rows *update_rows, ha_rows *found_rows); /** @brief We implement this in ha_example.cc. It's not an obligatory method;