diff options
author | knielsen@mysql.com <> | 2006-06-19 14:31:22 +0200 |
---|---|---|
committer | knielsen@mysql.com <> | 2006-06-19 14:31:22 +0200 |
commit | 1b7fe10981127b4b6d668699d8fa51c37d869e14 (patch) | |
tree | 8a0f64dee453650cb5f36c232ea082e91390c577 /sql | |
parent | f8b1b460651bf005b135cf1540bbef76361f02a9 (diff) | |
download | mariadb-git-1b7fe10981127b4b6d668699d8fa51c37d869e14.tar.gz |
Fix a Valgrind leak error report for not freed binlog injector singleton.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysqld.cc | 7 | ||||
-rw-r--r-- | sql/rpl_injector.cc | 10 | ||||
-rw-r--r-- | sql/rpl_injector.h | 5 |
3 files changed, 22 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ad6f7401965..87f3cd04605 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -28,6 +28,10 @@ #include "ha_myisam.h" +#ifdef HAVE_ROW_BASED_REPLICATION +#include "rpl_injector.h" +#endif + #ifdef WITH_INNOBASE_STORAGE_ENGINE #define OPT_INNODB_DEFAULT 1 #else @@ -1183,6 +1187,9 @@ void clean_up(bool print_message) what they have that is dependent on the binlog */ ha_binlog_end(current_thd); +#ifdef HAVE_ROW_BASED_REPLICATION + injector::free_instance(); +#endif mysql_bin_log.cleanup(); #ifdef HAVE_REPLICATION diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index 265f5f61213..012ff61e65e 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -155,6 +155,16 @@ injector *injector::instance() return s_injector; } +void injector::free_instance() +{ + injector *inj = s_injector; + + if (inj != 0) + { + s_injector= 0; + delete inj; + } +} injector::transaction injector::new_trans(THD *thd) diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h index 14d5cca9b6c..c09e9753df3 100644 --- a/sql/rpl_injector.h +++ b/sql/rpl_injector.h @@ -59,6 +59,11 @@ public: */ static injector *instance(); + /* + Delete the singleton instance (if allocated). Used during server shutdown. + */ + static void free_instance(); + /* A transaction where rows can be added. |