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