22 #define HAVE_REPLICATION
25 #include <my_global.h>
26 #include <my_pthread.h>
27 #include <mysql/plugin.h>
28 #include <replication.h>
41 static const unsigned long kTraceFunction;
42 static const unsigned long kTraceGeneral;
43 static const unsigned long kTraceDetail;
44 static const unsigned long kTraceNetWait;
46 unsigned long trace_level_;
48 inline void function_enter(
const char *func_name)
50 if (trace_level_ & kTraceFunction)
51 sql_print_information(
"---> %s enter", func_name);
53 inline int function_exit(
const char *func_name,
int exit_code)
55 if (trace_level_ & kTraceFunction)
56 sql_print_information(
"<--- %s exit (%d)", func_name, exit_code);
63 Trace(
unsigned long trace_level)
64 :trace_level_(trace_level)
74 static const unsigned char kSyncHeader[2];
77 static const unsigned char kPacketMagicNum;
78 static const unsigned char kPacketFlagSync;
86 #define REPLY_MAGIC_NUM_LEN 1
87 #define REPLY_BINLOG_POS_LEN 8
88 #define REPLY_BINLOG_NAME_LEN (FN_REFLEN + 1)
89 #define REPLY_MAGIC_NUM_OFFSET 0
90 #define REPLY_BINLOG_POS_OFFSET (REPLY_MAGIC_NUM_OFFSET + REPLY_MAGIC_NUM_LEN)
91 #define REPLY_BINLOG_NAME_OFFSET (REPLY_BINLOG_POS_OFFSET + REPLY_BINLOG_POS_LEN)