MySQL  8.0.27
Source Code Documentation
rpl_binlog_sender.h
Go to the documentation of this file.
1 /* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef DEFINED_RPL_BINLOG_SENDER
24 #define DEFINED_RPL_BINLOG_SENDER
25 
26 #include <string.h>
27 #include <sys/types.h>
28 #include <chrono>
29 
31 #include "my_inttypes.h"
32 #include "my_io.h"
33 #include "mysql_com.h"
34 #include "mysqld_error.h" // ER_*
35 #include "sql/binlog.h" // LOG_INFO
36 #include "sql/binlog_reader.h"
37 #include "sql/rpl_gtid.h"
38 #include "sql/sql_error.h" // Diagnostics_area
39 
40 class String;
41 class THD;
42 
43 /**
44  The major logic of dump thread is implemented in this class. It sends
45  required binlog events to clients according to their requests.
46 */
48  class Event_allocator;
52 
53  public:
54  Binlog_sender(THD *thd, const char *start_file, my_off_t start_pos,
55  Gtid_set *exclude_gtids, uint32 flag);
56 
57  ~Binlog_sender() = default;
58 
59  /**
60  It checks the dump reqest and sends events to the client until it finish
61  all events(for mysqlbinlog) or encounters an error.
62  */
63  void run();
64 
65  /**
66  Sets the value of the previously processed event.
67 
68  @param type The last processed event type.
69  */
72  }
73 
74  private:
77 
78  /* Requested start binlog file and position */
79  const char *m_start_file;
81 
82  /*
83  For COM_BINLOG_DUMP_GTID, It may include a GTID set. All events in the set
84  should not be sent to the client.
85  */
90 
91  /* The binlog file it is reading */
93 
96  std::chrono::nanoseconds m_heartbeat_period;
97  std::chrono::nanoseconds m_last_event_sent_ts;
98  /*
99  For mysqlbinlog(server_id is 0), it will stop immediately without waiting
100  if it already reads all events.
101  */
103 
106  const char *m_errmsg;
107  int m_errno;
108  /*
109  The position of the event it reads most recently is stored. So it can report
110  the exact position after where an error happens.
111 
112  m_last_file will point to m_info.log_file_name, if it is same to
113  m_info.log_file_name. Otherwise the file name is copied to m_last_file_buf
114  and m_last_file will point to it.
115  */
117  const char *m_last_file;
119 
120  /*
121  Needed to be able to evaluate if buffer needs to be resized (shrunk).
122  */
124 
125  /*
126  * The size of the buffer next time we shrink it.
127  * This variable is updated once everytime we shrink or grow the buffer.
128  */
130 
131  /*
132  Max size of the buffer is 4GB (UINT_MAX32). It is UINT_MAX32 since the
133  threshold is set to (@c Log_event::read_log_event):
134 
135  max(max_allowed_packet,
136  binlog_row_event_max_size + MAX_LOG_EVENT_HEADER)
137 
138  - binlog_row_event_max_size is defined as an unsigned long,
139  thence in theory row events can be bigger than UINT_MAX32.
140 
141  - max_allowed_packet is set to MAX_MAX_ALLOWED_PACKET which is in
142  turn defined as 1GB (i.e., 1024*1024*1024). (@c Binlog_sender::init()).
143 
144  Therefore, anything bigger than UINT_MAX32 is not loadable into the
145  packet, thus we set the limit to 4GB (which is the value for UINT_MAX32,
146  @c PACKET_MAXIMUM_SIZE).
147 
148  */
149  const static uint32 PACKET_MAX_SIZE;
150 
151  /*
152  * After these consecutive times using less than half of the buffer
153  * the buffer is shrunk.
154  */
155  const static ushort PACKET_SHRINK_COUNTER_THRESHOLD;
156 
157  /**
158  * The minimum size of the buffer.
159  */
160  const static uint32 PACKET_MIN_SIZE;
161 
162  /**
163  * How much to grow the buffer each time we need to accommodate more bytes
164  * than it currently can hold.
165  */
166  const static float PACKET_GROW_FACTOR;
167 
168  /**
169  * The dual of PACKET_GROW_FACTOR. How much to shrink the buffer each time
170  * it is deemed to being underused.
171  */
172  const static float PACKET_SHRINK_FACTOR;
173 
175  /*
176  It is true if any plugin requires to observe the transmission for each
177  event. And HOOKs(reserve_header, before_send and after_send) are called when
178  transmitting each event. Otherwise, it is false and HOOKs are not called.
179  */
181 
182  /* It is true if transmit_start hook is called. If the hook is not called
183  * it will be false.
184  */
186  /**
187  Type of the previously processed event.
188  */
190  /*
191  It initializes the context, checks if the dump request is valid and
192  if binlog status is correct.
193  */
194  void init();
195  void cleanup();
196  void init_heartbeat_period();
197  void init_checksum_alg();
198  /** Check if the requested binlog file and position are valid */
199  int check_start_file();
200  /** Transform read error numbers to error messages. */
202 
203  /**
204  It dumps a binlog file. Events are read and sent one by one. If it need
205  to wait for new events, it will wait after already reading all events in
206  the active log file.
207 
208  @param[in] reader File_reader of binlog will be sent
209  @param[in] start_pos Position requested by the slave's IO thread.
210  Only the events after the position are sent.
211 
212  @return It returns 0 if succeeds, otherwise 1 is returned.
213  */
214  int send_binlog(File_reader *reader, my_off_t start_pos);
215 
216  /**
217  It sends some events in a binlog file to the client.
218 
219  @param[in] reader File_reader of binlog will be sent
220  @param[in] end_pos Only the events before end_pos are sent
221 
222  @return It returns 0 if succeeds, otherwise 1 is returned.
223  */
224  int send_events(File_reader *reader, my_off_t end_pos);
225 
226  /**
227  It gets the end position of the binlog file.
228 
229  @param[in] reader File_reader of binlog will be checked
230  @param[out] end_pos Will be set to the end position of the reading binlog
231  file. If this is an inactive file, it will be set to 0.
232  @retval 0 Success
233  @retval 1 Error (the thread was killed)
234  */
235  int get_binlog_end_pos(File_reader *reader, my_off_t *end_pos);
236 
237  /**
238  It checks if a binlog file has Previous_gtid_log_event
239 
240  @param[in] reader File_reader of binlog will be checked
241  @param[out] found Found Previous_gtid_log_event or not
242 
243  @return It returns 0 if succeeds, otherwise 1 is returned.
244  */
245  int has_previous_gtid_log_event(File_reader *reader, bool *found);
246 
247  /**
248  It sends a faked rotate event which does not exist physically in any
249  binlog to the slave. It contains the name of the binlog we are going to
250  send to the slave.
251 
252  Faked rotate event is required in a few cases, so slave can know which
253  binlog the following events are from.
254 
255  - The binlog file slave requested is Empty. E.g.
256  "CHANGE MASTER TO MASTER_LOG_FILE='', MASTER_LOG_POS=4", etc.
257 
258  - The position slave requested is exactly the end of a binlog file.
259 
260  - Previous binlog file does not include a rotate event.
261  It happens when server is shutdown and restarted.
262 
263  - The previous binary log was GTID-free (does not contain a
264  Previous_gtids_log_event) and the slave is connecting using
265  the GTID protocol.
266 
267  @param[in] next_log_file The name of the binlog file will be sent after
268  the rotate event.
269  @param[in] log_pos The start position of the binlog file.
270 
271  @return It returns 0 if succeeds, otherwise 1 is returned.
272  */
273  int fake_rotate_event(const char *next_log_file, my_off_t log_pos);
274 
275  /**
276  When starting to dump a binlog file, Format_description_log_event
277  is read and sent first. If the requested position is after
278  Format_description_log_event, log_pos field in the first
279  Format_description_log_event has to be set to 0. So the slave
280  will not increment its master's binlog position.
281 
282  @param[in] reader File_reader of the binlog will be dumpped
283  @param[in] start_pos Position requested by the slave's IO thread.
284  Only the events after the position are sent.
285 
286  @return It returns 0 if succeeds, otherwise 1 is returned.
287  */
288  int send_format_description_event(File_reader *reader, my_off_t start_pos);
289  /**
290  It sends a heartbeat to the client.
291 
292  @param[in] log_pos The log position that events before it are sent.
293 
294  @return It returns 0 if succeeds, otherwise 1 is returned.
295  */
296  int send_heartbeat_event(my_off_t log_pos);
297 
298  /**
299  It reads an event from binlog file. this function can set event_ptr either
300  a valid buffer pointer or nullptr. nullptr means it arrives at the end of
301  the binlog file if no error happens.
302 
303  @param[in] reader File_reader of the binlog file.
304  @param[out] event_ptr The buffer used to store the event.
305  @param[out] event_len Length of the event.
306 
307  @retval 0 Succeed
308  @retval 1 Fail
309  */
310  int read_event(File_reader *reader, uchar **event_ptr, uint32 *event_len);
311  /**
312  Check if it is allowed to send this event type.
313 
314  The following are disallowed:
315  - GTID_MODE=ON and type==ANONYMOUS_GTID_LOG_EVENT
316  - AUTO_POSITION=1 and type==ANONYMOUS_GTID_LOG_EVENT
317  - GTID_MODE=OFF and type==GTID_LOG_EVENT
318 
319  @param type The event type.
320  @param log_file The binary log file (used in error messages).
321  @param log_pos The binary log position (used in error messages).
322 
323  @retval true The event is not allowed. In this case, this function
324  calls set_fatal_error().
325  @retval false The event is allowed.
326  */
328  my_off_t log_pos);
329  /**
330  It checks if the event is in m_exclude_gtid.
331 
332  Clients may request to exclude some GTIDs. The events include in the GTID
333  groups will be skipped. We call below events sequence as a goup,
334  Gtid_log_event
335  BEGIN
336  ...
337  COMMIT or ROLLBACK
338 
339  or
340  Gtid_log_event
341  DDL statement
342 
343  @param[in] event_ptr Buffer of the event
344  @param[in] in_exclude_group If it is in a execude group
345 
346  @return It returns true if it should be skipped, otherwise false is turned.
347  */
348  bool skip_event(const uchar *event_ptr, bool in_exclude_group);
349 
350  void calc_event_checksum(uchar *event_ptr, size_t event_len);
351  int flush_net();
352  int send_packet();
353  int send_packet_and_flush();
354  int before_send_hook(const char *log_file, my_off_t log_pos);
355  int after_send_hook(const char *log_file, my_off_t log_pos);
356  /*
357  Reset the thread transmit packet buffer for event sending.
358 
359  This function reserves the bytes for event transmission, and
360  should be called before storing the event data to the packet buffer.
361 
362  @param[in] flags The flag used in reset_transmit hook.
363  @param[in] event_len If the caller already knows the event length, then
364  it can pass this value so that reset_transmit_packet
365  already reallocates the buffer if needed. Otherwise,
366  if event_len is 0, then the caller needs to extend
367  the buffer itself.
368  */
369  int reset_transmit_packet(ushort flags, size_t event_len = 0);
370 
371  /**
372  It waits until receiving an update_cond signal. It will send heartbeat
373  periodically if m_heartbeat_period is set.
374 
375  @param[in] log_pos The end position of the last event it already sent.
376  It is required by heartbeat events.
377 
378  @return It returns 0 if succeeds, otherwise 1 is returned.
379  */
380  int wait_new_events(my_off_t log_pos);
381  int wait_with_heartbeat(my_off_t log_pos);
383 
384 #ifndef NDEBUG
385  /* It is used to count the events that have been sent. */
387  /*
388  It aborts dump thread with an error if m_event_count exceeds
389  max_binlog_dump_events.
390  */
391  int check_event_count();
392 #endif
393 
394  inline bool has_error() { return m_errno != 0; }
395  inline void set_error(int errorno, const char *errmsg) {
396  snprintf(m_errmsg_buf, sizeof(m_errmsg_buf), "%.*s", MYSQL_ERRMSG_SIZE - 1,
397  errmsg);
399  m_errno = errorno;
400  }
401 
402  inline void set_unknown_error(const char *errmsg) {
403  set_error(ER_UNKNOWN_ERROR, errmsg);
404  }
405 
406  inline void set_fatal_error(const char *errmsg) {
407  set_error(ER_MASTER_FATAL_ERROR_READING_BINLOG, errmsg);
408  }
409 
410  inline bool is_fatal_error() {
411  return m_errno == ER_MASTER_FATAL_ERROR_READING_BINLOG;
412  }
413 
414  inline bool event_checksum_on() {
417  }
418 
419  inline void set_last_pos(my_off_t log_pos) {
421  m_last_pos = log_pos;
422  }
423 
424  inline void set_last_file(const char *log_file) {
425  strcpy(m_last_file_buf, log_file);
427  }
428 
429  /**
430  * This function SHALL grow the buffer of the packet if needed.
431  *
432  * If the buffer used for the packet is large enough to accommodate
433  * the requested extra bytes, then this function does not do anything.
434  *
435  * On the other hand, if the requested size is bigger than the available
436  * free bytes in the buffer, the buffer is extended by a constant factor
437  * (@c PACKET_GROW_FACTOR).
438  *
439  * @param extra_size The size in bytes that the caller wants to add to the
440  * buffer.
441  * @return true if an error occurred, false otherwise.
442  */
443  bool grow_packet(size_t extra_size);
444 
445  /**
446  * This function SHALL shrink the size of the buffer used.
447  *
448  * If less than half of the buffer was used in the last N
449  * (@c PACKET_SHRINK_COUNTER_THRESHOLD) consecutive times this function
450  * was called, then the buffer gets shrunk by a constant factor
451  * (@c PACKET_SHRINK_FACTOR).
452  *
453  * The buffer is never shrunk less than a minimum size (@c PACKET_MIN_SIZE).
454  */
455  bool shrink_packet();
456 
457  /**
458  Helper function to recalculate a new size for the growing buffer.
459 
460  @param current_size The baseline (for instance, the current buffer size).
461  @param min_size The resulting buffer size, needs to be at least as large
462  as this parameter states.
463  @return The new buffer size, or 0 in the case of an error.
464  */
465  size_t calc_grow_buffer_size(size_t current_size, size_t min_size);
466 
467  /**
468  Helper function to recalculate the new size for the m_new_shrink_size.
469 
470  @param current_size The baseline (for instance, the current buffer size).
471  */
472  void calc_shrink_buffer_size(size_t current_size);
473 };
474 
475 #endif // DEFINED_RPL_BINLOG_SENDER
Contains the classes representing events occurring in the replication stream.
It owns an allocator, a byte stream, an event_data stream and an event object stream.
Definition: binlog_reader.h:246
Binlog_event_data_istream fetches byte data from Basic_istream and divides them into event_data chunk...
Definition: binlog_reader.h:57
It reads event_data from an event_data stream and deserialize them to event object.
Definition: binlog_reader.h:177
Binlog input file.
Definition: binlog_istream.h:236
Error_type
Possible errors which happens when reading an event.
Definition: binlog_istream.h:41
Binlog_sender reads events one by one.
Definition: rpl_binlog_sender.cc:212
The major logic of dump thread is implemented in this class.
Definition: rpl_binlog_sender.h:47
void set_error(int errorno, const char *errmsg)
Definition: rpl_binlog_sender.h:395
int send_packet_and_flush()
Definition: rpl_binlog_sender.cc:1297
THD * m_thd
Definition: rpl_binlog_sender.h:75
bool m_observe_transmission
Definition: rpl_binlog_sender.h:180
int after_send_hook(const char *log_file, my_off_t log_pos)
Definition: rpl_binlog_sender.cc:1312
String & m_packet
Definition: rpl_binlog_sender.h:76
my_off_t m_last_pos
Definition: rpl_binlog_sender.h:118
Binlog_sender(THD *thd, const char *start_file, my_off_t start_pos, Gtid_set *exclude_gtids, uint32 flag)
Definition: rpl_binlog_sender.cc:232
int send_heartbeat_event(my_off_t log_pos)
It sends a heartbeat to the client.
Definition: rpl_binlog_sender.cc:1236
int check_event_count()
Definition: rpl_binlog_sender.cc:1335
bool m_wait_new_events
Definition: rpl_binlog_sender.h:102
bool has_error()
Definition: rpl_binlog_sender.h:394
int get_binlog_end_pos(File_reader *reader, my_off_t *end_pos)
It gets the end position of the binlog file.
Definition: rpl_binlog_sender.cc:530
int send_events(File_reader *reader, my_off_t end_pos)
It sends some events in a binlog file to the client.
Definition: rpl_binlog_sender.cc:563
static const float PACKET_SHRINK_FACTOR
The dual of PACKET_GROW_FACTOR.
Definition: rpl_binlog_sender.h:172
ushort m_half_buffer_size_req_counter
Definition: rpl_binlog_sender.h:123
uint32 m_flag
Definition: rpl_binlog_sender.h:174
void init()
Definition: rpl_binlog_sender.cc:255
char m_last_file_buf[FN_REFLEN]
Definition: rpl_binlog_sender.h:116
static const uint32 PACKET_MIN_SIZE
The minimum size of the buffer.
Definition: rpl_binlog_sender.h:160
bool m_gtid_clear_fd_created_flag
Definition: rpl_binlog_sender.h:89
const char * m_errmsg
Definition: rpl_binlog_sender.h:106
const char * m_start_file
Definition: rpl_binlog_sender.h:79
void run()
It checks the dump reqest and sends events to the client until it finish all events(for mysqlbinlog) ...
Definition: rpl_binlog_sender.cc:380
std::chrono::nanoseconds m_last_event_sent_ts
Definition: rpl_binlog_sender.h:97
int send_format_description_event(File_reader *reader, my_off_t start_pos)
When starting to dump a binlog file, Format_description_log_event is read and sent first.
Definition: rpl_binlog_sender.cc:1070
bool grow_packet(size_t extra_size)
This function SHALL grow the buffer of the packet if needed.
Definition: rpl_binlog_sender.cc:1345
void set_last_pos(my_off_t log_pos)
Definition: rpl_binlog_sender.h:419
binary_log::enum_binlog_checksum_alg m_event_checksum_alg
Definition: rpl_binlog_sender.h:94
int wait_without_heartbeat()
Definition: rpl_binlog_sender.cc:814
int m_errno
Definition: rpl_binlog_sender.h:107
static const float PACKET_GROW_FACTOR
How much to grow the buffer each time we need to accommodate more bytes than it currently can hold.
Definition: rpl_binlog_sender.h:166
std::chrono::nanoseconds m_heartbeat_period
Definition: rpl_binlog_sender.h:96
Diagnostics_area m_diag_area
Definition: rpl_binlog_sender.h:104
const char * log_read_error_msg(Binlog_read_error::Error_type error)
Transform read error numbers to error messages.
Definition: rpl_binlog_sender.cc:1172
int flush_net()
Definition: rpl_binlog_sender.cc:1266
int reset_transmit_packet(ushort flags, size_t event_len=0)
Definition: rpl_binlog_sender.cc:1043
bool shrink_packet()
This function SHALL shrink the size of the buffer used.
Definition: rpl_binlog_sender.cc:1378
bool m_transmit_started
Definition: rpl_binlog_sender.h:185
void cleanup()
Definition: rpl_binlog_sender.cc:358
LOG_INFO m_linfo
Definition: rpl_binlog_sender.h:92
bool m_check_previous_gtid_event
Definition: rpl_binlog_sender.h:88
int read_event(File_reader *reader, uchar **event_ptr, uint32 *event_len)
It reads an event from binlog file.
Definition: rpl_binlog_sender.cc:1192
static const ushort PACKET_SHRINK_COUNTER_THRESHOLD
Definition: rpl_binlog_sender.h:155
binary_log::enum_binlog_checksum_alg m_slave_checksum_alg
Definition: rpl_binlog_sender.h:95
int before_send_hook(const char *log_file, my_off_t log_pos)
Definition: rpl_binlog_sender.cc:1301
bool m_using_gtid_protocol
Definition: rpl_binlog_sender.h:87
Gtid_set * m_exclude_gtid
Definition: rpl_binlog_sender.h:86
Basic_binlog_file_reader< Binlog_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Event_allocator > File_reader
Definition: rpl_binlog_sender.h:48
int send_packet()
Definition: rpl_binlog_sender.cc:1275
void set_fatal_error(const char *errmsg)
Definition: rpl_binlog_sender.h:406
int send_binlog(File_reader *reader, my_off_t start_pos)
It dumps a binlog file.
Definition: rpl_binlog_sender.cc:490
void init_heartbeat_period()
Definition: rpl_binlog_sender.cc:818
void set_prev_event_type(binary_log::Log_event_type type)
Sets the value of the previously processed event.
Definition: rpl_binlog_sender.h:70
char m_errmsg_buf[MYSQL_ERRMSG_SIZE]
Definition: rpl_binlog_sender.h:105
bool event_checksum_on()
Definition: rpl_binlog_sender.h:414
void calc_shrink_buffer_size(size_t current_size)
Helper function to recalculate the new size for the m_new_shrink_size.
Definition: rpl_binlog_sender.cc:1448
int check_start_file()
Check if the requested binlog file and position are valid.
Definition: rpl_binlog_sender.cc:833
bool skip_event(const uchar *event_ptr, bool in_exclude_group)
It checks if the event is in m_exclude_gtid.
Definition: rpl_binlog_sender.cc:737
bool is_fatal_error()
Definition: rpl_binlog_sender.h:410
void init_checksum_alg()
Definition: rpl_binlog_sender.cc:972
void set_unknown_error(const char *errmsg)
Definition: rpl_binlog_sender.h:402
void calc_event_checksum(uchar *event_ptr, size_t event_len)
Definition: rpl_binlog_sender.cc:1036
int has_previous_gtid_log_event(File_reader *reader, bool *found)
It checks if a binlog file has Previous_gtid_log_event.
Definition: rpl_binlog_sender.cc:1156
void set_last_file(const char *log_file)
Definition: rpl_binlog_sender.h:424
static const uint32 PACKET_MAX_SIZE
Definition: rpl_binlog_sender.h:149
size_t m_new_shrink_size
Definition: rpl_binlog_sender.h:129
int wait_with_heartbeat(my_off_t log_pos)
Definition: rpl_binlog_sender.cc:787
const char * m_last_file
Definition: rpl_binlog_sender.h:117
binary_log::Log_event_type m_prev_event_type
Type of the previously processed event.
Definition: rpl_binlog_sender.h:189
int fake_rotate_event(const char *next_log_file, my_off_t log_pos)
It sends a faked rotate event which does not exist physically in any binlog to the slave.
Definition: rpl_binlog_sender.cc:1001
int m_event_count
Definition: rpl_binlog_sender.h:386
my_off_t m_start_pos
Definition: rpl_binlog_sender.h:80
~Binlog_sender()=default
size_t calc_grow_buffer_size(size_t current_size, size_t min_size)
Helper function to recalculate a new size for the growing buffer.
Definition: rpl_binlog_sender.cc:1425
int wait_new_events(my_off_t log_pos)
It waits until receiving an update_cond signal.
Definition: rpl_binlog_sender.cc:758
bool check_event_type(binary_log::Log_event_type type, const char *log_file, my_off_t log_pos)
Check if it is allowed to send this event type.
Definition: rpl_binlog_sender.cc:679
Stores status of the currently executed statement.
Definition: sql_error.h:265
Represents a set of GTIDs.
Definition: rpl_gtid.h:1435
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:165
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:821
static int flags[50]
Definition: hp_test1.cc:39
static int flag
Definition: hp_test1.cc:39
Some integer typedefs for easier portability.
ulonglong my_off_t
Definition: my_inttypes.h:71
unsigned char uchar
Definition: my_inttypes.h:51
uint32_t uint32
Definition: my_inttypes.h:66
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:82
Common definition between mysql server & client.
#define MYSQL_ERRMSG_SIZE
Max length of a error message.
Definition: mysql_com.h:877
Logfile log_file
Definition: mysqltest.cc:259
enum_binlog_checksum_alg
Enumeration spcifying checksum algorithm used to encode a binary log event.
Definition: binlog_event.h:411
@ BINLOG_CHECKSUM_ALG_ENUM_END
the cut line: valid alg range is [1, 0x7f]
Definition: binlog_event.h:420
@ BINLOG_CHECKSUM_ALG_OFF
Events are without checksum though its generator is checksum-capable New Master (NM).
Definition: binlog_event.h:416
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:266
required string type
Definition: replication_group_member_actions.proto:33
Definition: binlog.h:116
char log_file_name[FN_REFLEN]
Definition: binlog.h:117