summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/log.h5
-rw-r--r--sql/sql_repl.cc5
2 files changed, 9 insertions, 1 deletions
diff --git a/sql/log.h b/sql/log.h
index 81342f6e696..9ed5db04e87 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -130,6 +130,11 @@ extern TC_LOG_DUMMY tc_log_dummy;
class Relay_log_info;
+/*
+ Note that we destroy the lock mutex in the desctructor here.
+ This means that object instances cannot be destroyed/go out of scope,
+ until we have reset thd->current_linfo to NULL;
+ */
typedef struct st_log_info
{
char log_file_name[FN_REFLEN];
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index a2c388ba388..b985805a827 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1454,6 +1454,8 @@ bool mysql_show_binlog_events(THD* thd)
IO_CACHE log;
File file = -1;
int old_max_allowed_packet= thd->variables.max_allowed_packet;
+ LOG_INFO linfo;
+
DBUG_ENTER("mysql_show_binlog_events");
Log_event::init_show_field_list(&field_list);
@@ -1480,7 +1482,6 @@ bool mysql_show_binlog_events(THD* thd)
char search_file_name[FN_REFLEN], *name;
const char *log_file_name = lex_mi->log_file_name;
pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();
- LOG_INFO linfo;
Log_event* ev;
unit->set_limit(thd->lex->current_select);
@@ -1572,6 +1573,8 @@ bool mysql_show_binlog_events(THD* thd)
pthread_mutex_unlock(log_lock);
}
+ // Check that linfo is still on the function scope.
+ DEBUG_SYNC(thd, "after_show_binlog_events");
ret= FALSE;