From 31b33794434565460c2302580faeb7085d985ab3 Mon Sep 17 00:00:00 2001 From: Xie Han <63350856@qq.com> Date: Fri, 8 Sep 2023 20:20:05 +0800 Subject: [PATCH] Cannot use get_target() if not connected. --- src/factory/MySQLTaskImpl.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/factory/MySQLTaskImpl.cc b/src/factory/MySQLTaskImpl.cc index e753e41216..c71348741d 100644 --- a/src/factory/MySQLTaskImpl.cc +++ b/src/factory/MySQLTaskImpl.cc @@ -243,7 +243,7 @@ CommMessageOut *ComplexMySQLTask::message_out() case ST_FIRST_USER_REQUEST: if (this->is_fixed_addr()) { - auto *target = (RouteManager::RouteTarget *)this->get_target(); + auto *target = (RouteManager::RouteTarget *)this->target; /* If it's a transaction task, generate a ECONNRESET error when * the target was reconnected. */ @@ -745,9 +745,8 @@ bool ComplexMySQLTask::finish_once() { if (this->state != WFT_STATE_SUCCESS || this->keep_alive_timeo == 0) { - CommTarget *target = this->get_target(); - if (target) - ((RouteManager::RouteTarget *)target)->state = 0; + if (this->target) + ((RouteManager::RouteTarget *)this->target)->state = 0; } }