Skip to content

Commit

Permalink
Cannot use get_target() if not connected.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim committed Sep 8, 2023
1 parent 3b6465e commit 31b3379
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/factory/MySQLTaskImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 31b3379

Please sign in to comment.