From a99aa83398f9d45f8a60b8ce7f126ab87f66c75a Mon Sep 17 00:00:00 2001 From: bolano Date: Tue, 11 Mar 2025 21:30:22 +0800 Subject: [PATCH] fix flush privileges --- storage/ctc/ctc_meta_data.cc | 3 +++ storage/ctc/ctc_srv.h | 1 + storage/ctc/ha_ctc.cc | 2 ++ 3 files changed, 6 insertions(+) diff --git a/storage/ctc/ctc_meta_data.cc b/storage/ctc/ctc_meta_data.cc index 6fdbfd9..4e7b023 100644 --- a/storage/ctc/ctc_meta_data.cc +++ b/storage/ctc/ctc_meta_data.cc @@ -444,6 +444,9 @@ static typename std::enable_if::type if (broadcast_req->is_dcl == true) { error = reload_acl_caches(thd, false); ctc_log_system("[CTC_INVALID_DD]: remote invalidate acl cache, mysql_inst_id=%u", broadcast_req->mysql_inst_id); + if (broadcast_req->is_flush == true) { + reset_mqh(thd, (LEX_USER *)nullptr, true); + } } else { invalidate_obj_entry_t *obj = NULL; uint32_t offset = 1; diff --git a/storage/ctc/ctc_srv.h b/storage/ctc/ctc_srv.h index 345be8e..8268de6 100644 --- a/storage/ctc/ctc_srv.h +++ b/storage/ctc/ctc_srv.h @@ -230,6 +230,7 @@ typedef struct { uint32_t buff_len; uint32_t mysql_inst_id; bool is_dcl; + bool is_flush; int err_code; } ctc_invalidate_broadcast_request; diff --git a/storage/ctc/ha_ctc.cc b/storage/ctc/ha_ctc.cc index 178c2ae..2b58246 100644 --- a/storage/ctc/ha_ctc.cc +++ b/storage/ctc/ha_ctc.cc @@ -1358,6 +1358,7 @@ static typename std::enable_if::typ req.mysql_inst_id = ctc_instance_id; req.buff_len = 1; req.is_dcl = false; + req.is_flush = (tch->sql_command == SQLCOM_FLUSH) ? true : false; invalidate_obj_entry_t *obj = NULL; for (auto invalidate_it : thd->invalidates()) { @@ -1411,6 +1412,7 @@ bool invalidate_remote_dcl_cache(ctc_handler_t *tch) req.mysql_inst_id = ctc_instance_id; req.buff_len = 0; req.is_dcl = true; + req.is_flush = (tch->sql_command == SQLCOM_FLUSH) ? true : false; bool result = ctc_broadcast_mysql_dd_invalidate(tch, &req); return result; } -- Gitee