From abceaa75428f9b2d64ce64629d010af9aa6eae1f Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 26 Oct 2017 19:14:37 +0300 Subject: Optimize RUN_HOOK() call RUN_HOOK() is only called if semisync is enabled As the server can't disable the hooks if something is in progress, I added a new variable, run_hooks_enabled, that is set the first time semi sync is used. This means that RUN_HOOK will have no overhead, unless semi sync master or slave has been enabled once. Some of the changes was just to get rid of warnings for embedded server --- sql/handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/handler.cc') diff --git a/sql/handler.cc b/sql/handler.cc index 4e059e0e56c..47eb58e17f3 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1484,7 +1484,7 @@ done: 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)); + (void) RUN_HOOK(transaction, after_commit, (thd, FALSE)); goto end; /* Come here if error and we need to rollback. */ -- cgit v1.2.1