MySQL 8.3.0
Source Code Documentation
control_events.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 2023, 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/**
24 @file control_events.h
25
26 @brief Contains the classes representing events operating in the replication
27 stream properties. Each event is represented as a byte sequence with logical
28 divisions as event header, event specific data and event footer. The header
29 and footer are common to all the events and are represented as two different
30 subclasses.
31*/
32
33#ifndef MYSQL_BINLOG_EVENT_CONTROL_EVENTS_H
34#define MYSQL_BINLOG_EVENT_CONTROL_EVENTS_H
35
36#include <sys/types.h>
37#include <time.h>
38#include <list>
39#include <map>
40#include <vector>
41
43#include "mysql/binlog/event/compression/base.h" // mysql::binlog::event::compression::type
46#include "mysql/gtid/tsid.h"
47#include "mysql/gtid/uuid.h"
54#include "template_utils.h"
55
56/// @addtogroup GroupLibsMysqlBinlogEvent
57/// @{
58
59namespace mysql::binlog::event {
60/**
61 @class Rotate_event
62
63 When a binary log file exceeds a size limit, a ROTATE_EVENT is written
64 at the end of the file that points to the next file in the sequence.
65 This event is information for the slave to know the name of the next
66 binary log it is going to receive.
67
68 ROTATE_EVENT is generated locally and written to the binary log
69 on the master. It is written to the relay log on the slave when FLUSH LOGS
70 occurs, and when receiving a ROTATE_EVENT from the master.
71 In the latter case, there will be two rotate events in total originating
72 on different servers.
73
74 @section Rotate_event_binary_format Binary Format
75
76 <table>
77 <caption>Post-Header for Rotate_event</caption>
78
79 <tr>
80 <th>Name</th>
81 <th>Format</th>
82 <th>Description</th>
83 </tr>
84
85 <tr>
86 <td>position</td>
87 <td>8 byte integer</td>
88 <td>The position within the binary log to rotate to.</td>
89 </tr>
90
91 </table>
92
93 The Body has one component:
94
95 <table>
96 <caption>Body for Rotate_event</caption>
97
98 <tr>
99 <th>Name</th>
100 <th>Format</th>
101 <th>Description</th>
102 </tr>
103
104 <tr>
105 <td>new_log_ident</td>
106 <td>variable length string without trailing zero, extending to the
107 end of the event (determined by the length field of the
108 Common-Header)
109 </td>
110 <td>Name of the binlog to rotate to.</td>
111 </tr>
112
113 </table>
114*/
116 public:
117 const char *new_log_ident;
118 size_t ident_len;
119 unsigned int flags;
120 uint64_t pos;
121
122 enum {
123 /* Values taken by the flag member variable */
124 DUP_NAME = 2, // if constructor should dup the string argument
125 RELAY_LOG = 4 // rotate event for the relay log
126 };
127
128 enum {
129 /* Rotate event post_header */
132 };
133
134 /**
135 This is the minimal constructor, it will set the type code as ROTATE_EVENT.
136 */
137 Rotate_event(const char *new_log_ident_arg, size_t ident_len_arg,
138 unsigned int flags_arg, uint64_t pos_arg)
140 new_log_ident(new_log_ident_arg),
141 ident_len(ident_len_arg ? ident_len_arg : strlen(new_log_ident_arg)),
142 flags(flags_arg),
143 pos(pos_arg) {}
144
145 /**
146 The layout of Rotate_event data part is as follows:
147
148 <pre>
149 +-----------------------------------------------------------------------+
150 | common_header | post_header | position of the first event | file name |
151 +-----------------------------------------------------------------------+
152 </pre>
153
154 @param buf Contains the serialized event.
155 @param fde An FDE event, used to get the following information:
156 -binlog_version
157 -server_version
158 -post_header_len
159 -common_header_len
160 The content of this object depends on the binlog-version
161 currently in use.
162 */
163 Rotate_event(const char *buf, const Format_description_event *fde);
164
165#ifndef HAVE_MYSYS
166 void print_event_info(std::ostream &) override;
167 void print_long_info(std::ostream &) override;
168#endif
169
170 ~Rotate_event() override {
171 if (flags & DUP_NAME) bapi_free(const_cast<char *>(new_log_ident));
172 }
173};
174
175/**
176 @class Format_description_event
177 For binlog version 4.
178 This event is saved by threads which read it, as they need it for future
179 use (to decode the ordinary events).
180
181 @section Format_description_event_binary_format Binary Format
182
183 The Post-Header has six components:
184
185 <table>
186 <caption>Post-Header for Format_description_event</caption>
187
188 <tr>
189 <th>Name</th>
190 <th>Format</th>
191 <th>Description</th>
192 </tr>
193
194 <tr>
195 <td>created</td>
196 <td>4 byte unsigned integer</td>
197 <td>The creation timestamp, if non-zero,
198 is the time in seconds when this event was created</td>
199 </tr>
200 <tr>
201 <td>binlog_version</td>
202 <td>2 byte unsigned integer</td>
203 <td>This is 1 in MySQL 3.23 and 3 in MySQL 4.0 and 4.1
204 (In MySQL 5.0 and up, FORMAT_DESCRIPTION_EVENT is
205 used instead of START_EVENT_V3 and for them its 4).</td>
206 </tr>
207 <tr>
208 <td>server_version</td>
209 <td>char array of 50 bytes</td>
210 <td>The MySQL server's version (example: 4.0.14-debug-log),
211 padded with 0x00 bytes on the right</td>
212 </tr>
213 <tr>
214 <td>common_header_len</td>
215 <td>1 byte unsigned integer</td>
216 <td>The length of the event header. This value includes the extra_headers
217 field, so this header length - 19 yields the size
218 of the extra_headers field.</td>
219 </tr>
220 <tr>
221 <td>post_header_len</td>
222 <td>array of type 1 byte unsigned integer</td>
223 <td>The lengths for the fixed data part of each event</td>
224 </tr>
225 <tr>
226 <td>server_version_split</td>
227 <td>unsigned char array</td>
228 <td>Stores the server version of the server
229 and splits them in three parts</td>
230 </tr>
231 <tr>
232 <td>number_of_event_types</td>
233 <td>1 byte unsigned integer</td>
234 <td>number of event types present in the server</td>
235 </tr>
236 </table>
237*/
239 public:
240 /**
241 If this event is at the start of the first binary log since server
242 startup 'created' should be the timestamp when the event (and the
243 binary log) was created. In the other case (i.e. this event is at
244 the start of a binary log created by FLUSH LOGS or automatic
245 rotation), 'created' should be 0. This "trick" is used by MySQL
246 >=4.0.14 slaves to know whether they must drop stale temporary
247 tables and whether they should abort unfinished transaction.
248
249 Note that when 'created'!=0, it is always equal to the event's
250 timestamp; indeed Format_description_event is written only in binlog.cc
251 where the first constructor below is called, in which 'created' is set to
252 'when'. So in fact 'created' is a useless variable. When it is 0 we can
253 read the actual value from timestamp ('when') and when it is non-zero we
254 can read the same value from timestamp
255 ('when'). Conclusion:
256 - we use timestamp to print when the binlog was created.
257 - we use 'created' only to know if this is a first binlog or not.
258 */
259 time_t created;
262 /*
263 We set this to 1 if we don't want to have the created time in the log,
264 which is the case when we rollover to a new log.
265 */
267
268 /**
269 The size of the fixed header which _all_ events have
270 (for binlogs written by this version, this is equal to
271 LOG_EVENT_HEADER_LEN), except FORMAT_DESCRIPTION_EVENT and ROTATE_EVENT
272 (those have a header of size LOG_EVENT_MINIMAL_HEADER_LEN).
273 */
275 /*
276 The list of post-headers' lengths followed
277 by the checksum alg description byte
278 */
279 std::vector<uint8_t> post_header_len;
281
282 /**
283 Format_description_event 1st constructor.
284
285 This constructor can be used to create the event to write to the binary log
286 (when the server starts or when FLUSH LOGS)
287
288 @param binlog_ver the binlog version for which we want to build
289 an event. It should only be 4, old versions are not compatible anymore
290 since 8.0.2.
291 @param server_ver The MySQL server's version.
292 */
293 Format_description_event(uint8_t binlog_ver, const char *server_ver);
294 /**
295 The layout of Format_description_event data part is as follows:
296
297 <pre>
298 +=====================================+
299 | event | binlog_version 19 : 2 | = 4
300 | data +----------------------------+
301 | | server_version 21 : 50 |
302 | +----------------------------+
303 | | create_timestamp 71 : 4 |
304 | +----------------------------+
305 | | header_length 75 : 1 |
306 | +----------------------------+
307 | | post-header 76 : n | = array of n bytes, one byte
308 | | lengths for all | per event type that the
309 | | event types | server knows about
310 +=====================================+
311 </pre>
312 @param buf Contains the serialized event.
313 @param fde An FDE event (see Rotate_event constructor for more info).
314
315 @note The fde passed to this constructor was created through another
316 constructor of FDE class.
317 */
318 Format_description_event(const char *buf,
319 const Format_description_event *fde);
320
323 default;
325 /**
326 This method is used to find out the version of server that originated
327 the current FD instance.
328
329 @return the version of server.
330 */
331 unsigned long get_product_version() const;
332 /**
333 This method checks the MySQL version to determine whether checksums may be
334 present in the events contained in the binary log.
335
336 @retval true if the event's version is earlier than one that introduced
337 the replication event checksum.
338 @retval false otherwise.
339 */
340 bool is_version_before_checksum() const;
341 /**
342 This method populates the array server_version_split which is then used for
343 lookups to find if the server which created this event has some known bug.
344 */
346#ifndef HAVE_MYSYS
347 void print_event_info(std::ostream &info) override;
348 void print_long_info(std::ostream &info) override;
349#endif
351
352 bool header_is_valid() const {
354 (!post_header_len.empty()));
355 }
356
357 bool version_is_valid() const {
358 /* It is invalid only when all version numbers are 0 */
359 return server_version_split[0] != 0 || server_version_split[1] != 0 ||
360 server_version_split[2] != 0;
361 }
362};
363
364/**
365 @class Stop_event
366
367 A stop event is written to the log files under these circumstances:
368 - A master writes the event to the binary log when it shuts down.
369 - A slave writes the event to the relay log when it shuts down or
370 when a RESET SLAVE statement is executed.
371
372 @section Stop_event_binary_format Binary Format
373
374 The Post-Header and Body for this event type are empty; it only has
375 the Common-Header.
376*/
377
379 public:
380 /**
381 It is the minimal constructor, and all it will do is set the type_code as
382 STOP_EVENT in the header object in Binary_log_event.
383 */
385
386 /**
387 A Stop_event is occurs under these circumstances:
388 - A master writes the event to the binary log when it shuts down
389 - A slave writes the event to the relay log when it shuts down or when a
390 RESET SLAVE statement is executed
391 @param buf Contains the serialized event.
392 @param fde An FDE event (see Rotate_event constructor for more info).
393 */
394 Stop_event(const char *buf, const Format_description_event *fde);
395
396#ifndef HAVE_MYSYS
397 void print_event_info(std::ostream &) override {}
398 void print_long_info(std::ostream &info) override;
399#endif
400};
401
402/**
403 @class Incident_event
404
405 Class representing an incident, an occurrence out of the ordinary,
406 that happened on the master.
407
408 The event is used to inform the slave that something out of the
409 ordinary happened on the master that might cause the database to be
410 in an inconsistent state.
411
412 @section Incident_event_binary_format Binary Format
413
414 <table id="IncidentFormat">
415 <caption>Incident event format</caption>
416 <tr>
417 <th>Symbol</th>
418 <th>Format</th>
419 <th>Description</th>
420 </tr>
421 <tr>
422 <td>INCIDENT</td>
423 <td align="right">2</td>
424 <td>Incident number as an unsigned integer</td>
425 </tr>
426 <tr>
427 <td>MSGLEN</td>
428 <td align="right">1</td>
429 <td>Message length as an unsigned integer</td>
430 </tr>
431 <tr>
432 <td>MESSAGE</td>
433 <td align="right">MSGLEN</td>
434 <td>The message, if present. Not null terminated.</td>
435 </tr>
436 </table>
437
438*/
440 public:
441 /**
442 Enumeration of the incidents that can occur for the server.
443 */
445 /** No incident */
447 /** There are possibly lost events in the replication stream */
449 /** Shall be last event of the enumeration */
451 };
452
454 char *get_message() { return message; }
455
456 /**
457 This will create an Incident_event with an empty message and set the
458 type_code as INCIDENT_EVENT in the header object in Binary_log_event.
459 */
460 explicit Incident_event(enum_incident incident_arg)
462 incident(incident_arg),
464 message_length(0) {}
465
466 /**
467 Constructor of Incident_event
468 The buffer layout is as follows:
469 <pre>
470 +-----------------------------------------------------+
471 | Incident_number | message_length | Incident_message |
472 +-----------------------------------------------------+
473 </pre>
474
475 Incident number codes are listed in binlog_evnet.h.
476 The only code currently used is INCIDENT_LOST_EVENTS, which indicates that
477 there may be lost events (a "gap") in the replication stream that requires
478 databases to be resynchronized.
479
480 @param buf Contains the serialized event.
481 @param fde An FDE event (see Rotate_event constructor for more info).
482 */
483 Incident_event(const char *buf, const Format_description_event *fde);
484#ifndef HAVE_MYSYS
485 void print_event_info(std::ostream &info) override;
486 void print_long_info(std::ostream &info) override;
487#endif
488 protected:
490 char *message;
492};
493
494/**
495 @class Xid_event
496
497 An XID event is generated for a commit of a transaction that modifies one or
498 more tables of an XA-capable storage engine.
499
500 @section Xid_event_binary_format Binary Format
501
502The Body has the following component:
503
504 <table>
505 <caption>Body for Xid_event</caption>
506
507 <tr>
508 <th>Name</th>
509 <th>Format</th>
510 <th>Description</th>
511 </tr>
512
513 <tr>
514 <td>xid</td>
515 <td>8 byte unsigned integer</td>
516 <td>The XID transaction number.</td>
517 </tr>
518 </table>
519 The Post-Header and Body for this event type are empty; it only has
520 the common header.
521*/
523 public:
524 /**
525 The minimal constructor of Xid_event, it initializes the instance variable
526 xid and set the type_code as XID_EVENT in the header object in
527 Binary_log_event
528 */
529 explicit Xid_event(uint64_t xid_arg)
530 : Binary_log_event(XID_EVENT), xid(xid_arg) {}
531
532 /**
533 An XID event is generated for a commit of a transaction that modifies one or
534 more tables of an XA-capable storage engine
535 @param buf Contains the serialized event.
536 @param fde An FDE event (see Rotate_event constructor for more info).
537 */
538 Xid_event(const char *buf, const Format_description_event *fde);
539 uint64_t xid;
540#ifndef HAVE_MYSYS
541 void print_event_info(std::ostream &info) override;
542 void print_long_info(std::ostream &info) override;
543#endif
544};
545
546/**
547 @class XA_prepare_event
548
549 An XA_prepare event is generated for a XA prepared transaction.
550 Like Xid_event it contains XID of the *prepared* transaction.
551
552 @section XA_prepare_event_binary_format Binary Format
553
554The Body has the following component:
555
556 <table>
557 <caption>Body for XA_prepare_event</caption>
558
559 <tr>
560 <th>Name</th>
561 <th>Format</th>
562 <th>Description</th>
563 </tr>
564
565 <tr>
566 <td>my_xid</td>
567 <td>a struct similar to mysql/plugin.h containing three members.</td>
568 <td>serialized XID representation of XA transaction.</td>
569 </tr>
570
571 <tr>
572 <td>xid</td>
573 <td>a pointer to XID object.</td>
574 <td>a reference to an object for mysql logger.</td>
575 </tr>
576
577 <tr>
578 <td>one_phase</td>
579 <td>a bool</td>
580 <td>the value specifies the current XA transaction commit method.</td>
581 </tr>
582 </table>
583 The Post-Header and Body for this event type are empty; it only has
584 the common header.
585*/
586
588 /*
589 Struct def is copied from $MYSQL/include/mysql/plugin.h,
590 consult there about fine details.
591 */
592 static const int MY_XIDDATASIZE = 128;
593
594 public:
595 struct MY_XID {
599 char data[MY_XIDDATASIZE]; /* Not \0-terminated */
600 };
601
602 protected:
603 /* size of serialization buffer is explained in $MYSQL/sql/xa.h. */
604 static const uint16_t ser_buf_size =
605 8 + 2 * MY_XIDDATASIZE + 4 * sizeof(long) + 1;
607 void *xid; /* Master side only */
609
610 public:
611 /**
612 The minimal constructor of XA_prepare_event, it initializes the
613 instance variable xid and set the type_code as XID_EVENT in the
614 header object in Binary_log_event
615 */
616 XA_prepare_event(void *xid_arg, bool oph_arg)
618 xid(xid_arg),
619 one_phase(oph_arg) {}
620
621 /**
622 An XID event is generated for a commit of a transaction that modifies one or
623 more tables of an XA-capable storage engine
624 @param buf Contains the serialized event.
625 @param fde An FDE event (see Rotate_event constructor for more info).
626 */
627 XA_prepare_event(const char *buf, const Format_description_event *fde);
628#ifndef HAVE_MYSYS
629 /*
630 todo: we need to find way how to exploit server's code of
631 serialize_xid()
632 */
633 void print_event_info(std::ostream &) override {}
634 void print_long_info(std::ostream &) override {}
635#endif
636 /**
637 Whether or not this `XA_prepare_event` represents an `XA COMMIT ONE
638 PHASE`.
639
640 @return true if it's an `XA COMMIT ONE PHASE`, false otherwise.
641 */
642 bool is_one_phase() const;
643 /**
644 Retrieves the content of `my_xid` member variable.
645
646 @return The const-reference to the `my_xid` member variable.
647 */
648 MY_XID const &get_xid() const;
649};
650
651/**
652 @class Ignorable_event
653
654 Base class for ignorable log events. Events deriving from
655 this class can be safely ignored by slaves that cannot
656 recognize them. Newer slaves, will be able to read and
657 handle them. This has been designed to be an open-ended
658 architecture, so adding new derived events shall not harm
659 the old slaves that support ignorable log event mechanism
660 (they will just ignore unrecognized ignorable events).
661
662 @note The only thing that makes an event ignorable is that it has
663 the LOG_EVENT_IGNORABLE_F flag set. It is not strictly necessary
664 that ignorable event types derive from Ignorable_event; they may
665 just as well derive from Binary_log_event and Log_event and pass
666 LOG_EVENT_IGNORABLE_F as argument to the Log_event constructor.
667
668 @section Ignoarble_event_binary_format Binary format
669
670 The Post-Header and Body for this event type are empty; it only has
671 the Common-Header.
672*/
674 public:
675 // buf is advanced in Binary_log_event constructor to point to beginning of
676 // post-header
677
678 /**
679 The minimal constructor and all it will do is set the type_code as
680 IGNORABLE_LOG_EVENT in the header object in Binary_log_event.
681 */
683 : Binary_log_event(type_arg) {}
684 /**
685 @param buf Contains the serialized event.
686 @param fde An FDE event (see Rotate_event constructor for more info).
687 */
688 Ignorable_event(const char *buf, const Format_description_event *fde);
689#ifndef HAVE_MYSYS
690 void print_event_info(std::ostream &) override {}
691 void print_long_info(std::ostream &) override {}
692#endif
693};
694
695/**
696 @struct gtid_info
697 Structure to hold the members declared in the class Gtid_log_event those
698 member are objects of classes defined in server(rpl_gtid.h). As we can not
699 move all the classes defined there(in rpl_gtid.h) in libbinlogevents so this
700 structure was created, to provide a way to map the decoded value in Gtid_event
701 ctor and the class members defined in rpl_gtid.h, these classes are also the
702 members of Gtid_log_event(subclass of this in server code)
703
704 The structure contains the following components.
705 <table>
706 <caption>Structure gtid_info</caption>
707
708 <tr>
709 <th>Name</th>
710 <th>Format</th>
711 <th>Description</th>
712 </tr>
713 <tr>
714 <td>rpl_gtid_sidno</td>
715 <td>4 bytes integer</td>
716 <td>SIDNO (source ID number, first component of GTID)</td>
717 </tr>
718 <tr>
719 <td>rpl_gtid_gno</td>
720 <td>8 bytes integer</td>
721 <td>GNO (group number, second component of GTID)</td>
722 </tr>
723 </table>
724*/
725struct gtid_info {
728};
729
730/// Event that encloses all the events of a transaction.
731///
732/// It is used for carrying compressed payloads, and contains
733/// compression metadata.
735 public:
738
739 private:
741 delete;
743
744 protected:
745 /// The compressed data, when entire payload is in one chunk.
746 const char *m_payload{nullptr};
747
748 /// The compressed data, when payload consists of a sequence of buffers
750
751 /// The size of the compressed data.
752 uint64_t m_payload_size{0};
753
754 /// The compression algorithm that was used.
757
758 /// The uncompressed size of the data. This is the same as @c
759 /// m_payload_size if the algorithms is NONE.
761
762 public:
763 /// There are four fields: "compression type", "payload size",
764 /// "uncompressed size", and "end mark". Each of the three first
765 /// fields is stored as a triple, where:
766 /// - the first element is a type code,
767 /// - the second element is a number containing the length of the
768 /// third element, and
769 /// - the third element is the value.
770 /// The last field, "end mark", is stored as only a type code. All
771 /// elements are stored in the "net_store_length" format.
772 /// net_store_length stores 64 bit numbers in a variable length
773 /// format, using 1 to 9 bytes depending on the magnitude of the
774 /// value; 1 for values up to 250, longer for bigger values.
775 ///
776 /// So:
777 /// - The first element in each triple is always length 1 since type
778 /// codes are small;
779 /// - the second element in each triple is always length 1 since the
780 /// third field is at most 9 bytes;
781 /// - the third field in each triple is:
782 /// - at most 1 for the "compression type" since type codes are small;
783 /// - at most 9 for the "payload size" and "uncompressed size".
784 /// - the end mark is always 1 byte since it is a constant value
785 /// less than 250
786 static constexpr size_t compression_type_max_length = 1 + 1 + 1;
787 static constexpr size_t payload_size_max_length = 1 + 1 + 9;
788 static constexpr size_t uncompressed_size_max_length = 1 + 1 + 9;
789 static constexpr size_t end_mark_max_length = 1;
790
791 /// The maximum size of the "payload data header".
792 ///
793 /// Any log event consists of the common-header (19 bytes, same
794 /// format for all event types), followed by a post-header (size
795 /// defined per event type; 0 for payload events), followed by data
796 /// (variable length and defined by each event type). For payload
797 /// events, the data contains a payload data header (these 4
798 /// fields), followed by the payload (compressed data).
799 static constexpr size_t max_payload_data_header_length =
802
803 /// The maximum size of all headers, i.e., everything but the
804 /// payload.
805 ///
806 /// This includes common-header, post-header, and payload
807 /// data header.
808 static constexpr size_t max_length_of_all_headers =
811 /// The maximum length of the payload size, defined such that the total
812 /// event size does not exceed max_log_event_size.
813 static constexpr size_t max_payload_length =
815
816 /// Construct an object from the given fields.
817 ///
818 /// @param payload The (compressed) payload data.
819 ///
820 /// @param payload_size The size of @c payload in bytes.
821 ///
822 /// @param compression_type the compression type that was used to
823 /// compress @c payload.
824 ///
825 /// @param uncompressed_size the size of the data when uncompressed.
826 ///
827 /// The function does not validate that the payload matches the
828 /// metadata provided.
829 Transaction_payload_event(const char *payload, uint64_t payload_size,
830 uint16_t compression_type,
831 uint64_t uncompressed_size);
832
833 /// Decode the event from a buffer.
834 ///
835 /// @param buf The buffer to decode.
836 ///
837 /// @param fde The format description event used to decode the
838 /// buffer.
839 Transaction_payload_event(const char *buf,
840 const Format_description_event *fde);
841
843
844 /// Set the compression type used for the enclosed payload.
845 ///
846 /// @note API clients must call either all or none of set_payload,
847 /// set_payload_size, set_compression_type, and
848 /// set_uncompressed_size.
849 ///
850 /// @param type the compression type.
853 }
854
855 /// @return the compression type.
857 return m_compression_type;
858 }
859
860 /// Set the (compressed) size of the payload in this event.
861 ///
862 /// @note API clients must call either all or none of set_payload,
863 /// set_payload_size, set_compression_type, and
864 /// set_uncompressed_size.
865 ///
866 /// @param size The compressed size of the payload.
867 void set_payload_size(uint64_t size) { m_payload_size = size; }
868
869 /// @return The payload size.
870 uint64_t get_payload_size() const { return m_payload_size; }
871
872 /// Set the uncompressed size of the payload.
873 ///
874 /// @note API clients must call either all or none of set_payload,
875 /// set_payload_size, set_compression_type, and
876 /// set_uncompressed_size.
877 ///
878 /// @param size The uncompressed size of the payload.
879 void set_uncompressed_size(uint64_t size) { m_uncompressed_size = size; }
880
881 /// Return the alleged uncompressed size according to the field
882 /// stored in the event.
883 ///
884 /// This cannot be trusted; the actual size can only be computed by
885 /// decompressing the event.
886 uint64_t get_uncompressed_size() const { return m_uncompressed_size; }
887
888 /// Set the (possibly compressed) payload for the event.
889 ///
890 /// The ownership and responsibility to destroy the data is
891 /// transferred to the event.
892 ///
893 /// @note API clients must call either all or none of set_payload,
894 /// set_payload_size, set_compression_type, and
895 /// set_uncompressed_size.
896 ///
897 /// @param data The payload of the event.
898 void set_payload(const char *data) { m_payload = data; }
899
900 /// @return the payload of the event.
901 const char *get_payload() const { return m_payload; }
902
903 /// Set the (possibly compressed) payload for the event.
904 ///
905 /// The payload is given as a Buffer_sequence_view. The ownership
906 /// of the data remains with the caller; the caller must ensure that
907 /// the iterators remain valid for as long as this event needs them.
908 ///
909 /// @note API clients must call either all or none of set_payload,
910 /// set_payload_size, set_compression_type, and
911 /// set_uncompressed_size.
912 ///
913 /// @param buffer_sequence_view Container holding the data.
914 void set_payload(Buffer_sequence_view_t *buffer_sequence_view);
915
916 /// @return a textual representation of this event.
917 std::string to_string() const;
918
919#ifndef HAVE_MYSYS
920 void print_event_info(std::ostream &) override;
921 void print_long_info(std::ostream &) override;
922#endif
923};
924
925/**
926 @class Gtid_event
927 GTID stands for Global Transaction IDentifier
928 It is composed of two parts:
929 - TSID for Transaction Source Identifier, and
930 - GNO for Group Number.
931 The basic idea is to
932 - Associate an identifier, the Global Transaction IDentifier or GTID,
933 to every transaction.
934 - When a transaction is copied to a slave, re-executed on the slave,
935 and written to the slave's binary log, the GTID is preserved.
936 - When a slave connects to a master, the slave uses GTIDs instead of
937 (file, offset)
938
939 @section Gtid_event_binary_format Binary Format
940
941 The Body can have up to nine components:
942
943 <table>
944 <caption>Body for Gtid_event</caption>
945
946 <tr>
947 <th>Name</th>
948 <th>Format</th>
949 <th>Description</th>
950 </tr>
951
952 <tr>
953 <td>GTID_FLAGS</td>
954 <td>1 byte</td>
955 <td>00000001 = Transaction may have changes logged with SBR.
956 In 5.6, 5.7.0-5.7.18, and 8.0.0-8.0.1, this flag is always set.
957 Starting in 5.7.19 and 8.0.2, this flag is cleared if the transaction
958 only contains row events. It is set if any part of the transaction is
959 written in statement format.</td>
960 </tr>
961 <tr>
962 <td>SID</td>
963 <td>16 byte sequence</td>
964 <td>UUID representing the SID</td>
965 </tr>
966 <tr>
967 <td>GNO</td>
968 <td>8 byte integer</td>
969 <td>Group number, second component of GTID.</td>
970 </tr>
971 <tr>
972 <td>logical clock timestamp typecode</td>
973 <td>1 byte integer</td>
974 <td>The type of logical timestamp used in the logical clock fields.</td>
975 </tr>
976 <tr>
977 <td>last_committed</td>
978 <td>8 byte integer</td>
979 <td>Store the transaction's commit parent sequence_number</td>
980 </tr>
981 <tr>
982 <td>sequence_number</td>
983 <td>8 byte integer</td>
984 <td>The transaction's logical timestamp assigned at prepare phase</td>
985 </tr>
986 <tr>
987 <td>immediate_commit_timestamp</td>
988 <td>7 byte integer</td>
989 <td>Timestamp of commit on the immediate master</td>
990 </tr>
991 <tr>
992 <td>original_commit_timestamp</td>
993 <td>7 byte integer</td>
994 <td>Timestamp of commit on the originating master</td>
995 </tr>
996 <tr>
997 <td>transaction_length</td>
998 <td>1 to 9 byte integer // See net_length_size(ulonglong num)</td>
999 <td>The packed transaction's length in bytes, including the Gtid</td>
1000 </tr>
1001 <tr>
1002 <td>immediate_server_version</td>
1003 <td>4 byte integer</td>
1004 <td>Server version of the immediate server</td>
1005 </tr>
1006 <tr>
1007 <td>original_server_version</td>
1008 <td>4 byte integer</td>
1009 <td>Version of the server where the transaction was originally executed</td>
1010 </tr>
1011 </table>
1012
1013*/
1015 public mysql::serialization::Serializable<Gtid_event> {
1016 public:
1017 /*
1018 The transaction's logical timestamps used for MTS: see
1019 Transaction_ctx::last_committed and
1020 Transaction_ctx::sequence_number for details.
1021 Note: Transaction_ctx is in the MySQL server code.
1022 */
1025 /** GTID flags constants */
1026 unsigned const char FLAG_MAY_HAVE_SBR = 1;
1027 /** Transaction might have changes logged with SBR */
1029 /// GTID flags, used bits:
1030 /// - FLAG_MAY_HAVE_SBR (1st bit)
1031 unsigned char gtid_flags = 0;
1032 /// Timestamp when the transaction was committed on the originating source.
1034 /// Timestamp when the transaction was committed on the nearest source.
1036 /// Flag indicating whether this event contains commit timestamps
1038 /// The length of the transaction in bytes.
1040
1041 public:
1042 /**
1043 Ctor of Gtid_event
1044
1045 The layout of the buffer is as follows
1046 <pre>
1047 +----------+---+---+-------+--------------+---------+----------+
1048 |gtid flags|SID|GNO|TS_TYPE|logical ts(:s)|commit ts|trx length|
1049 +----------+---+---+-------+------------------------+----------+
1050 </pre>
1051 TS_TYPE is from {G_COMMIT_TS2} singleton set of values
1052 Details on commit timestamps in Gtid_event(const char*...)
1053
1054 @param buf Contains the serialized event.
1055 @param fde An FDE event (see Rotate_event constructor for more info).
1056 */
1057
1058 Gtid_event(const char *buf, const Format_description_event *fde);
1059 /**
1060 Constructor.
1061 */
1062 explicit Gtid_event(long long int last_committed_arg,
1063 long long int sequence_number_arg,
1064 bool may_have_sbr_stmts_arg,
1065 unsigned long long int original_commit_timestamp_arg,
1066 unsigned long long int immediate_commit_timestamp_arg,
1067 uint32_t original_server_version_arg,
1068 uint32_t immediate_server_version_arg)
1070 last_committed(last_committed_arg),
1071 sequence_number(sequence_number_arg),
1072 may_have_sbr_stmts(may_have_sbr_stmts_arg),
1073 original_commit_timestamp(original_commit_timestamp_arg),
1074 immediate_commit_timestamp(immediate_commit_timestamp_arg),
1076 original_server_version(original_server_version_arg),
1077 immediate_server_version(immediate_server_version_arg) {
1078 if (may_have_sbr_stmts_arg) {
1080 }
1081 }
1082#ifndef HAVE_MYSYS
1083 // TODO(WL#7684): Implement the method print_event_info and print_long_info
1084 // for all the events supported in MySQL Binlog
1085 void print_event_info(std::ostream &) override {}
1086 void print_long_info(std::ostream &) override {}
1087#endif
1088 /*
1089 Commit group ticket consists of: 1st bit, used internally for
1090 synchronization purposes ("is in use"), followed by 63 bits for
1091 the ticket value.
1092 */
1093 static constexpr int COMMIT_GROUP_TICKET_LENGTH = 8;
1094 /*
1095 Default value of commit_group_ticket, which means it is not
1096 being used.
1097 */
1098 static constexpr std::uint64_t kGroupTicketUnset = 0;
1099
1104
1105 /*
1106 Function defining how to deserialize GTID_TAGGED_LOG_EVENT
1107 For optional fields, we define what value to assign in case field is not
1108 present in the packet
1109 */
1110 decltype(auto) define_fields() {
1111 return std::make_tuple(
1113 mysql::serialization::define_field_with_size<Uuid::BYTE_LENGTH>(
1118 tsid_parent_struct.get_tag_ref().get_data()),
1124 this->original_commit_timestamp =
1126 })),
1127 mysql::serialization::define_field(transaction_length),
1132 })),
1134 commit_group_ticket, Field_missing_functor([this]() -> auto {
1136 })));
1137 }
1138
1139 /*
1140 Function defining how to serialize GTID_TAGGED_LOG_EVENT
1141 For optional fields, we define function that will tell serializer whether
1142 or not to include fields in the packet. Although binlogevents do not define
1143 how to serialize an event, Gtid_event class defines functions that are
1144 used during event serialization (set transaction length related functions).
1145 We need to define how data is serialized in order to automatically calculate
1146 event size
1147 */
1148 decltype(auto) define_fields() const {
1149 return std::make_tuple(
1151 mysql::serialization::define_field_with_size<Uuid::BYTE_LENGTH>(
1156 tsid_parent_struct.get_tag().get_data()),
1162 return this->original_commit_timestamp ==
1164 })),
1165 mysql::serialization::define_field(transaction_length),
1169 return this->original_server_version !=
1171 })),
1175 })));
1176 }
1177
1178 /// @brief Function that reads GTID_TAGGED_LOG_EVENT event type from the
1179 /// given buffer
1180 /// @param buf Buffer to read from
1181 /// @param buf_size Number of bytes in the buffer
1182 void read_gtid_tagged_log_event(const char *buf, std::size_t buf_size);
1183
1184 /// @brief Updates transaction length which was not yet considered
1186
1187 /// @brief Updated transaction length based on transaction length without
1188 /// event length
1189 /// @param[in] trx_len_without_event_len Transaction length without event body
1190 /// length
1191 void update_tagged_transaction_length(std::size_t trx_len_without_event_len);
1192
1193 protected:
1194 static const int ENCODED_FLAG_LENGTH = 1;
1195 static const int ENCODED_SID_LENGTH = 16; // Uuid::BYTE_LENGTH;
1196 static const int ENCODED_GNO_LENGTH = 8;
1197 /// Length of typecode for logical timestamps.
1199 /// Length of two logical timestamps.
1200 static const int LOGICAL_TIMESTAMP_LENGTH = 16;
1201 // Type code used before the logical timestamps.
1202 static const int LOGICAL_TIMESTAMP_TYPECODE = 2;
1203
1206 // Length of two timestamps (from original/immediate masters)
1209 // We use 7 bytes out of which 1 bit is used as a flag.
1210 static const int ENCODED_COMMIT_TIMESTAMP_LENGTH = 55;
1211 // Minimum and maximum lengths of transaction length field.
1212 static const int TRANSACTION_LENGTH_MIN_LENGTH = 1;
1213 static const int TRANSACTION_LENGTH_MAX_LENGTH = 9;
1214 /// Length of original_server_version
1216 /// Length of immediate_server_version
1218 /// Length of original and immediate server version
1221 // We use 4 bytes out of which 1 bit is used as a flag.
1222 static const int ENCODED_SERVER_VERSION_LENGTH = 31;
1223
1224 /* We have only original commit timestamp if both timestamps are equal. */
1229 }
1230
1231 /**
1232 We only store the immediate_server_version if both server versions are the
1233 same.
1234 */
1239 }
1240
1243
1244 /* Minimum GNO expected in a serialized GTID event */
1245 static const int64_t MIN_GNO = 1;
1246 /// One-past-the-max value of GNO
1247 static const std::int64_t GNO_END = INT64_MAX;
1248
1249 public:
1250 virtual std::int64_t get_gno() const { return gtid_info_struct.rpl_gtid_gno; }
1252 /// Total length of post header
1253 static const int POST_HEADER_LENGTH =
1254 ENCODED_FLAG_LENGTH + /* flags */
1255 ENCODED_SID_LENGTH + /* SID length */
1256 ENCODED_GNO_LENGTH + /* GNO length */
1257 LOGICAL_TIMESTAMP_TYPECODE_LENGTH + /* length of typecode */
1258 LOGICAL_TIMESTAMP_LENGTH; /* length of two logical timestamps */
1259
1266
1269 }
1270
1271 /// @brief Get maximum size of event
1272 /// @return Maximum size of the event in bytes
1273 static constexpr std::size_t get_max_event_length() {
1275 }
1276
1277 /// @brief Get maximum size of event payload
1278 /// @return Maximum size of event payload (withouth log event header length)
1279 /// in bytes
1280 static constexpr std::size_t get_max_payload_size() {
1281 constexpr std::size_t max_tagged_length =
1282 Encoder_type::get_max_size<Gtid_event>();
1283 if constexpr (max_tagged_length > MAX_DATA_LENGTH + POST_HEADER_LENGTH) {
1284 return max_tagged_length;
1285 }
1287 }
1288
1289 private:
1290 /*
1291 We keep the commit timestamps in the body section because they can be of
1292 variable length.
1293 On the originating master, the event has only one timestamp as the two
1294 timestamps are equal. On every other server we have two timestamps.
1295 */
1296 static const int MAX_DATA_LENGTH =
1299 COMMIT_GROUP_TICKET_LENGTH; /* 64-bit unsigned integer */
1300
1301 public:
1302 /**
1303 Set the transaction length information.
1304
1305 This function should be used when the full transaction length (including
1306 the Gtid event length) is known.
1307
1308 @param transaction_length_arg The transaction length.
1309 */
1310 void set_trx_length(unsigned long long int transaction_length_arg) {
1311 transaction_length = transaction_length_arg;
1312 }
1313
1314 unsigned long long get_trx_length() const { return transaction_length; }
1315
1316 /** The version of the server where the transaction was originally executed */
1318 /** The version of the immediate server */
1320
1321 /** Ticket number used to group sessions together during the BGC. */
1323
1324 /**
1325 Returns the length of the packed `commit_group_ticket` field. It may be
1326 8 bytes or 0 bytes, depending on whether or not the value is
1327 instantiated. This function may be used only for untagged GTID events
1328
1329 @return The length of the packed `commit_group_ticket` field
1330 */
1332
1333 /**
1334 Set the commit_group_ticket and update the transaction length if
1335 needed, that is, if the commit_group_ticket was not set already
1336 account it on the transaction size.
1337
1338 @param value The commit_group_ticket value.
1339 */
1341 std::uint64_t value);
1342
1343 /// @brief Checks whether this Gtid log event contains a tag
1344 /// @return True in case this event is tagged. False otherwise.
1345 bool is_tagged() const;
1346};
1347
1348/**
1349 @class Previous_gtids_event
1350
1351 @section Previous_gtids_event_binary_format Binary Format
1352
1353 The Post-Header for this event type is empty. The Body has two
1354 components:
1355
1356 <table>
1357 <caption>Body for Previous_gtids_event</caption>
1358
1359 <tr>
1360 <th>Name</th>
1361 <th>Format</th>
1362 <th>Description</th>
1363 </tr>
1364
1365 <tr>
1366 <td>buf</td>
1367 <td>unsigned char array</td>
1368 <td>It contains the Gtids executed in the
1369 last binary log file.</td>
1370 </tr>
1371
1372 <tr>
1373 <td>buf_size</td>
1374 <td>4 byte integer</td>
1375 <td>Size of the above buffer</td>
1376 </tr>
1377 </table>
1378*/
1380 public:
1381 /**
1382 Decodes the gtid_executed in the last binlog file
1383
1384 <pre>
1385 The buffer layout is as follows
1386 +--------------------------------------------+
1387 | Gtids executed in the last binary log file |
1388 +--------------------------------------------+
1389 </pre>
1390 @param buf Contains the serialized event.
1391 @param fde An FDE event (see Rotate_event constructor for more info).
1392 */
1393 Previous_gtids_event(const char *buf, const Format_description_event *fde);
1394 /**
1395 This is the minimal constructor, and set the
1396 type_code as PREVIOUS_GTIDS_LOG_EVENT in the header object in
1397 Binary_log_event
1398 */
1400#ifndef HAVE_MYSYS
1401 // TODO(WL#7684): Implement the method print_event_info and print_long_info
1402 // for all the events supported in MySQL Binlog
1403 void print_event_info(std::ostream &) override {}
1404 void print_long_info(std::ostream &) override {}
1405#endif
1406 protected:
1407 size_t buf_size;
1408 const unsigned char *buf;
1409};
1410
1411/**
1412 @class Transaction_context_event
1413
1414 This class is used to combine the information of the ongoing transaction
1415 including the write set and other information of the thread executing the
1416 transaction.
1417
1418 <tr>
1419 <th>Name</th>
1420 <th>Format</th>
1421 <th>Description</th>
1422 </tr>
1423
1424 <tr>
1425 <td>thread_id</td>
1426 <td>4 byte integer</td>
1427 <td>The identifier for the thread executing the transaction.</td>
1428 </tr>
1429
1430 <tr>
1431 <td>gtid_specified</td>
1432 <td>bool type variable</td>
1433 <td>Variable to identify whether the Gtid have been specified for the
1434 ongoing transaction or not.
1435 </td>
1436 </tr>
1437
1438 <tr>
1439 <td>encoded_snapshot_version</td>
1440 <td>unsigned char array</td>
1441 <td>A gtid_set which is used to store the transaction set used for
1442 conflict detection.</td>
1443 </tr>
1444
1445 <tr>
1446 <td>encoded_snapshot_version_length</td>
1447 <td>4 byte integer</td>
1448 <td>Length of the above char array.</td>
1449 </tr>
1450
1451 <tr>
1452 <td>write_set</td>
1453 <td>variable length list to store the hash values. </td>
1454 <td>Used to store the hash values of the rows identifier for the rows
1455 which have changed in the ongoing transaction.
1456 </td>
1457 </tr>
1458
1459 <tr>
1460 <td>read_set</td>
1461 <td>variable length list to store the read set values. Currently empty.
1462 </td> <td>Will be used to store the read set values of the current
1463 transaction.</td>
1464 </tr>
1465
1466*/
1468 public:
1469 /**
1470 Decodes the transaction_context_log_event of the ongoing transaction.
1471
1472 <pre>
1473 The buffer layout is as follows
1474 </pre>
1475
1476 @param buf Contains the serialized event.
1477 @param fde An FDE event (see Rotate_event constructor for more info).
1478 */
1479 Transaction_context_event(const char *buf,
1480 const Format_description_event *fde);
1481
1482 Transaction_context_event(unsigned int thread_id_arg, bool is_gtid_specified)
1484 thread_id(thread_id_arg),
1485 gtid_specified(is_gtid_specified) {}
1486
1487 ~Transaction_context_event() override;
1488
1489 static const char *read_data_set(const char *pos, uint32_t set_len,
1490 std::list<const char *> *set,
1491 uint32_t remaining_buffer);
1492
1493 static void clear_set(std::list<const char *> *set);
1494
1495#ifndef HAVE_MYSYS
1496 void print_event_info(std::ostream &) override {}
1497 void print_long_info(std::ostream &) override {}
1498#endif
1499
1500 protected:
1501 const char *server_uuid;
1502 uint32_t thread_id;
1504 const unsigned char *encoded_snapshot_version;
1506 std::list<const char *> write_set;
1507 std::list<const char *> read_set;
1508
1509 // The values mentioned on the next class constants is the offset where the
1510 // data that will be copied in the buffer.
1511
1512 // 1 byte length.
1514 // 4 bytes length.
1515 static const int ENCODED_THREAD_ID_OFFSET = 1;
1516 // 1 byte length.
1517 static const int ENCODED_GTID_SPECIFIED_OFFSET = 5;
1518 // 4 bytes length
1520 // 4 bytes length.
1521 static const int ENCODED_WRITE_SET_ITEMS_OFFSET = 10;
1522 // 4 bytes length.
1523 static const int ENCODED_READ_SET_ITEMS_OFFSET = 14;
1524
1525 // The values mentioned on the next class's constants is the length of the
1526 // data that will be copied in the buffer.
1528 static const int ENCODED_SNAPSHOT_VERSION_LEN = 2;
1529};
1530
1531/**
1532 @class View_change_event
1533
1534 This class is used to add view change markers in the binary log when a
1535 member of the group enters or leaves the group.
1536
1537 <tr>
1538 <th>Name</th>
1539 <th>Format</th>
1540 <th>Description</th>
1541 </tr>
1542
1543 <tr>
1544 <td>view_id</td>
1545 <td>40 length character array</td>
1546 <td>This is used to store the view id value of the new view change when a
1547 node add or leaves the group.
1548 </td>
1549 </tr>
1550
1551 <tr>
1552 <td>seq_number</td>
1553 <td>8 bytes integer</td>
1554 <td>Variable to identify the next sequence number to be allotted to the
1555 certified transaction.</td>
1556 </tr>
1557
1558 <tr>
1559 <td>certification_info</td>
1560 <td>variable length map to store the certification data.</td>
1561 <td>Map to store the certification info ie. the hash of write_set and the
1562 snapshot sequence value.
1563 </td>
1564 </tr>
1565
1566*/
1568 public:
1569 /**
1570 Decodes the view_change_log_event generated in case a server enters or
1571 leaves the group.
1572
1573 <pre>
1574 The buffer layout is as follows
1575 </pre>
1576
1577 @param buf Contains the serialized event.
1578 @param fde An FDE event (see Rotate_event constructor for more info).
1579 */
1580 View_change_event(const char *buf, const Format_description_event *fde);
1581
1582 explicit View_change_event(const char *raw_view_id);
1583
1584 ~View_change_event() override;
1585
1586#ifndef HAVE_MYSYS
1587 void print_event_info(std::ostream &) override {}
1588 void print_long_info(std::ostream &) override {}
1589#endif
1590
1591 protected:
1592 // The values mentioned on the next class constants is the offset where the
1593 // data that will be copied in the buffer.
1594
1595 // 40 bytes length.
1596 static const int ENCODED_VIEW_ID_OFFSET = 0;
1597 // 8 bytes length.
1598 static const int ENCODED_SEQ_NUMBER_OFFSET = 40;
1599 // 4 bytes length.
1600 static const int ENCODED_CERT_INFO_SIZE_OFFSET = 48;
1601
1602 /*
1603 The layout of the buffer is as follows
1604 +--------------------- -+-------------+----------+
1605 | View Id | seq number | map size |
1606 +-----------------------+-------------+----------+
1607 view id (40 bytes) + seq number (8 bytes) + map size (4 bytes)
1608 Sum of the length of the values at the above OFFSETS.
1609 */
1610
1611 // The values mentioned on the next class constants is the length of the data
1612 // that will be copied in the buffer.
1613
1614 // Field sizes on serialization
1615 static const int ENCODED_VIEW_ID_MAX_LEN = 40;
1617 static const int ENCODED_CERT_INFO_VALUE_LEN = 4;
1618
1620
1621 long long int seq_number;
1622
1623 std::map<std::string, std::string> certification_info;
1624};
1625
1626/**
1627 @class Heartbeat_event_v2
1628
1629 Replication event to ensure to replica that source is alive.
1630 The event is originated by source's dump thread and sent straight to
1631 replica without being logged. Slave itself does not store it in relay log
1632 but rather uses a data for immediate checks and throws away the event.
1633
1634 Two members of the class m_log_filename and m_log_position comprise
1635 @see the rpl_event_coordinates instance. The coordinates that a heartbeat
1636 instance carries correspond to the last event source has sent from
1637 its binlog.
1638
1639 Also this event will be generated only for the source server with
1640 version > 8.0.26
1641
1642 @section Heartbeat_event_v2_binary_format Binary Format
1643
1644 The Body has one component:
1645
1646 <table>
1647 <caption>Body for Heartbeat_event</caption>
1648
1649 <tr>
1650 <th>Name</th>
1651 <th>Format</th>
1652 <th>Description</th>
1653 </tr>
1654
1655 <tr>
1656 <td>m_log_filename</td>
1657 <td>String variable to store the binlog name</td>
1658 <td>Name of the current binlog being written to.</td>
1659 </tr>
1660 <tr>
1661 <td>m_log_pos</td>
1662 <td>8 byte unsigned integar</td>
1663 <td>Name of the current binlog being written to.</td>
1664 </tr>
1665 </table>
1666*/
1667
1669 public:
1670 /**
1671 Sent by a source to a replica to let the replica know that the source is
1672 still alive. Events of this type do not appear in the binary or relay logs.
1673 They are generated on a source server by the thread that dumps events and
1674 sent straight to the replica without ever being written to the binary log.
1675
1676 @param buf Contains the serialized event.
1677 @param fde An FDE event (see Rotate_event constructor for more info).
1678 */
1679 Heartbeat_event_v2(const char *buf, const Format_description_event *fde);
1680
1681 /**
1682 Creates an empty heartbeat event.
1683 */
1685
1686 virtual ~Heartbeat_event_v2() override = default;
1687
1688 // Set the binlog filename
1689 void set_log_filename(const std::string name);
1690 // Set the position
1691 void set_log_position(uint64_t position);
1692 // Return the binlog filename
1693 const std::string get_log_filename() const;
1694 // Return the position
1695 uint64_t get_log_position() const;
1696
1697 // Return the max length of an encoded packet.
1698 static uint64_t max_encoding_length();
1699#ifndef HAVE_MYSYS
1700 void print_event_info(std::ostream &info) override;
1701 void print_long_info(std::ostream &info) override;
1702#endif
1703 protected:
1704 std::string m_log_filename{};
1705 uint64_t m_log_position{0};
1706};
1707
1708/**
1709 @class Heartbeat_event
1710
1711 Replication event to ensure to replica that source is alive.
1712 The event is originated by source's dump thread and sent straight to
1713 replica without being logged. Slave itself does not store it in relay log
1714 but rather uses a data for immediate checks and throws away the event.
1715
1716 Two members of the class log_ident and Binary_log_event::log_pos comprise
1717 @see the rpl_event_coordinates instance. The coordinates that a heartbeat
1718 instance carries correspond to the last event source has sent from
1719 its binlog.
1720
1721 @section Heartbeat_event_binary_format Binary Format
1722
1723 The Body has one component:
1724
1725 <table>
1726 <caption>Body for Heartbeat_event</caption>
1727
1728 <tr>
1729 <th>Name</th>
1730 <th>Format</th>
1731 <th>Description</th>
1732 </tr>
1733
1734 <tr>
1735 <td>log_ident</td>
1736 <td>variable length string without trailing zero, extending to the
1737 end of the event</td>
1738 <td>Name of the current binlog being written to.</td>
1739 </tr>
1740 </table>
1741*/
1743 public:
1744 /**
1745 Sent by a source to a replica to let the replica know that the source is
1746 still alive. Events of this type do not appear in the binary or relay logs.
1747 They are generated on a source server by the thread that dumps events and
1748 sent straight to the replica without ever being written to the binary log.
1749
1750 @param buf Contains the serialized event.
1751 @param fde An FDE event (see Rotate_event constructor for more info).
1752 */
1753 Heartbeat_event(const char *buf, const Format_description_event *fde);
1754
1755 // Return the file name
1756 const char *get_log_ident() { return log_ident; }
1757 // Return the length of file name
1758 unsigned int get_ident_len() { return ident_len; }
1759
1760 protected:
1761 const char *log_ident;
1762 unsigned int ident_len; /** filename length */
1763};
1764
1765} // end namespace mysql::binlog::event
1766
1767/// @}
1768
1769#endif // MYSQL_BINLOG_EVENT_CONTROL_EVENTS_H
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:250
Contains the classes representing events occurring in the replication stream.
#define LOG_EVENT_HEADER_LEN
Definition: binlog_event.h:441
#define LOG_EVENT_MINIMAL_HEADER_LEN
Fixed header length, where 4.x and 5.0 agree.
Definition: binlog_event.h:455
#define ST_SERVER_VER_LEN
The length of the array server_version, which is used to store the version of MySQL server.
Definition: binlog_event.h:423
Container class that provides a sequence of buffers to the caller.
This is the abstract base class for binary log events.
Definition: binlog_event.h:857
@ TRANSACTION_PAYLOAD_HEADER_LEN
Definition: binlog_event.h:899
For binlog version 4.
Definition: control_events.h:238
unsigned char server_version_split[ST_SERVER_VER_SPLIT_LEN]
Definition: control_events.h:280
bool version_is_valid() const
Definition: control_events.h:357
bool header_is_valid() const
Definition: control_events.h:352
char server_version[ST_SERVER_VER_LEN]
Definition: control_events.h:261
std::vector< uint8_t > post_header_len
Definition: control_events.h:279
Format_description_event & operator=(const Format_description_event &)=default
void calc_server_version_split()
This method populates the array server_version_split which is then used for lookups to find if the se...
Definition: control_events.cpp:156
uint16_t binlog_version
Definition: control_events.h:260
unsigned long get_product_version() const
This method is used to find out the version of server that originated the current FD instance.
Definition: control_events.cpp:165
uint8_t common_header_len
The size of the fixed header which all events have (for binlogs written by this version,...
Definition: control_events.h:274
Format_description_event(uint8_t binlog_ver, const char *server_ver)
Format_description_event 1st constructor.
Definition: control_events.cpp:78
uint8_t number_of_event_types
Definition: control_events.h:324
Format_description_event(const Format_description_event &)=default
time_t created
If this event is at the start of the first binary log since server startup 'created' should be the ti...
Definition: control_events.h:259
bool dont_set_created
Definition: control_events.h:266
bool is_version_before_checksum() const
This method checks the MySQL version to determine whether checksums may be present in the events cont...
Definition: control_events.cpp:177
GTID stands for Global Transaction IDentifier It is composed of two parts:
Definition: control_events.h:1015
static const int ORIGINAL_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1205
int get_server_version_length() const
We only store the immediate_server_version if both server versions are the same.
Definition: control_events.h:1235
mysql::gtid::Tsid tsid_parent_struct
Definition: control_events.h:1242
uint64_t transaction_length
The length of the transaction in bytes.
Definition: control_events.h:1039
mysql::gtid::Tag_plain Tag_plain
Definition: control_events.h:1103
static const int ENCODED_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1210
Tag_plain generate_tag_specification() const
Definition: control_events.h:1267
static const int ENCODED_SID_LENGTH
Definition: control_events.h:1195
int get_commit_timestamp_length() const
Definition: control_events.h:1225
int64_t sequence_number
Definition: control_events.h:1024
mysql::serialization::Field_encode_predicate Field_encode_predicate
Definition: control_events.h:1101
static const int64_t MIN_GNO
Definition: control_events.h:1245
static constexpr std::size_t get_max_payload_size()
Get maximum size of event payload.
Definition: control_events.h:1280
uint32_t original_server_version
The version of the server where the transaction was originally executed.
Definition: control_events.h:1317
bool may_have_sbr_stmts
Transaction might have changes logged with SBR.
Definition: control_events.h:1028
Gtid_event(long long int last_committed_arg, long long int sequence_number_arg, bool may_have_sbr_stmts_arg, unsigned long long int original_commit_timestamp_arg, unsigned long long int immediate_commit_timestamp_arg, uint32_t original_server_version_arg, uint32_t immediate_server_version_arg)
Constructor.
Definition: control_events.h:1062
uint32_t immediate_server_version
The version of the immediate server.
Definition: control_events.h:1319
int64_t last_committed
Definition: control_events.h:1023
unsigned const char FLAG_MAY_HAVE_SBR
GTID flags constants.
Definition: control_events.h:1026
static constexpr int COMMIT_GROUP_TICKET_LENGTH
Definition: control_events.h:1093
static const int IMMEDIATE_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1204
static const std::int64_t GNO_END
One-past-the-max value of GNO.
Definition: control_events.h:1247
static constexpr std::uint64_t kGroupTicketUnset
Definition: control_events.h:1098
mysql::gtid::Tsid get_tsid() const
Definition: control_events.h:1251
void update_untagged_transaction_length()
Updates transaction length which was not yet considered.
Definition: control_events.cpp:655
gtid_info gtid_info_struct
Definition: control_events.h:1241
int get_commit_group_ticket_length() const
Returns the length of the packed commit_group_ticket field.
Definition: control_events.cpp:618
unsigned char gtid_flags
GTID flags, used bits:
Definition: control_events.h:1031
static const int LOGICAL_TIMESTAMP_TYPECODE_LENGTH
Length of typecode for logical timestamps.
Definition: control_events.h:1198
void set_commit_group_ticket_and_update_transaction_length(std::uint64_t value)
Set the commit_group_ticket and update the transaction length if needed, that is, if the commit_group...
Definition: control_events.cpp:626
void update_tagged_transaction_length(std::size_t trx_len_without_event_len)
Updated transaction length based on transaction length without event length.
Definition: control_events.cpp:670
uint64_t immediate_commit_timestamp
Timestamp when the transaction was committed on the nearest source.
Definition: control_events.h:1035
static const int TRANSACTION_LENGTH_MAX_LENGTH
Definition: control_events.h:1213
static const int FULL_COMMIT_TIMESTAMP_LENGTH
Definition: control_events.h:1207
static const int ENCODED_GNO_LENGTH
Definition: control_events.h:1196
bool is_tagged() const
Checks whether this Gtid log event contains a tag.
Definition: control_events.cpp:648
static constexpr std::size_t get_max_event_length()
Get maximum size of event.
Definition: control_events.h:1273
static const int ENCODED_FLAG_LENGTH
Definition: control_events.h:1194
Gtid_event(const char *buf, const Format_description_event *fde)
Ctor of Gtid_event.
Definition: control_events.cpp:448
unsigned long long get_trx_length() const
Definition: control_events.h:1314
static const int LOGICAL_TIMESTAMP_TYPECODE
Definition: control_events.h:1202
std::uint64_t commit_group_ticket
Ticket number used to group sessions together during the BGC.
Definition: control_events.h:1322
static const int LOGICAL_TIMESTAMP_LENGTH
Length of two logical timestamps.
Definition: control_events.h:1200
void read_gtid_tagged_log_event(const char *buf, std::size_t buf_size)
Function that reads GTID_TAGGED_LOG_EVENT event type from the given buffer.
Definition: control_events.cpp:427
decltype(auto) define_fields() const
Definition: control_events.h:1148
mysql::serialization::Field_missing_functor Field_missing_functor
Definition: control_events.h:1100
uint64_t original_commit_timestamp
Timestamp when the transaction was committed on the originating source.
Definition: control_events.h:1033
void set_trx_length(unsigned long long int transaction_length_arg)
Set the transaction length information.
Definition: control_events.h:1310
static const int IMMEDIATE_SERVER_VERSION_LENGTH
Length of immediate_server_version.
Definition: control_events.h:1217
static const int ENCODED_SERVER_VERSION_LENGTH
Definition: control_events.h:1222
static const int FULL_SERVER_VERSION_LENGTH
Length of original and immediate server version.
Definition: control_events.h:1219
static const int MAX_DATA_LENGTH
Definition: control_events.h:1296
static const int TRANSACTION_LENGTH_MIN_LENGTH
Definition: control_events.h:1212
bool has_commit_timestamps
Flag indicating whether this event contains commit timestamps.
Definition: control_events.h:1037
static const int ORIGINAL_SERVER_VERSION_LENGTH
Length of original_server_version.
Definition: control_events.h:1215
static const int POST_HEADER_LENGTH
Total length of post header.
Definition: control_events.h:1253
decltype(auto) define_fields()
Definition: control_events.h:1110
virtual std::int64_t get_gno() const
Definition: control_events.h:1250
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1668
uint64_t m_log_position
Definition: control_events.h:1705
Heartbeat_event_v2()
Creates an empty heartbeat event.
Definition: control_events.cpp:834
virtual ~Heartbeat_event_v2() override=default
const std::string get_log_filename() const
Definition: control_events.cpp:843
uint64_t get_log_position() const
Definition: control_events.cpp:846
void set_log_position(uint64_t position)
Definition: control_events.cpp:840
static uint64_t max_encoding_length()
This member function returns the len of the event.
Definition: control_events.cpp:853
void set_log_filename(const std::string name)
Definition: control_events.cpp:837
std::string m_log_filename
Definition: control_events.h:1704
Replication event to ensure to replica that source is alive.
Definition: control_events.h:1742
unsigned int get_ident_len()
Definition: control_events.h:1758
Heartbeat_event(const char *buf, const Format_description_event *fde)
Sent by a source to a replica to let the replica know that the source is still alive.
Definition: control_events.cpp:799
const char * log_ident
Definition: control_events.h:1761
const char * get_log_ident()
Definition: control_events.h:1756
unsigned int ident_len
Definition: control_events.h:1762
Base class for ignorable log events.
Definition: control_events.h:673
Ignorable_event(Log_event_type type_arg=IGNORABLE_LOG_EVENT)
The minimal constructor and all it will do is set the type_code as IGNORABLE_LOG_EVENT in the header ...
Definition: control_events.h:682
Class representing an incident, an occurrence out of the ordinary, that happened on the master.
Definition: control_events.h:439
char * message
Definition: control_events.h:490
Incident_event(enum_incident incident_arg)
This will create an Incident_event with an empty message and set the type_code as INCIDENT_EVENT in t...
Definition: control_events.h:460
size_t message_length
Definition: control_events.h:491
enum_incident
Enumeration of the incidents that can occur for the server.
Definition: control_events.h:444
@ INCIDENT_NONE
No incident.
Definition: control_events.h:446
@ INCIDENT_LOST_EVENTS
There are possibly lost events in the replication stream.
Definition: control_events.h:448
@ INCIDENT_COUNT
Shall be last event of the enumeration.
Definition: control_events.h:450
enum_incident incident
Definition: control_events.h:489
char * get_message()
Definition: control_events.h:454
enum_incident get_incident_type()
Definition: control_events.h:453
Definition: control_events.h:1379
size_t buf_size
Definition: control_events.h:1407
Previous_gtids_event()
This is the minimal constructor, and set the type_code as PREVIOUS_GTIDS_LOG_EVENT in the header obje...
Definition: control_events.h:1399
const unsigned char * buf
Definition: control_events.h:1408
When a binary log file exceeds a size limit, a ROTATE_EVENT is written at the end of the file that po...
Definition: control_events.h:115
const char * new_log_ident
Definition: control_events.h:117
@ R_IDENT_OFFSET
Definition: control_events.h:131
@ R_POS_OFFSET
Definition: control_events.h:130
Rotate_event(const char *new_log_ident_arg, size_t ident_len_arg, unsigned int flags_arg, uint64_t pos_arg)
This is the minimal constructor, it will set the type code as ROTATE_EVENT.
Definition: control_events.h:137
@ DUP_NAME
Definition: control_events.h:124
@ RELAY_LOG
Definition: control_events.h:125
uint64_t pos
Definition: control_events.h:120
~Rotate_event() override
Definition: control_events.h:170
unsigned int flags
Definition: control_events.h:119
size_t ident_len
Definition: control_events.h:118
A stop event is written to the log files under these circumstances:
Definition: control_events.h:378
Stop_event()
It is the minimal constructor, and all it will do is set the type_code as STOP_EVENT in the header ob...
Definition: control_events.h:384
This class is used to combine the information of the ongoing transaction including the write set and ...
Definition: control_events.h:1467
static const int ENCODED_SNAPSHOT_VERSION_LEN_OFFSET
Definition: control_events.h:1519
~Transaction_context_event() override
Destructor of the Transaction_context_event class.
Definition: control_events.cpp:753
bool gtid_specified
Definition: control_events.h:1503
static const int ENCODED_SERVER_UUID_LEN_OFFSET
Definition: control_events.h:1513
static const int ENCODED_GTID_SPECIFIED_OFFSET
Definition: control_events.h:1517
static const int ENCODED_READ_WRITE_SET_ITEM_LEN
Definition: control_events.h:1527
static const char * read_data_set(const char *pos, uint32_t set_len, std::list< const char * > *set, uint32_t remaining_buffer)
static const int ENCODED_WRITE_SET_ITEMS_OFFSET
Definition: control_events.h:1521
static void clear_set(std::list< const char * > *set)
Function to clear the memory of the write_set and the read_set.
Definition: control_events.cpp:743
const unsigned char * encoded_snapshot_version
Definition: control_events.h:1504
uint32_t thread_id
Definition: control_events.h:1502
Transaction_context_event(const char *buf, const Format_description_event *fde)
Decodes the transaction_context_log_event of the ongoing transaction.
Definition: control_events.cpp:705
static const int ENCODED_READ_SET_ITEMS_OFFSET
Definition: control_events.h:1523
static const int ENCODED_THREAD_ID_OFFSET
Definition: control_events.h:1515
Transaction_context_event(unsigned int thread_id_arg, bool is_gtid_specified)
Definition: control_events.h:1482
std::list< const char * > read_set
Definition: control_events.h:1507
uint32_t encoded_snapshot_version_length
Definition: control_events.h:1505
static const int ENCODED_SNAPSHOT_VERSION_LEN
Definition: control_events.h:1528
const char * server_uuid
Definition: control_events.h:1501
std::list< const char * > write_set
Definition: control_events.h:1506
Event that encloses all the events of a transaction.
Definition: control_events.h:734
uint64_t m_payload_size
The size of the compressed data.
Definition: control_events.h:752
uint64_t get_uncompressed_size() const
Return the alleged uncompressed size according to the field stored in the event.
Definition: control_events.h:886
static constexpr size_t compression_type_max_length
There are four fields: "compression type", "payload size", "uncompressed size", and "end mark".
Definition: control_events.h:786
const char * get_payload() const
Definition: control_events.h:901
void set_payload(const char *data)
Set the (possibly compressed) payload for the event.
Definition: control_events.h:898
Buffer_sequence_view_t * m_buffer_sequence_view
The compressed data, when payload consists of a sequence of buffers.
Definition: control_events.h:749
static constexpr size_t uncompressed_size_max_length
Definition: control_events.h:788
const char * m_payload
The compressed data, when entire payload is in one chunk.
Definition: control_events.h:746
mysql::binlog::event::compression::type m_compression_type
The compression algorithm that was used.
Definition: control_events.h:755
static constexpr size_t payload_size_max_length
Definition: control_events.h:787
Transaction_payload_event & operator=(const Transaction_payload_event &)=delete
static constexpr size_t max_length_of_all_headers
The maximum size of all headers, i.e., everything but the payload.
Definition: control_events.h:808
mysql::binlog::event::compression::type get_compression_type() const
Definition: control_events.h:856
void set_uncompressed_size(uint64_t size)
Set the uncompressed size of the payload.
Definition: control_events.h:879
static constexpr size_t max_payload_length
The maximum length of the payload size, defined such that the total event size does not exceed max_lo...
Definition: control_events.h:813
uint64_t get_payload_size() const
Definition: control_events.h:870
void set_payload_size(uint64_t size)
Set the (compressed) size of the payload in this event.
Definition: control_events.h:867
static constexpr size_t max_payload_data_header_length
The maximum size of the "payload data header".
Definition: control_events.h:799
static constexpr size_t end_mark_max_length
Definition: control_events.h:789
mysql::binlog::event::compression::buffer::Buffer_sequence_view<> Buffer_sequence_view_t
Definition: control_events.h:737
Transaction_payload_event(const Transaction_payload_event &)=delete
uint64_t m_uncompressed_size
The uncompressed size of the data.
Definition: control_events.h:760
void set_compression_type(mysql::binlog::event::compression::type type)
Set the compression type used for the enclosed payload.
Definition: control_events.h:851
std::string to_string() const
Definition: control_events.cpp:399
This class is used to add view change markers in the binary log when a member of the group enters or ...
Definition: control_events.h:1567
static const int ENCODED_SEQ_NUMBER_OFFSET
Definition: control_events.h:1598
static const int ENCODED_VIEW_ID_MAX_LEN
Definition: control_events.h:1615
long long int seq_number
Definition: control_events.h:1621
~View_change_event() override
Destructor of the View_change_event class.
Definition: control_events.cpp:797
static const int ENCODED_CERT_INFO_SIZE_OFFSET
Definition: control_events.h:1600
View_change_event(const char *buf, const Format_description_event *fde)
Decodes the view_change_log_event generated in case a server enters or leaves the group.
Definition: control_events.cpp:772
static const int ENCODED_CERT_INFO_KEY_SIZE_LEN
Definition: control_events.h:1616
static const int ENCODED_VIEW_ID_OFFSET
Definition: control_events.h:1596
static const int ENCODED_CERT_INFO_VALUE_LEN
Definition: control_events.h:1617
std::map< std::string, std::string > certification_info
Definition: control_events.h:1623
char view_id[ENCODED_VIEW_ID_MAX_LEN]
Definition: control_events.h:1619
An XA_prepare event is generated for a XA prepared transaction.
Definition: control_events.h:587
XA_prepare_event(void *xid_arg, bool oph_arg)
The minimal constructor of XA_prepare_event, it initializes the instance variable xid and set the typ...
Definition: control_events.h:616
static const uint16_t ser_buf_size
Definition: control_events.h:604
bool is_one_phase() const
Whether or not this XA_prepare_event represents an XA COMMIT ONE PHASE.
Definition: control_events.cpp:359
bool one_phase
Definition: control_events.h:608
MY_XID my_xid
Definition: control_events.h:606
void * xid
Definition: control_events.h:607
MY_XID const & get_xid() const
Retrieves the content of my_xid member variable.
Definition: control_events.cpp:361
static const int MY_XIDDATASIZE
Definition: control_events.h:592
An XID event is generated for a commit of a transaction that modifies one or more tables of an XA-cap...
Definition: control_events.h:522
Xid_event(uint64_t xid_arg)
The minimal constructor of Xid_event, it initializes the instance variable xid and set the type_code ...
Definition: control_events.h:529
uint64_t xid
Definition: control_events.h:539
Sequence of memory buffers.
Definition: buffer_sequence_view.h:71
Represents Transaction Source Identifier which is composed of source UUID and transaction tag.
Definition: tsid.h:46
const Tag & get_tag() const
Tag accessor.
Definition: tsid.h:110
Tag & get_tag_ref()
Tag accessor, non const (serialization)
Definition: tsid.h:114
const Uuid & get_uuid() const
UUID accessor.
Definition: tsid.h:122
Binary, read only archive implementation based on vector of bytes.
Definition: read_archive_binary.h:42
Interface for serializable data structures.
Definition: serializable.h:85
Basic serializer that is implementing Serializer interface.
Definition: serializer_default.h:62
Binary, write only archive implementation based on vector of bytes.
Definition: write_archive_binary.h:43
constexpr DWORD buf_size
Definition: create_def.cc:228
helpers aimed at deducing Field_type in case size is provided, and basic field and compound field def...
Experimental API header.
#define ST_SERVER_VER_SPLIT_LEN
Definition: binlog_event.h:87
Definition: buf0block_hint.cc:29
@ NONE
Definition: base.h:44
The namespace contains classes representing events that can occur in a replication stream.
Definition: binlog_event.cpp:35
constexpr size_t max_log_event_size
The maximum value for MAX_ALLOWED_PACKET.
Definition: binlog_event.h:446
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:285
@ INCIDENT_EVENT
Something out of the ordinary happened on the master.
Definition: binlog_event.h:328
@ XID_EVENT
Definition: binlog_event.h:312
@ IGNORABLE_LOG_EVENT
In some situations, it is necessary to send over ignorable data to the slave: data that a slave can h...
Definition: binlog_event.h:342
@ XA_PREPARE_LOG_EVENT
Definition: binlog_event.h:360
@ PREVIOUS_GTIDS_LOG_EVENT
Definition: binlog_event.h:353
@ STOP_EVENT
Definition: binlog_event.h:300
@ GTID_LOG_EVENT
Definition: binlog_event.h:350
@ ROTATE_EVENT
Definition: binlog_event.h:301
@ TRANSACTION_CONTEXT_EVENT
Definition: binlog_event.h:355
void bapi_free(void *ptr)
This is a wrapper function in order to free the memory allocated from the heap in the binlogevent lib...
Definition: wrapper_functions.h:212
mysql::gtid::Uuid Uuid
Definition: global.h:37
constexpr std::size_t tag_max_length
Maximal number of characters in a tag.
Definition: gtid_constants.h:43
auto define_field_with_size(Field_type &arg, Args &&... args)
Definition: field_definition_helpers.h:48
Field_encode_functor_type Field_encode_predicate
Type of the predicate telling serializer whether field is provided or not.
Definition: field_functor.h:46
auto define_field(Field_type &arg, Args &&... args)
Definition: field_definition_helpers.h:53
Field_decode_functor_type Field_missing_functor
Type of the predicate telling serializer what to do in case field is not provided.
Definition: field_functor.h:42
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2881
Experimental API header.
required string type
Definition: replication_group_member_actions.proto:33
Experimental API header.
Experimental API header.
case opt name
Definition: sslopt-case.h:32
Definition: control_events.h:595
long formatID
Definition: control_events.h:596
char data[MY_XIDDATASIZE]
Definition: control_events.h:599
long bqual_length
Definition: control_events.h:598
long gtrid_length
Definition: control_events.h:597
Structure to hold the members declared in the class Gtid_log_event those member are objects of classe...
Definition: control_events.h:725
int64_t rpl_gtid_gno
Definition: control_events.h:727
int32_t rpl_gtid_sidno
Definition: control_events.h:726
Tag representation so that:
Definition: tag_plain.h:47
Uuid is a trivial and of standard layout The structure contains the following components.
Definition: uuid.h:63
std::array< unsigned char, BYTE_LENGTH > bytes
The data for this Uuid.
Definition: uuid.h:145
Include file for Sun RPC to compile out of the box.
Experimental API header.