diff options
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r-- | sql/temporary_tables.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 1a8b5c471bd..981958abdb2 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2016, 2019, MariaDB Corporation. + Copyright (c) 2016, 2021, 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 @@ -872,10 +872,12 @@ void THD::restore_tmp_table_share(TMP_TABLE_SHARE *share) bool THD::has_temporary_tables() { DBUG_ENTER("THD::has_temporary_tables"); - bool result= (rgi_slave - ? (rgi_slave->rli->save_temporary_tables && - !rgi_slave->rli->save_temporary_tables->is_empty()) - : (has_thd_temporary_tables())); + bool result= +#ifdef HAVE_REPLICATION + rgi_slave ? (rgi_slave->rli->save_temporary_tables && + !rgi_slave->rli->save_temporary_tables->is_empty()) : +#endif + has_thd_temporary_tables(); DBUG_RETURN(result); } @@ -1506,12 +1508,14 @@ bool THD::lock_temporary_tables() DBUG_RETURN(false); } +#ifdef HAVE_REPLICATION if (rgi_slave) { mysql_mutex_lock(&rgi_slave->rli->data_lock); temporary_tables= rgi_slave->rli->save_temporary_tables; m_tmp_tables_locked= true; } +#endif DBUG_RETURN(m_tmp_tables_locked); } @@ -1532,6 +1536,7 @@ void THD::unlock_temporary_tables() DBUG_VOID_RETURN; } +#ifdef HAVE_REPLICATION if (rgi_slave) { rgi_slave->rli->save_temporary_tables= temporary_tables; @@ -1539,6 +1544,7 @@ void THD::unlock_temporary_tables() mysql_mutex_unlock(&rgi_slave->rli->data_lock); m_tmp_tables_locked= false; } +#endif DBUG_VOID_RETURN; } |