summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-01-31 15:04:37 +0100
committerSergei Golubchik <serg@mariadb.org>2015-01-31 21:51:45 +0100
commit863cfb3fa5153e7754279324ba7e66a4cfdac805 (patch)
treea1eac5e06bb16f03703f03d40cfb203646e49c0b /sql
parentb050354ffb15e4e27498b169ec723da4d8aa8da6 (diff)
downloadmariadb-git-863cfb3fa5153e7754279324ba7e66a4cfdac805.tar.gz
small cleanup, remove a useless function
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc4
-rw-r--r--sql/log.cc12
-rw-r--r--sql/log.h5
-rw-r--r--sql/sql_repl.cc2
-rw-r--r--sql/transaction.cc7
5 files changed, 4 insertions, 26 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index cded7fb8cd8..637f27c2ac1 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -32,7 +32,6 @@
#include "sql_acl.h" // SUPER_ACL
#include "sql_base.h" // free_io_cache
#include "discover.h" // extension_based_table_discovery, etc
-#include "log.h" // for assert_LOCK_log_owner
#include "log_event.h" // *_rows_log_event
#include "create_options.h"
#include "rpl_filter.h"
@@ -1479,9 +1478,8 @@ int ha_commit_trans(THD *thd, bool all)
done:
DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE(););
- /* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
- assert_LOCK_log_owner(false);
+ mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
RUN_HOOK(transaction, after_commit, (thd, FALSE));
diff --git a/sql/log.cc b/sql/log.cc
index 88f612e642b..0eb475433bd 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -6042,7 +6042,6 @@ err:
}
else
{
- /* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_owner(&LOCK_log);
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
@@ -6079,7 +6078,6 @@ err:
mysql_mutex_lock(&LOCK_after_binlog_sync);
mysql_mutex_unlock(&LOCK_log);
- /* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_not_owner(&LOCK_log);
mysql_mutex_assert_owner(&LOCK_after_binlog_sync);
@@ -7410,7 +7408,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
bool any_error= false;
bool all_error= true;
- /* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_owner(&LOCK_log);
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
@@ -7498,7 +7495,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
Loop through threads and run the binlog_sync hook
*/
{
- /* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_not_owner(&LOCK_log);
mysql_mutex_assert_owner(&LOCK_after_binlog_sync);
@@ -9853,14 +9849,6 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
}
}
-void assert_LOCK_log_owner(bool owner)
-{
- if (owner)
- mysql_mutex_assert_owner(mysql_bin_log.get_log_lock());
- else
- mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
-}
-
struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
diff --git a/sql/log.h b/sql/log.h
index 390b8c3a046..8b2228f75cf 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -343,7 +343,6 @@ public:
PSI_file_key m_log_file_key;
#endif
/* for documentation of mutexes held in various places in code */
- friend void assert_LOCK_log_owner(bool owner);
};
class MYSQL_QUERY_LOG: public MYSQL_LOG
@@ -1153,8 +1152,4 @@ static inline TC_LOG *get_tc_log_implementation()
return &tc_log_mmap;
}
-void assert_LOCK_log_owner(bool owner);
-
-void assert_LOCK_log_owner(bool owner);
-
#endif /* LOG_H */
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 6bc8d7e6c45..b44bd943f89 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -2655,7 +2655,7 @@ static int send_one_binlog_file(binlog_send_info *info,
LOG_INFO* linfo,
my_off_t start_pos)
{
- assert_LOCK_log_owner(false); // we don't have LOCK_log
+ mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
/* seek to the requested position, to start the requested dump */
if (start_pos != BIN_LOG_HEADER_SIZE)
diff --git a/sql/transaction.cc b/sql/transaction.cc
index 3628790aa63..22e3ad7f87c 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -24,7 +24,6 @@
#include "rpl_handler.h"
#include "debug_sync.h" // DEBUG_SYNC
#include "sql_acl.h"
-#include "log.h" // for assert_LOCK_log_owner
/* Conditions under which the transaction state must not change. */
static bool trans_check(THD *thd)
@@ -234,9 +233,8 @@ bool trans_commit(THD *thd)
DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS"));
res= ha_commit_trans(thd, TRUE);
- /* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
- assert_LOCK_log_owner(false);
+ mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
@@ -441,9 +439,8 @@ bool trans_commit_stmt(THD *thd)
}
}
- /* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
- assert_LOCK_log_owner(false);
+ mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);