From 7033af9e81a69d75199faa028f8959667f755551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 16 Mar 2018 08:34:12 +0200 Subject: [PATCH] Conditionally define TRX_WSREP_ABORT --- storage/innobase/handler/ha_innodb.cc | 4 ++++ storage/innobase/include/trx0trx.h | 12 +++++++----- storage/xtradb/handler/ha_innodb.cc | 4 ++++ storage/xtradb/include/trx0trx.h | 12 +++++++----- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 31ea969fa21..7c412344920 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4917,8 +4917,10 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) ut_ad(trx->mysql_thd == thd); switch (trx->abort_type) { +#ifdef WITH_WSREP case TRX_WSREP_ABORT: break; +#endif case TRX_SERVER_ABORT: if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { lock_mutex_enter(); @@ -4930,8 +4932,10 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); switch (trx->abort_type) { +#ifdef WITH_WSREP case TRX_WSREP_ABORT: break; +#endif case TRX_SERVER_ABORT: if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { lock_mutex_exit(); diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 68941363620..fe16b8272b8 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation. +Copyright (c) 2015, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -695,11 +695,13 @@ lock_rec_convert_impl_to_expl()) will access transactions associated to other connections. The locks of transactions are protected by lock_sys->mutex and sometimes by trx->mutex. */ -typedef enum { +enum trx_abort_t { TRX_SERVER_ABORT = 0, - TRX_WSREP_ABORT = 1, - TRX_REPLICATION_ABORT = 2 -} trx_abort_t; +#ifdef WITH_WSREP + TRX_WSREP_ABORT, +#endif + TRX_REPLICATION_ABORT +}; struct trx_t{ ulint magic_n; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 7d550c45356..2b7dc01238c 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -5513,8 +5513,10 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) ut_ad(trx->mysql_thd == thd); switch (trx->abort_type) { +#ifdef WITH_WSREP case TRX_WSREP_ABORT: break; +#endif case TRX_SERVER_ABORT: if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { lock_mutex_enter(); @@ -5526,8 +5528,10 @@ static void innobase_kill_query(handlerton*, THD* thd, enum thd_kill_levels) /* Cancel a pending lock request if there are any */ lock_trx_handle_wait(trx); switch (trx->abort_type) { +#ifdef WITH_WSREP case TRX_WSREP_ABORT: break; +#endif case TRX_SERVER_ABORT: if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { lock_mutex_exit(); diff --git a/storage/xtradb/include/trx0trx.h b/storage/xtradb/include/trx0trx.h index 5db19b3959a..77afde4c35c 100644 --- a/storage/xtradb/include/trx0trx.h +++ b/storage/xtradb/include/trx0trx.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation +Copyright (c) 2015, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -744,11 +744,13 @@ lock_rec_convert_impl_to_expl()) will access transactions associated to other connections. The locks of transactions are protected by lock_sys->mutex and sometimes by trx->mutex. */ -typedef enum { +enum trx_abort_t { TRX_SERVER_ABORT = 0, - TRX_WSREP_ABORT = 1, - TRX_REPLICATION_ABORT = 2 -} trx_abort_t; +#ifdef WITH_WSREP + TRX_WSREP_ABORT, +#endif + TRX_REPLICATION_ABORT +}; struct trx_t{ ulint magic_n;