diff options
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/Makefile.am | 3 | ||||
-rw-r--r-- | plugin/daemon_example/Makefile.am | 3 | ||||
-rw-r--r-- | plugin/daemon_example/daemon_example.cc | 2 | ||||
-rw-r--r-- | plugin/fulltext/Makefile.am | 3 | ||||
-rw-r--r-- | plugin/semisync/semisync_master.cc | 19 | ||||
-rw-r--r-- | plugin/semisync/semisync_master.h | 2 | ||||
-rw-r--r-- | plugin/semisync/semisync_master_plugin.cc | 4 | ||||
-rw-r--r-- | plugin/semisync/semisync_slave_plugin.cc | 3 |
8 files changed, 24 insertions, 15 deletions
diff --git a/plugin/Makefile.am b/plugin/Makefile.am index 30ccd1236dd..4a84ce4915a 100644 --- a/plugin/Makefile.am +++ b/plugin/Makefile.am @@ -28,6 +28,3 @@ DIST_SUBDIRS = @mysql_pg_distdirs@ install-exec-hook: $(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(pkglibdir)/plugin test ! -d debug || $(TAR) cf - debug | ( cd $(DESTDIR)$(pkglibdir)/plugin && $(TAR) xvf - ) - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am index d1f2555594c..75151bdd4d9 100644 --- a/plugin/daemon_example/Makefile.am +++ b/plugin/daemon_example/Makefile.am @@ -39,6 +39,3 @@ libdaemon_example_a_CXXFLAGS = $(AM_CFLAGS) libdaemon_example_a_CFLAGS = $(AM_CFLAGS) libdaemon_example_a_SOURCES= daemon_example.cc EXTRA_DIST = CMakeLists.txt - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/plugin/daemon_example/daemon_example.cc b/plugin/daemon_example/daemon_example.cc index 2a41179974d..43138f0655f 100644 --- a/plugin/daemon_example/daemon_example.cc +++ b/plugin/daemon_example/daemon_example.cc @@ -13,12 +13,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <my_global.h> #include <sql_priv.h> #include <stdlib.h> #include <ctype.h> #include <mysql_version.h> #include <mysql/plugin.h> -#include <my_global.h> #include <my_dir.h> #include "my_pthread.h" // pthread_handler_t #include "my_sys.h" // my_write, my_malloc diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am index 0747e6d0193..80a8753b332 100644 --- a/plugin/fulltext/Makefile.am +++ b/plugin/fulltext/Makefile.am @@ -23,6 +23,3 @@ mypluglib_la_SOURCES= plugin_example.c mypluglib_la_LDFLAGS= -module -rpath $(pkgplugindir) mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN EXTRA_DIST= CMakeLists.txt - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index cdf01854442..2701c575b7a 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -147,7 +147,8 @@ int ActiveTranx::insert_tranx_node(const char *log_file_name, } /* insert the binlog position in the active transaction list. */ - strcpy(ins_node->log_name_, log_file_name); + strncpy(ins_node->log_name_, log_file_name, FN_REFLEN-1); + ins_node->log_name_[FN_REFLEN-1] = 0; /* make sure it ends properly */ ins_node->log_pos_ = log_file_pos; if (!trx_front_) @@ -1009,13 +1010,15 @@ int ReplSemiSyncMaster::writeTranxInBinlog(const char* log_file_name, if (cmp > 0) { /* This is a larger position, let's update the maximum info. */ - strcpy(commit_file_name_, log_file_name); + strncpy(commit_file_name_, log_file_name, FN_REFLEN-1); + commit_file_name_[FN_REFLEN-1] = 0; /* make sure it ends properly */ commit_file_pos_ = log_file_pos; } } else { - strcpy(commit_file_name_, log_file_name); + strncpy(commit_file_name_, log_file_name, FN_REFLEN-1); + commit_file_name_[FN_REFLEN-1] = 0; /* make sure it ends properly */ commit_file_pos_ = log_file_pos; commit_file_name_inited_ = true; } @@ -1048,6 +1051,7 @@ int ReplSemiSyncMaster::readSlaveReply(NET *net, uint32 server_id, const unsigned char *packet; char log_file_name[FN_REFLEN]; my_off_t log_file_pos; + ulong log_file_len = 0; ulong packet_len; int result = -1; @@ -1123,7 +1127,14 @@ int ReplSemiSyncMaster::readSlaveReply(NET *net, uint32 server_id, } log_file_pos = uint8korr(packet + REPLY_BINLOG_POS_OFFSET); - strcpy(log_file_name, (const char*)packet + REPLY_BINLOG_NAME_OFFSET); + log_file_len = packet_len - REPLY_BINLOG_NAME_OFFSET; + if (log_file_len >= FN_REFLEN) + { + sql_print_error("Read semi-sync reply binlog file length too large"); + goto l_end; + } + strncpy(log_file_name, (const char*)packet + REPLY_BINLOG_NAME_OFFSET, log_file_len); + log_file_name[log_file_len] = 0; if (trc_level & kTraceDetail) sql_print_information("%s: Got reply (%s, %lu)", diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h index e1ad28cd9f6..1a562e8bb77 100644 --- a/plugin/semisync/semisync_master.h +++ b/plugin/semisync/semisync_master.h @@ -153,7 +153,7 @@ public: int free_nodes_before(TranxNode* node) { Block *block; - Block *prev_block; + Block *prev_block= NULL; block= first_block; while (block != current_block->next) diff --git a/plugin/semisync/semisync_master_plugin.cc b/plugin/semisync/semisync_master_plugin.cc index d6cc23a43b7..a55ba184a17 100644 --- a/plugin/semisync/semisync_master_plugin.cc +++ b/plugin/semisync/semisync_master_plugin.cc @@ -20,6 +20,8 @@ ReplSemiSyncMaster repl_semisync; +C_MODE_START + int repl_semi_report_binlog_update(Binlog_storage_param *param, const char *log_file, my_off_t log_pos, uint32 flags) @@ -145,6 +147,8 @@ int repl_semi_reset_master(Binlog_transmit_param *param) return 0; } +C_MODE_END + /* semisync system variables */ diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc index 66073f8a5e6..5aa32cdfd5f 100644 --- a/plugin/semisync/semisync_slave_plugin.cc +++ b/plugin/semisync/semisync_slave_plugin.cc @@ -29,6 +29,8 @@ ReplSemiSyncSlave repl_semisync; */ bool semi_sync_need_reply= false; +C_MODE_START + int repl_semi_reset_slave(Binlog_relay_IO_param *param) { // TODO: reset semi-sync slave status here @@ -124,6 +126,7 @@ int repl_semi_slave_io_end(Binlog_relay_IO_param *param) return repl_semisync.slaveStop(param); } +C_MODE_END static void fix_rpl_semi_sync_slave_enabled(MYSQL_THD thd, SYS_VAR *var, |