From 7770bb1eda02ca36883f36dd4d2b4daddc9449ac Mon Sep 17 00:00:00 2001 From: XieHan Date: Wed, 15 Sep 2021 19:21:55 +0800 Subject: [PATCH] update MySQL Impl --- src/factory/MySQLTaskImpl.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/factory/MySQLTaskImpl.cc b/src/factory/MySQLTaskImpl.cc index bfc8a34f..4b3f86e1 100644 --- a/src/factory/MySQLTaskImpl.cc +++ b/src/factory/MySQLTaskImpl.cc @@ -250,12 +250,11 @@ CommMessageOut *ComplexMySQLTask::message_out() auto *target = (RouteManager::RouteTarget *)this->get_target(); /* If it's a transaction task, generate a ECONNRESET error when - * the target is reconnected. */ + * the target was reconnected. */ if (seqid <= 3 && (seqid == 2 || res_charset_.size() != 0)) { if (target->state) { - target->state = 0; errno = ECONNRESET; return NULL; } @@ -604,6 +603,13 @@ bool ComplexMySQLTask::finish_once() return false; } + if (this->is_fixed_addr() && this->state != WFT_STATE_SUCCESS) + { + auto *target = (RouteManager::RouteTarget *)this->get_target(); + if (target) + target->state = 0; + } + return true; }