summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2008-10-07 18:21:17 +0500
committerRamil Kalimullin <ramil@mysql.com>2008-10-07 18:21:17 +0500
commitb4c5cafeb01adb9f8303520342ff0621d41cf8f8 (patch)
tree0a67b437f529d3b252530725f2041e439642c4ba /sql/log_event.cc
parent27de09facf28d88dc7eeeac69b87784a1ae4b3c6 (diff)
downloadmariadb-git-b4c5cafeb01adb9f8303520342ff0621d41cf8f8.tar.gz
Fix for bug#38269: pushbuild gives valgrind error in
ha_statistic_increment for rpl_temporary Problem: in some cases master send a special event to reconnecting slave to keep slave's temporary tables (see #17284) and they still have references to the "old" SQL slave thread and use them to access thread's data. Fix: set temporary tables thread references to the actual SQL slave thread in such cases. mysql-test/suite/rpl/t/disabled.def: Fix for bug#38269: pushbuild gives valgrind error in ha_statistic_increment for rpl_temporary - rpl_temporary test enabled. sql/log_event.cc: Fix for bug#38269: pushbuild gives valgrind error in ha_statistic_increment for rpl_temporary - if we keep slave's temporary tables after reconnect, set their thread pointers (->in_use) to the current SQL thread.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index da6e7ef2a1c..f91ebf3823f 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3350,6 +3350,17 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli)
close_temporary_tables(thd);
cleanup_load_tmpdir();
}
+ else
+ {
+ /*
+ Set all temporary tables thread references to the current thread
+ as they may point to the "old" SQL slave thread in case of its
+ restart.
+ */
+ TABLE *table;
+ for (table= thd->temporary_tables; table; table= table->next)
+ table->in_use= thd;
+ }
break;
/*