[MDEV-20335] Extra trans_commit_stmt after rollback caused by incorrect fix of MDEV-14401 Created: 2019-08-13  Updated: 2019-08-13  Resolved: 2019-08-13

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.2.27, 10.1.42, 10.3.18

Type: Bug Priority: Major
Reporter: Jan Lindström (Inactive) Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

commit ba576c5b787de0b2218843d83f4524279ae7848b

  if (thd->is_error() || (thd->variables.option_bits & OPTION_MASTER_SQL_ERROR))
      trans_rollback_stmt(thd);
#ifdef WITH_WSREP
    if (thd->spcont &&
             (thd->wsrep_conflict_state == MUST_ABORT ||
              thd->wsrep_conflict_state == ABORTED    ||
              thd->wsrep_conflict_state == CERT_FAILURE))
    {
      /*
        The error was cleared, but THD was aborted by wsrep and
        wsrep_conflict_state is still set accordingly. This
        situation is expected if we are running a stored procedure
        that declares a handler that catches ER_LOCK_DEADLOCK error.
        In which case the error may have been cleared in method
        sp_rcontext::handle_sql_condition().
      */
      trans_rollback_stmt(thd);
      thd->wsrep_conflict_state= NO_CONFLICT;
      thd->killed= NOT_KILLED;
    }
#endif /* WITH_WSREP */
    else
    {
      /* If commit fails, we should be able to reset the OK status. */
      thd->get_stmt_da()->set_overwrite_status(true);
      trans_commit_stmt(thd);
      thd->get_stmt_da()->set_overwrite_status(false);
    }


Generated at Thu Feb 08 08:58:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.