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