MySQL 9.0.0
Source Code Documentation
rows_event.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 rows_event.h
26
27 @brief Contains the classes representing events which are used for row based
28 replication. In row-based replication, the master writes events to the binary
29 log that indicate how individual table rows are changed.
30*/
31
32#ifndef MYSQL_BINLOG_EVENT_ROWS_EVENT_H
33#define MYSQL_BINLOG_EVENT_ROWS_EVENT_H
34
35#include <sstream>
36#include <vector>
39
40/// @addtogroup GroupLibsMysqlBinlogEvent
41/// @{
42
43/**
44 1 byte length, 1 byte format
45 Length is total length in bytes, including 2 byte header
46 Length values 0 and 1 are currently invalid and reserved.
47*/
48#define EXTRA_ROW_INFO_LEN_OFFSET 0
49#define EXTRA_ROW_INFO_FORMAT_OFFSET 1
50#define EXTRA_ROW_INFO_HEADER_LENGTH 2
51#define EXTRA_ROW_INFO_MAX_PAYLOAD (255 - EXTRA_ROW_INFO_HEADER_LENGTH)
52
53#define ROWS_MAPID_OFFSET 0
54#define ROWS_FLAGS_OFFSET 6
55#define ROWS_VHLEN_OFFSET 8
56#define EXTRA_ROW_INFO_TYPECODE_LENGTH 1
57#define EXTRA_ROW_PART_INFO_VALUE_LENGTH 2
58
59/**
60 This is the typecode defined for the different elements present in
61 the container Extra_row_info, this is different from the format information
62 stored inside extra_row_ndb_info at EXTRA_ROW_INFO_FORMAT_OFFSET.
63*/
64enum class enum_extra_row_info_typecode { NDB = 0, PART = 1 };
65
66namespace mysql::binlog::event {
67/**
68 @class Table_map_event
69
70 In row-based mode, every row operation event is preceded by a
71 Table_map_event which maps a table definition to a number. The
72 table definition consists of database name, table name, and column
73 definitions.
74
75 @section Table_map_event_binary_format Binary Format
76
77 The Post-Header has the following components:
78
79 <table>
80 <caption>Post-Header for Table_map_event</caption>
81
82 <tr>
83 <th>Name</th>
84 <th>Format</th>
85 <th>Description</th>
86 </tr>
87
88 <tr>
89 <td>table_id</td>
90 <td>6 bytes unsigned integer</td>
91 <td>The number that identifies the table.</td>
92 </tr>
93
94 <tr>
95 <td>flags</td>
96 <td>2 byte bitfield</td>
97 <td>Reserved for future use; currently always 0.</td>
98 </tr>
99
100 </table>
101
102 The Body has the following components:
103
104 <table>
105 <caption>Body for Table_map_event</caption>
106
107 <tr>
108 <th>Name</th>
109 <th>Format</th>
110 <th>Description</th>
111 </tr>
112
113 <tr>
114 <td>database_name</td>
115 <td>one byte string length, followed by null-terminated string</td>
116 <td>The name of the database in which the table resides. The name
117 is represented as a packed variable-length integer representing the
118 number of bytes in the name, followed by length bytes containing
119 the database name, followed by a terminating 0 byte. (Note the
120 redundancy in the representation of the length.) </td>
121 </tr>
122
123 <tr>
124 <td>table_name</td>
125 <td> The table name is represented as a packed variable-length integer
126 representing the number of bytes in the name, followed by null-terminated
127 string</td>
128 <td>The name of the table, encoded the same way as the database
129 name above.</td>
130 </tr>
131
132 <tr>
133 <td>column_count</td>
134 <td>@ref packed_integer "Packed Integer"</td>
135 <td>The number of columns in the table, represented as a packed
136 variable-length integer.</td>
137 </tr>
138
139 <tr>
140 <td>column_type</td>
141 <td>List of column_count 1 byte enumeration values</td>
142 <td>The type of each column in the table, listed from left to
143 right. Each byte is mapped to a column type according to the
144 enumeration type enum_field_types defined in mysql_com.h. The
145 mapping of types to numbers is listed in the table @ref
146 Table_table_map_event_column_types "below" (along with
147 description of the associated metadata field). </td>
148 </tr>
149
150 <tr>
151 <td>metadata_length</td>
152 <td>@ref packed_integer "Packed Integer"</td>
153 <td>The length of the following metadata block</td>
154 </tr>
155
156 <tr>
157 <td>metadata</td>
158 <td>list of metadata for each column</td>
159 <td>For each column from left to right, a chunk of data who's
160 length and semantics depends on the type of the column. The
161 length and semantics for the metadata for each column are listed
162 in the table @ref Table_table_map_event_column_types
163 "below".</td>
164 </tr>
165
166 <tr>
167 <td>null_bits</td>
168 <td>column_count bits, rounded up to nearest byte</td>
169 <td>For each column, a bit indicating whether data in the column
170 can be NULL or not. The number of bytes needed for this is
171 int((column_count + 7) / 8). The flag for the first column from the
172 left is in the least-significant bit of the first byte, the second
173 is in the second least significant bit of the first byte, the
174 ninth is in the least significant bit of the second byte, and so
175 on. </td>
176 </tr>
177
178 <tr>
179 <td>optional metadata fields</td>
180 <td>optional metadata fields are stored in Type, Length, Value(TLV) format.
181 Type takes 1 byte. Length is a packed integer value. Values takes
182 Length bytes.
183 </td>
184 <td>There are some optional metadata defined. They are listed in the table
185 @ref Table_table_map_event_optional_metadata. Optional metadata fields
186 follow null_bits. Whether binlogging an optional metadata is decided by the
187 server. The order is not defined, so they can be binlogged in any order.
188 </td>
189 </tr>
190 </table>
191
192 The table below lists all column types, along with the numerical
193 identifier for it and the size and interpretation of meta-data used
194 to describe the type.
195
196 @anchor Table_table_map_event_column_types
197 <table>
198 <caption>Table_map_event column types: numerical identifier and
199 metadata</caption>
200 <tr>
201 <th>Name</th>
202 <th>Identifier</th>
203 <th>Size of metadata in bytes</th>
204 <th>Description of metadata</th>
205 </tr>
206
207 <tr>
208 <td>MYSQL_TYPE_DECIMAL</td><td>0</td>
209 <td>0</td>
210 <td>No column metadata.</td>
211 </tr>
212
213 <tr>
214 <td>MYSQL_TYPE_TINY</td><td>1</td>
215 <td>0</td>
216 <td>No column metadata.</td>
217 </tr>
218
219 <tr>
220 <td>MYSQL_TYPE_SHORT</td><td>2</td>
221 <td>0</td>
222 <td>No column metadata.</td>
223 </tr>
224
225 <tr>
226 <td>MYSQL_TYPE_LONG</td><td>3</td>
227 <td>0</td>
228 <td>No column metadata.</td>
229 </tr>
230
231 <tr>
232 <td>MYSQL_TYPE_FLOAT</td><td>4</td>
233 <td>1 byte</td>
234 <td>1 byte unsigned integer, representing the "pack_length", which
235 is equal to sizeof(float) on the server from which the event
236 originates.</td>
237 </tr>
238
239 <tr>
240 <td>MYSQL_TYPE_DOUBLE</td><td>5</td>
241 <td>1 byte</td>
242 <td>1 byte unsigned integer, representing the "pack_length", which
243 is equal to sizeof(double) on the server from which the event
244 originates.</td>
245 </tr>
246
247 <tr>
248 <td>MYSQL_TYPE_NULL</td><td>6</td>
249 <td>0</td>
250 <td>No column metadata.</td>
251 </tr>
252
253 <tr>
254 <td>MYSQL_TYPE_TIMESTAMP</td><td>7</td>
255 <td>0</td>
256 <td>No column metadata.</td>
257 </tr>
258
259 <tr>
260 <td>MYSQL_TYPE_LONGLONG</td><td>8</td>
261 <td>0</td>
262 <td>No column metadata.</td>
263 </tr>
264
265 <tr>
266 <td>MYSQL_TYPE_INT24</td><td>9</td>
267 <td>0</td>
268 <td>No column metadata.</td>
269 </tr>
270
271 <tr>
272 <td>MYSQL_TYPE_DATE</td><td>10</td>
273 <td>0</td>
274 <td>No column metadata.</td>
275 </tr>
276
277 <tr>
278 <td>MYSQL_TYPE_TIME</td><td>11</td>
279 <td>0</td>
280 <td>No column metadata.</td>
281 </tr>
282
283 <tr>
284 <td>MYSQL_TYPE_DATETIME</td><td>12</td>
285 <td>0</td>
286 <td>No column metadata.</td>
287 </tr>
288
289 <tr>
290 <td>MYSQL_TYPE_YEAR</td><td>13</td>
291 <td>0</td>
292 <td>No column metadata.</td>
293 </tr>
294
295 <tr>
296 <td><i>MYSQL_TYPE_NEWDATE</i></td><td><i>14</i></td>
297 <td>&ndash;</td>
298 <td><i>This enumeration value is only used internally and cannot
299 exist in a binlog.</i></td>
300 </tr>
301
302 <tr>
303 <td>MYSQL_TYPE_VARCHAR</td><td>15</td>
304 <td>2 bytes</td>
305 <td>2 byte unsigned integer representing the maximum length of
306 the string.</td>
307 </tr>
308
309 <tr>
310 <td>MYSQL_TYPE_BIT</td><td>16</td>
311 <td>2 bytes</td>
312 <td>A 1 byte unsigned int representing the length in bits of the
313 bitfield (0 to 64), followed by a 1 byte unsigned int
314 representing the number of bytes occupied by the bitfield. The
315 number of bytes is either int((length + 7) / 8) or int(length / 8).
316 </td>
317 </tr>
318
319 <tr>
320 <td>MYSQL_TYPE_NEWDECIMAL</td><td>246</td>
321 <td>2 bytes</td>
322 <td>A 1 byte unsigned int representing the precision, followed
323 by a 1 byte unsigned int representing the number of decimals.</td>
324 </tr>
325
326 <tr>
327 <td><i>MYSQL_TYPE_ENUM</i></td><td><i>247</i></td>
328 <td>&ndash;</td>
329 <td><i>This enumeration value is only used internally and cannot
330 exist in a binlog.</i></td>
331 </tr>
332
333 <tr>
334 <td><i>MYSQL_TYPE_SET</i></td><td><i>248</i></td>
335 <td>&ndash;</td>
336 <td><i>This enumeration value is only used internally and cannot
337 exist in a binlog.</i></td>
338 </tr>
339
340 <tr>
341 <td>MYSQL_TYPE_TINY_BLOB</td><td>249</td>
342 <td>&ndash;</td>
343 <td><i>This enumeration value is only used internally and cannot
344 exist in a binlog.</i></td>
345 </tr>
346
347 <tr>
348 <td><i>MYSQL_TYPE_MEDIUM_BLOB</i></td><td><i>250</i></td>
349 <td>&ndash;</td>
350 <td><i>This enumeration value is only used internally and cannot
351 exist in a binlog.</i></td>
352 </tr>
353
354 <tr>
355 <td><i>MYSQL_TYPE_LONG_BLOB</i></td><td><i>251</i></td>
356 <td>&ndash;</td>
357 <td><i>This enumeration value is only used internally and cannot
358 exist in a binlog.</i></td>
359 </tr>
360
361 <tr>
362 <td>MYSQL_TYPE_BLOB</td><td>252</td>
363 <td>1 byte</td>
364 <td>The pack length, i.e., the number of bytes needed to represent
365 the length of the blob: 1, 2, 3, or 4.</td>
366 </tr>
367
368 <tr>
369 <td>MYSQL_TYPE_VAR_STRING</td><td>253</td>
370 <td>2 bytes</td>
371 <td>This is used to store both strings and enumeration values.
372 The first byte is a enumeration value storing the <i>real
373 type</i>, which may be either MYSQL_TYPE_VAR_STRING or
374 MYSQL_TYPE_ENUM. The second byte is a 1 byte unsigned integer
375 representing the field size, i.e., the number of bytes needed to
376 store the length of the string.</td>
377 </tr>
378
379 <tr>
380 <td>MYSQL_TYPE_STRING</td><td>254</td>
381 <td>2 bytes</td>
382 <td>The first byte is always MYSQL_TYPE_VAR_STRING (i.e., 253).
383 The second byte is the field size, i.e., the number of bytes in
384 the representation of size of the string: 3 or 4.</td>
385 </tr>
386
387 <tr>
388 <td>MYSQL_TYPE_GEOMETRY</td><td>255</td>
389 <td>1 byte</td>
390 <td>The pack length, i.e., the number of bytes needed to represent
391 the length of the geometry: 1, 2, 3, or 4.</td>
392 </tr>
393
394 <tr>
395 <td>MYSQL_TYPE_TYPED_ARRAY</td><td>15</td>
396 <td>up to 4 bytes</td>
397 <td>
398 - The first byte holds the MySQL type for the elements.
399 - The following 0, 1, 2, or 3 bytes holds the metadata for the MySQL
400 type for the elements. The contents of these bytes depends on the
401 element type, as described in the other rows of this table.
402 </td>
403 </tr>
404
405 </table>
406
407 The table below lists all optional metadata types, along with the numerical
408 identifier for it and the size and interpretation of meta-data used
409 to describe the type.
410
411 @anchor Table_table_map_event_optional_metadata
412 <table>
413 <caption>Table_map_event optional metadata types: numerical identifier and
414 metadata. Optional metadata fields are stored in TLV fields.
415 Format of values are described in this table. </caption>
416 <tr>
417 <th>Type</th>
418 <th>Description</th>
419 <th>Format</th>
420 </tr>
421 <tr>
422 <td>SIGNEDNESS</td>
423 <td>signedness of numeric columns. This is included for all values of
424 binlog_row_metadata.</td>
425 <td>For each numeric column, a bit indicates whether the numeric
426 colunm has unsigned flag. 1 means it is unsigned. The number of
427 bytes needed for this is int((column_count + 7) / 8). The order is
428 the same as the order of column_type field.</td>
429 </tr>
430 <tr>
431 <td>DEFAULT_CHARSET</td>
432 <td>Charsets of character columns. It has a default charset for
433 the case that most of character columns have same charset and the
434 most used charset is binlogged as default charset.Collation
435 numbers are binlogged for identifying charsets. They are stored in
436 packed length format. Either DEFAULT_CHARSET or COLUMN_CHARSET is
437 included for all values of binlog_row_metadata.</td>
438 <td>Default charset's collation is logged first. The charsets which are not
439 same to default charset are logged following default charset. They are
440 logged as column index and charset collation number pair sequence. The
441 column index is counted only in all character columns. The order is same to
442 the order of column_type
443 field. </td>
444 </tr>
445 <tr>
446 <td>COLUMN_CHARSET</td>
447 <td>Charsets of character columns. For the case that most of columns have
448 different charsets, this field is logged. It is never logged with
449 DEFAULT_CHARSET together. Either DEFAULT_CHARSET or COLUMN_CHARSET is
450 included for all values of binlog_row_metadata.</td>
451 <td>It is a collation number sequence for all character columns.</td>
452 </tr>
453 <tr>
454 <td>COLUMN_NAME</td>
455 <td>Names of columns. This is only included if
456 binlog_row_metadata=FULL.</td>
457 <td>A sequence of column names. For each column name, 1 byte for
458 the string length in bytes is followed by a string without null
459 terminator.</td>
460 </tr>
461 <tr>
462 <td>SET_STR_VALUE</td>
463 <td>The string values of SET columns. This is only included if
464 binlog_row_metadata=FULL.</td>
465 <td>For each SET column, a pack_length representing the value
466 count is followed by a sequence of length and string pairs. length
467 is the byte count in pack_length format. The string has no null
468 terminator.</td>
469 </tr>
470 <tr>
471 <td>ENUM_STR_VALUE</td>
472 <td>The string values is ENUM columns. This is only included
473 if binlog_row_metadata=FULL.</td>
474 <td>The format is the same as SET_STR_VALUE.</td>
475 </tr>
476 <tr>
477 <td>GEOMETRY_TYPE</td>
478 <td>The real type of geometry columns. This is only included
479 if binlog_row_metadata=FULL.</td>
480 <td>A sequence of real type of geometry columns are stored in pack_length
481 format. </td>
482 </tr>
483 <tr>
484 <td>SIMPLE_PRIMARY_KEY</td>
485 <td>The primary key without any prefix. This is only included
486 if binlog_row_metadata=FULL and there is a primary key where every
487 key part covers an entire column.</td>
488 <td>A sequence of column indexes. The indexes are stored in pack_length
489 format.</td>
490 </tr>
491 <tr>
492 <td>PRIMARY_KEY_WITH_PREFIX</td>
493 <td>The primary key with some prefix. It doesn't appear together with
494 SIMPLE_PRIMARY_KEY. This is only included if
495 binlog_row_metadata=FULL and there is a primary key where some key
496 part covers a prefix of the column.</td>
497 <td>A sequence of column index and prefix length pairs. Both
498 column index and prefix length are in pack_length format. Prefix length
499 0 means that the whole column value is used.</td>
500 </tr>
501 <tr>
502 <td>ENUM_AND_SET_DEFAULT_CHARSET</td>
503 <td>Charsets of ENUM and SET columns. It has the same layout as
504 DEFAULT_CHARSET. If there are SET or ENUM columns and
505 binlog_row_metadata=FULL, exactly one of
506 ENUM_AND_SET_DEFAULT_CHARSET and ENUM_AND_SET_COLUMN_CHARSET
507 appears (the encoder chooses the representation that uses the
508 least amount of space). Otherwise, none of them appears.</td>
509 <td>The same format as for DEFAULT_CHARSET, except it counts ENUM
510 and SET columns rather than character columns.</td>
511 </tr>
512 <tr>
513 <td>ENUM_AND_SET_COLUMN_CHARSET</td>
514 <td>Charsets of ENUM and SET columns. It has the same layout as
515 COLUMN_CHARSET. If there are SET or ENUM columns and
516 binlog_row_metadata=FULL, exactly one of
517 ENUM_AND_SET_DEFAULT_CHARSET and ENUM_AND_SET_COLUMN_CHARSET
518 appears (the encoder chooses the representation that uses the
519 least amount of space). Otherwise, none of them appears.</td>
520 <td>The same format as for COLUMN_CHARSET, except it counts ENUM
521 and SET columns rather than character columns.</td>
522 </tr>
523 </table>
524*/
526 public:
527 /** Constants representing offsets */
529 /** TM = "Table Map" */
532 };
533
534 typedef uint16_t flag_set;
535
536 /**
537 DEFAULT_CHARSET and COLUMN_CHARSET don't appear together, and
538 ENUM_AND_SET_DEFAULT_CHARSET and ENUM_AND_SET_COLUMN_CHARSET don't
539 appear together. They are just alternative ways to pack character
540 set information. When binlogging, it logs character sets in the
541 way that occupies least storage.
542
543 SIMPLE_PRIMARY_KEY and PRIMARY_KEY_WITH_PREFIX don't appear together.
544 SIMPLE_PRIMARY_KEY is for the primary keys which only use whole values of
545 pk columns. PRIMARY_KEY_WITH_PREFIX is
546 for the primary keys which just use part value of pk columns.
547 */
549 SIGNEDNESS = 1, // UNSIGNED flag of numeric columns
550 DEFAULT_CHARSET, /* Character set of string columns, optimized to
551 minimize space when many columns have the
552 same charset. */
553 COLUMN_CHARSET, /* Character set of string columns, optimized to
554 minimize space when columns have many
555 different charsets. */
557 SET_STR_VALUE, // String value of SET columns
558 ENUM_STR_VALUE, // String value of ENUM columns
559 GEOMETRY_TYPE, // Real type of geometry columns
560 SIMPLE_PRIMARY_KEY, // Primary key without prefix
561 PRIMARY_KEY_WITH_PREFIX, // Primary key with prefix
562 ENUM_AND_SET_DEFAULT_CHARSET, /* Character set of enum and set
563 columns, optimized to minimize
564 space when many columns have the
565 same charset. */
566 ENUM_AND_SET_COLUMN_CHARSET, /* Character set of enum and set
567 columns, optimized to minimize
568 space when many columns have the
569 same charset. */
570 COLUMN_VISIBILITY, /* Flag to indicate column visibility
571 attribute. */
572 VECTOR_DIMENSIONALITY /* Vector column dimensionality */
573 };
574
575 /**
576 Metadata_fields organizes m_optional_metadata into a structured format which
577 is easy to access.
578 */
580 typedef std::pair<unsigned int, unsigned int> uint_pair;
581 typedef std::vector<std::string> str_vector;
582
585 bool empty() const { return default_charset == 0; }
586
587 // Default charset for the columns which are not in charset_pairs.
588 unsigned int default_charset;
589
590 /* The uint_pair means <column index, column charset number>. */
591 std::vector<uint_pair> charset_pairs;
592 };
593
594 // Contents of DEFAULT_CHARSET field are converted into Default_charset.
596 // Contents of ENUM_AND_SET_DEFAULT_CHARSET are converted into
597 // Default_charset.
599 std::vector<bool> m_signedness;
600 // Character set number of every string column
601 std::vector<unsigned int> m_column_charset;
602 // Character set number of every ENUM or SET column.
603 std::vector<unsigned int> m_enum_and_set_column_charset;
604 std::vector<std::string> m_column_name;
605 // each str_vector stores values of one enum/set column
606 std::vector<str_vector> m_enum_str_value;
607 std::vector<str_vector> m_set_str_value;
608 std::vector<unsigned int> m_geometry_type;
609 std::vector<unsigned int> m_vector_dimensionality;
610 /*
611 The uint_pair means <column index, prefix length>. Prefix length is 0 if
612 whole column value is used.
613 */
614 std::vector<uint_pair> m_primary_key;
615 std::vector<bool> m_column_visibility;
616
617 /*
618 It parses m_optional_metadata and populates into above variables.
619
620 @param[in] optional_metadata points to the begin of optional metadata
621 fields in table_map_event.
622 @param[in] optional_metadata_len length of optional_metadata field.
623 */
624 Optional_metadata_fields(unsigned char *optional_metadata,
625 unsigned int optional_metadata_len);
626 // It is used to specify the validity of the deserialized structure
628 };
629
630 /**
631 <pre>
632 The buffer layout for fixed data part is as follows:
633 +-----------------------------------+
634 | table_id | Reserved for future use|
635 +-----------------------------------+
636 </pre>
637
638 <pre>
639 The buffer layout for variable data part is as follows:
640 +--------------------------------------------------------------------------+
641 | db len| db name | table len| table name | no of cols | array of col types|
642 +--------------------------------------------------------------------------+
643 +---------------------------------------------+
644 | metadata len | metadata block | m_null_bits |
645 +---------------------------------------------+
646 </pre>
647
648 @param buf Contains the serialized event.
649 @param fde An FDE event (see Rotate_event constructor for more info).
650 */
651 Table_map_event(const char *buf, const Format_description_event *fde);
652
653 Table_map_event(const Table_id &tid, unsigned long colcnt, const char *dbnam,
654 size_t dblen, const char *tblnam, size_t tbllen)
656 m_table_id(tid),
657 m_data_size(0),
658 m_dbnam(""),
659 m_dblen(dblen),
660 m_tblnam(""),
661 m_tbllen(tbllen),
662 m_colcnt(colcnt),
668 if (dbnam) m_dbnam = std::string(dbnam, m_dblen);
669 if (tblnam) m_tblnam = std::string(tblnam, m_tbllen);
670 }
671
672 ~Table_map_event() override;
673
674 /** Event post header contents */
677
678 size_t m_data_size; /** event data size */
679
680 /** Event body contents */
681 std::string m_dbnam;
682 unsigned long long int m_dblen;
683 std::string m_tblnam;
684 unsigned long long int m_tbllen;
685 unsigned long m_colcnt;
686 unsigned char *m_coltype;
687
688 /**
689 The size of field metadata buffer set by calling save_field_metadata()
690 */
692 unsigned char *m_field_metadata; /** field metadata */
693 unsigned char *m_null_bits;
695 unsigned char *m_optional_metadata;
696
705
706 unsigned long long get_table_id() { return m_table_id.id(); }
707 std::string get_table_name() { return m_tblnam; }
708 std::string get_db_name() { return m_dbnam; }
709
710#ifndef HAVE_MYSYS
711 void print_event_info(std::ostream &info) override;
712 void print_long_info(std::ostream &info) override;
713#endif
714};
715
716/**
717 @class Rows_event
718
719 Common base class for all row-containing binary log events.
720
721 RESPONSIBILITIES
722
723 - Provide an interface for adding an individual row to the event.
724
725 @section Rows_event_binary_format Binary Format
726
727 The Post-Header has the following components:
728
729 <table>
730 <caption>Post-Header for Rows_event</caption>
731
732 <tr>
733 <th>Name</th>
734 <th>Format</th>
735 <th>Description</th>
736 </tr>
737
738 <tr>
739 <td>table_id</td>
740 <td>6 bytes unsigned integer</td>
741 <td>The number that identifies the table</td>
742 </tr>
743
744 <tr>
745 <td>flags</td>
746 <td>2 byte bitfield</td>
747 <td>Reserved for future use; currently always 0.</td>
748 </tr>
749
750 </table>
751
752 The Body has the following components:
753
754 <table>
755 <caption>Body for Rows_event</caption>
756
757 <tr>
758 <th>Name</th>
759 <th>Format</th>
760 <th>Description</th>
761 </tr>
762
763
764 <tr>
765 <td>width</td>
766 <td>packed integer</td>
767 <td>Represents the number of columns in the table</td>
768 </tr>
769
770 <tr>
771 <td>cols</td>
772 <td>Bitfield, variable sized</td>
773 <td>Indicates whether each column is used, one bit per column.
774 For this field, the amount of storage required is
775 INT((width + 7) / 8) bytes. </td>
776 </tr>
777
778 <tr>
779 <td>extra_row_info</td>
780 <td>An object of class Extra_row_info</td>
781 <td>The class Extra_row_info will be storing the information related
782 to m_extra_row_ndb_info and partition info (partition_id and
783 source_partition_id). At any given time a Rows_event can have both, one
784 or none of ndb_info and partition_info present as part of Rows_event.
785 In case both ndb_info and partition_info are present then below will
786 be the order in which they will be stored.
787
788 @verbatim
789 +----------+--------------------------------------+
790 |type_code | extra_row_ndb_info |
791 +--- ------+--------------------------------------+
792 | NDB |Len of ndb_info |Format |ndb_data |
793 | 1 byte |1 byte |1 byte |len - 2 byte |
794 +----------+----------------+-------+-------------+
795
796 In case of INSERT/DELETE
797 +-----------+----------------+
798 | type_code | partition_info |
799 +-----------+----------------+
800 | PART | partition_id |
801 | (1 byte) | 2 byte |
802 +-----------+----------------+
803
804 In case of UPDATE
805 +-----------+------------------------------------+
806 | type_code | partition_info |
807 +-----------+--------------+---------------------+
808 | PART | partition_id | source_partition_id |
809 | (1 byte) | 2 byte | 2 byte |
810 +-----------+--------------+---------------------+
811
812 source_partition_id is used only in the case of Update_event
813 to log the partition_id of the source partition.
814
815 @endverbatim
816 This is the format for any information stored as extra_row_info.
817 type_code is not a part of the class Extra_row_info as it is a constant
818 values used at the time of serializing and decoding the event.
819 </td>
820 </tr>
821
822 <tr>
823 <td>columns_before_image</td>
824 <td>vector of elements of type uint8_t</td>
825 <td>For DELETE and UPDATE only.
826 Bit-field indicating whether each column is used
827 one bit per column. For this field, the amount of storage
828 required for N columns is INT((N + 7) / 8) bytes.</td>
829 </tr>
830
831 <tr>
832 <td>columns_after_image</td>
833 <td>vector of elements of type uint8_t</td>
834 <td>For WRITE and UPDATE only.
835 Bit-field indicating whether each column is used in the
836 UPDATE_ROWS_EVENT and WRITE_ROWS_EVENT after-image; one bit per column.
837 For this field, the amount of storage required for N columns
838 is INT((N + 7) / 8) bytes.
839
840 @verbatim
841 +-------------------------------------------------------+
842 | Event Type | Cols_before_image | Cols_after_image |
843 +-------------------------------------------------------+
844 | DELETE | Deleted row | NULL |
845 | INSERT | NULL | Inserted row |
846 | UPDATE | Old row | Updated row |
847 +-------------------------------------------------------+
848 @endverbatim
849 </td>
850 </tr>
851
852 <tr>
853 <td>row</td>
854 <td>vector of elements of type uint8_t</td>
855 <td> A sequence of zero or more rows. The end is determined by the size
856 of the event. Each row has the following format:
857 - A Bit-field indicating whether each field in the row is NULL.
858 Only columns that are "used" according to the second field in
859 the variable data part are listed here. If the second field in
860 the variable data part has N one-bits, the amount of storage
861 required for this field is INT((N + 7) / 8) bytes.
862 - The row-image, containing values of all table fields. This only
863 lists table fields that are used (according to the second field
864 of the variable data part) and non-NULL (according to the
865 previous field). In other words, the number of values listed here
866 is equal to the number of zero bits in the previous field.
867 (not counting padding bits in the last byte).
868 @verbatim
869 For example, if a INSERT statement inserts into 4 columns of a
870 table, N= 4 (in the formula above).
871 length of bitmask= (4 + 7) / 8 = 1
872 Number of fields in the row= 4.
873
874 +------------------------------------------------+
875 |Null_bit_mask(4)|field-1|field-2|field-3|field 4|
876 +------------------------------------------------+
877 @endverbatim
878 </td>
879 </tr>
880 </table>
881*/
883 public:
884 /**
885 These definitions allow to combine the flags into an
886 appropriate flag set using the normal bitwise operators. The
887 implicit conversion from an enum-constant to an integer is
888 accepted by the compiler, which is then used to set the real set
889 of flags.
890 */
892 /** Last event of a statement */
893 STMT_END_F = (1U << 0),
894 /** Value of the OPTION_NO_FOREIGN_KEY_CHECKS flag in thd->options */
896 /** Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options */
898 /**
899 Indicates that rows in this event are complete, that is contain
900 values for all columns of the table.
901 */
902 COMPLETE_ROWS_F = (1U << 3),
903 /**
904 Flags for everything. Please update when you add new flags.
905 */
908 };
909
910 /**
911 Constructs an event directly. The members are assigned default values.
912
913 @param type_arg Type of ROW_EVENT. Expected types are:
914 - WRITE_ROWS_EVENT
915 - UPDATE_ROWS_EVENT, PARTIAL_UPDATE_ROWS_EVENT
916 - DELETE_ROWS_EVENT
917 */
918 explicit Rows_event(Log_event_type type_arg)
919 : Binary_log_event(type_arg),
920 m_table_id(0),
921 m_width(0),
924 row(0) {}
925 /**
926 The constructor is responsible for decoding the event contained in
927 the buffer.
928
929 <pre>
930 The buffer layout for fixed data part is as follows
931 +------------------------------------+
932 | table_id | reserved for future use |
933 +------------------------------------+
934 </pre>
935
936 <pre>
937 The buffer layout for variable data part is as follows
938 +------------------------------------------------------------------+
939 | var_header_len | column_before_image | columns_after_image | row |
940 +------------------------------------------------------------------+
941 </pre>
942
943 @param buf Contains the serialized event.
944 @param fde An FDE event (see Rotate_event constructor for more info).
945 */
946 Rows_event(const char *buf, const Format_description_event *fde);
947
948 ~Rows_event() override;
949
950 protected:
951 Log_event_type m_type; /** Actual event type */
952
953 /** Post header content */
955 uint16_t m_flags; /** Flags for row-level events */
956
957 /* Body of the event */
958 unsigned long m_width; /** The width of the columns bitmap */
959 uint32_t n_bits_len; /** value determined by (m_width + 7) / 8 */
961
962 std::vector<uint8_t> columns_before_image;
963 std::vector<uint8_t> columns_after_image;
964 std::vector<uint8_t> row;
965
966 public:
968 private:
969 /** partition_id for a row in a partitioned table */
971 /**
972 It is the partition_id of the source partition in case
973 of Update_event, the target's partition_id is m_partition_id.
974 This variable is used only in case of Update_event.
975 */
977 /** The extra row info provided by NDB */
978 unsigned char *m_extra_row_ndb_info;
979
980 public:
985
987
988 int get_partition_id() const { return m_partition_id; }
989 void set_partition_id(int partition_id) {
990 BAPI_ASSERT(partition_id <= 65535);
991 m_partition_id = partition_id;
992 }
993
995 void set_source_partition_id(int source_partition_id) {
996 BAPI_ASSERT(source_partition_id <= 65535);
997 m_source_partition_id = source_partition_id;
998 }
999
1000 unsigned char *get_ndb_info() const { return m_extra_row_ndb_info; }
1001 void set_ndb_info(const unsigned char *ndb_info, size_t len) {
1004 static_cast<unsigned char *>(bapi_malloc(len, 16 /* flags */));
1005 std::copy(ndb_info, ndb_info + len, m_extra_row_ndb_info);
1006 }
1007 /**
1008 Compares the extra_row_info in a Row event, it checks three things
1009 1. The m_extra_row_ndb_info pointers. It compares their significant bytes.
1010 2. Partition_id
1011 3. source_partition_id
1012
1013 @return
1014 true all the above variables are same in the event and the one passed
1015 in parameter.
1016 false Any of the above variable has a different value.
1017 */
1018 bool compare_extra_row_info(const unsigned char *ndb_info_arg,
1019 int part_id_arg, int source_part_id);
1020
1021 bool have_part() const { return m_partition_id != UNDEFINED; }
1022
1023 bool have_ndb_info() const { return m_extra_row_ndb_info != nullptr; }
1024 size_t get_ndb_length();
1025 size_t get_part_length();
1027
1028 static const int UNDEFINED{INT_MAX};
1029 };
1031
1032 unsigned long long get_table_id() const { return m_table_id.id(); }
1033
1034 enum_flag get_flags() const { return static_cast<enum_flag>(m_flags); }
1035
1036 uint32_t get_null_bits_len() const { return n_bits_len; }
1037
1038 unsigned long get_width() const { return m_width; }
1039
1040 /**
1041 @brief Gets the flags listed as strings. If there are no flags set, returns
1042 an empty string.
1043
1044 @return A string with the names of the flags set. If no flag is set, returns
1045 an empty string.
1046 */
1047 std::string get_enum_flag_string() const {
1050 if (!m_flags) return "";
1051 std::stringstream ss;
1052 ss << " flags:";
1053 if (m_flags & STMT_END_F) ss << " STMT_END_F";
1054 if (m_flags & NO_FOREIGN_KEY_CHECKS_F) ss << " NO_FOREIGN_KEY_CHECKS_F";
1055 if (m_flags & RELAXED_UNIQUE_CHECKS_F) ss << " RELAXED_UNIQUE_CHECKS_F";
1056 if (m_flags & COMPLETE_ROWS_F) ss << " COMPLETE_ROWS_F";
1057 if (m_flags & ~ALL_FLAGS) {
1058 assert(false);
1059 auto unknown_flags = m_flags & ~ALL_FLAGS;
1060 ss << " UNKNOWN_FLAG(" << std::hex << "0x" << unknown_flags << ")";
1061 }
1062 return ss.str();
1063 }
1064
1065 /**
1066 Gets a string describing the flags.
1067
1068 @param flag A set of flags to get the description for.
1069 @return a string describing the flags.
1070 */
1071 static std::string get_flag_string(enum_flag flag) {
1074 std::string str = "";
1075 if (flag & STMT_END_F) str.append(" Last event of the statement");
1076 if (flag & NO_FOREIGN_KEY_CHECKS_F) str.append(" No foreign Key checks");
1077 if (flag & RELAXED_UNIQUE_CHECKS_F) str.append(" No unique key checks");
1078 if (flag & COMPLETE_ROWS_F) str.append(" Complete Rows");
1079 if (flag & ~ALL_FLAGS) str.append(" Unknown Flag");
1080 return str;
1081 }
1082#ifndef HAVE_MYSYS
1083 void print_event_info(std::ostream &info) override;
1084 void print_long_info(std::ostream &info) override;
1085#endif
1086
1087 template <class Iterator_value_type>
1089};
1090
1091/**
1092 @class Write_rows_event
1093
1094 Log row insertions. The event contain several insert/update rows
1095 for a table. Note that each event contains only rows for one table.
1096
1097 @section Write_rows_event_binary_format Binary Format
1098*/
1099class Write_rows_event : public virtual Rows_event {
1100 public:
1101 Write_rows_event(const char *buf, const Format_description_event *fde);
1103};
1104
1105/**
1106 @class Update_rows_event
1107
1108 Log row updates with a before image. The event contain several
1109 update rows for a table. Note that each event contains only rows for
1110 one table.
1111
1112 Also note that the row data consists of pairs of row data: one row
1113 for the old data and one row for the new data.
1114
1115 @section Update_rows_event_binary_format Binary Format
1116*/
1117class Update_rows_event : public virtual Rows_event {
1118 public:
1119 Update_rows_event(const char *buf, const Format_description_event *fde);
1120 Update_rows_event(Log_event_type event_type) : Rows_event(event_type) {}
1121};
1122
1123/**
1124 @class Delete_rows_event
1125
1126 Log row deletions. The event contain several delete rows for a
1127 table. Note that each event contains only rows for one table.
1128
1129 RESPONSIBILITIES
1130
1131 - Act as a container for rows that has been deleted on the master
1132 and should be deleted on the slave.
1133
1134 @section Delete_rows_event_binary_format Binary Format
1135*/
1136class Delete_rows_event : public virtual Rows_event {
1137 public:
1138 Delete_rows_event(const char *buf, const Format_description_event *fde);
1140};
1141
1142/**
1143 @class Rows_query_event
1144
1145 Rows query event type, which is a subclass
1146 of the Ignorable_event, to record the original query for the rows
1147 events in RBR. This event can be used to display the original query as
1148 comments by SHOW BINLOG EVENTS query, or mysqlbinlog client when the
1149 --verbose option is given twice
1150
1151 @section Rows_query_var_event_binary_format Binary Format
1152
1153 The Post-Header for this event type is empty. The Body has one
1154 component:
1155
1156 <table>
1157 <caption>Body for Rows_query_event</caption>
1158
1159 <tr>
1160 <th>Name</th>
1161 <th>Format</th>
1162 <th>Description</th>
1163 </tr>
1164
1165 <tr>
1166 <td>m_rows_query</td>
1167 <td>char array</td>
1168 <td>Records the original query executed in RBR </td>
1169 </tr>
1170 <tr>
1171 <td>m_rows_query_length</td>
1172 <td>integer</td>
1173 <td>Stores the original query length executed in RBR </td>
1174 </tr>
1175 </table>
1176*/
1177class Rows_query_event : public virtual Ignorable_event {
1178 public:
1179 /**
1180 It is used to write the original query in the binlog file in case of RBR
1181 when the session flag binlog_rows_query_log_events is set.
1182
1183 <pre>
1184 The buffer layout is as follows:
1185 +------------------------------------+
1186 | The original query executed in RBR |
1187 +------------------------------------+
1188 </pre>
1189
1190 @param buf Contains the serialized event.
1191 @param fde An FDE event (see Rotate_event constructor for more info).
1192 */
1193
1194 Rows_query_event(const char *buf, const Format_description_event *fde);
1195 /**
1196 It is the minimal constructor, and all it will do is set the type_code as
1197 ROWS_QUERY_LOG_EVENT in the header object in Binary_log_event.
1198 */
1203
1204 ~Rows_query_event() override;
1205
1206 protected:
1209};
1210} // namespace mysql::binlog::event
1211
1212/// @}
1213
1214#endif // MYSQL_BINLOG_EVENT_ROWS_EVENT_H
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
This is the abstract base class for binary log events.
Definition: binlog_event.h:859
Log row deletions.
Definition: rows_event.h:1136
Delete_rows_event()
Definition: rows_event.h:1139
For binlog version 4.
Definition: control_events.h:239
Base class for ignorable log events.
Definition: control_events.h:674
unsigned char * get_ndb_info() const
Definition: rows_event.h:1000
int get_partition_id() const
Definition: rows_event.h:988
Extra_row_info()
Definition: rows_event.h:981
int get_source_partition_id() const
Definition: rows_event.h:994
unsigned char * m_extra_row_ndb_info
The extra row info provided by NDB.
Definition: rows_event.h:978
void set_partition_id(int partition_id)
Definition: rows_event.h:989
bool have_part() const
Definition: rows_event.h:1021
static const int UNDEFINED
Definition: rows_event.h:1028
void set_ndb_info(const unsigned char *ndb_info, size_t len)
Definition: rows_event.h:1001
~Extra_row_info()
Definition: rows_event.cpp:540
bool compare_extra_row_info(const unsigned char *ndb_info_arg, int part_id_arg, int source_part_id)
Compares the extra_row_info in a Row event, it checks three things.
Definition: rows_event.cpp:508
void set_source_partition_id(int source_partition_id)
Definition: rows_event.h:995
size_t get_part_length()
Definition: rows_event.cpp:531
int m_partition_id
partition_id for a row in a partitioned table
Definition: rows_event.h:970
int m_source_partition_id
It is the partition_id of the source partition in case of Update_event, the target's partition_id is ...
Definition: rows_event.h:976
size_t get_ndb_length()
Definition: rows_event.cpp:524
Extra_row_info(const Extra_row_info &)=delete
bool have_ndb_info() const
Definition: rows_event.h:1023
Common base class for all row-containing binary log events.
Definition: rows_event.h:882
unsigned long m_width
Flags for row-level events.
Definition: rows_event.h:958
enum_flag
These definitions allow to combine the flags into an appropriate flag set using the normal bitwise op...
Definition: rows_event.h:891
@ STMT_END_F
Last event of a statement.
Definition: rows_event.h:893
@ NO_FOREIGN_KEY_CHECKS_F
Value of the OPTION_NO_FOREIGN_KEY_CHECKS flag in thd->options.
Definition: rows_event.h:895
@ RELAXED_UNIQUE_CHECKS_F
Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options.
Definition: rows_event.h:897
@ ALL_FLAGS
Flags for everything.
Definition: rows_event.h:906
@ COMPLETE_ROWS_F
Indicates that rows in this event are complete, that is contain values for all columns of the table.
Definition: rows_event.h:902
unsigned long long get_table_id() const
Definition: rows_event.h:1032
std::string get_enum_flag_string() const
Gets the flags listed as strings.
Definition: rows_event.h:1047
Rows_event(Log_event_type type_arg)
Constructs an event directly.
Definition: rows_event.h:918
uint16_t var_header_len
value determined by (m_width + 7) / 8
Definition: rows_event.h:960
uint32_t n_bits_len
The width of the columns bitmap.
Definition: rows_event.h:959
unsigned long get_width() const
Definition: rows_event.h:1038
Table_id m_table_id
Actual event type.
Definition: rows_event.h:954
std::vector< uint8_t > row
Definition: rows_event.h:964
Extra_row_info m_extra_row_info
Definition: rows_event.h:1030
uint32_t get_null_bits_len() const
Definition: rows_event.h:1036
friend class Row_event_iterator
Definition: rows_event.h:1088
enum_flag get_flags() const
Definition: rows_event.h:1034
static std::string get_flag_string(enum_flag flag)
Gets a string describing the flags.
Definition: rows_event.h:1071
Log_event_type m_type
Definition: rows_event.h:951
std::vector< uint8_t > columns_after_image
Definition: rows_event.h:963
uint16_t m_flags
Definition: rows_event.h:955
std::vector< uint8_t > columns_before_image
Definition: rows_event.h:962
Rows query event type, which is a subclass of the Ignorable_event, to record the original query for t...
Definition: rows_event.h:1177
char * m_rows_query
Definition: rows_event.h:1207
~Rows_query_event() override
Definition: rows_event.cpp:571
Rows_query_event()
It is the minimal constructor, and all it will do is set the type_code as ROWS_QUERY_LOG_EVENT in the...
Definition: rows_event.h:1199
size_t m_rows_query_length
Definition: rows_event.h:1208
Each table share has a table id, it is mainly used for row based replication.
Definition: table_id.h:42
unsigned long long id() const
Definition: table_id.h:52
In row-based mode, every row operation event is preceded by a Table_map_event which maps a table defi...
Definition: rows_event.h:525
unsigned char * m_coltype
Definition: rows_event.h:686
Table_map_event()
Definition: rows_event.h:697
std::string m_tblnam
Definition: rows_event.h:683
std::string get_table_name()
Definition: rows_event.h:707
uint16_t flag_set
Definition: rows_event.h:534
unsigned char * m_null_bits
field metadata
Definition: rows_event.h:693
unsigned long long get_table_id()
Definition: rows_event.h:706
unsigned long long int m_dblen
Definition: rows_event.h:682
unsigned long long int m_tbllen
Definition: rows_event.h:684
Optional_metadata_field_type
DEFAULT_CHARSET and COLUMN_CHARSET don't appear together, and ENUM_AND_SET_DEFAULT_CHARSET and ENUM_A...
Definition: rows_event.h:548
@ PRIMARY_KEY_WITH_PREFIX
Definition: rows_event.h:561
@ COLUMN_CHARSET
Definition: rows_event.h:553
@ SET_STR_VALUE
Definition: rows_event.h:557
@ VECTOR_DIMENSIONALITY
Definition: rows_event.h:572
@ COLUMN_VISIBILITY
Definition: rows_event.h:570
@ ENUM_AND_SET_DEFAULT_CHARSET
Definition: rows_event.h:562
@ SIMPLE_PRIMARY_KEY
Definition: rows_event.h:560
@ ENUM_AND_SET_COLUMN_CHARSET
Definition: rows_event.h:566
@ ENUM_STR_VALUE
Definition: rows_event.h:558
@ SIGNEDNESS
Definition: rows_event.h:549
@ DEFAULT_CHARSET
Definition: rows_event.h:550
@ GEOMETRY_TYPE
Definition: rows_event.h:559
@ COLUMN_NAME
Definition: rows_event.h:556
unsigned long m_colcnt
Definition: rows_event.h:685
unsigned char * m_field_metadata
Definition: rows_event.h:692
unsigned long m_field_metadata_size
The size of field metadata buffer set by calling save_field_metadata()
Definition: rows_event.h:691
~Table_map_event() override
Definition: rows_event.cpp:106
std::string get_db_name()
Definition: rows_event.h:708
size_t m_data_size
Definition: rows_event.h:678
std::string m_dbnam
event data size
Definition: rows_event.h:681
Table_map_event(const Table_id &tid, unsigned long colcnt, const char *dbnam, size_t dblen, const char *tblnam, size_t tbllen)
Definition: rows_event.h:653
Table_map_event_offset
Constants representing offsets.
Definition: rows_event.h:528
@ TM_FLAGS_OFFSET
Definition: rows_event.h:531
@ TM_MAPID_OFFSET
TM = "Table Map".
Definition: rows_event.h:530
flag_set m_flags
Definition: rows_event.h:676
unsigned int m_optional_metadata_len
Definition: rows_event.h:694
Table_id m_table_id
Event post header contents.
Definition: rows_event.h:675
unsigned char * m_optional_metadata
Definition: rows_event.h:695
Log row updates with a before image.
Definition: rows_event.h:1117
Update_rows_event(const char *buf, const Format_description_event *fde)
Definition: rows_event.cpp:584
Update_rows_event(Log_event_type event_type)
Definition: rows_event.h:1120
Log row insertions.
Definition: rows_event.h:1099
Write_rows_event()
Definition: rows_event.h:1102
Contains the classes representing events operating in the replication stream properties.
enum_extra_row_info_typecode
This is the typecode defined for the different elements present in the container Extra_row_info,...
Definition: rows_event.h:64
static int flag
Definition: hp_test1.cc:40
void copy(Shards< COUNT > &dst, const Shards< COUNT > &src) noexcept
Copy the counters, overwrite destination.
Definition: ut0counter.h:354
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Definition: buf0block_hint.cc:30
The namespace contains classes representing events that can occur in a replication stream.
Definition: binlog_event.cpp:36
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:286
@ ROWS_QUERY_LOG_EVENT
Definition: binlog_event.h:345
@ WRITE_ROWS_EVENT
Version 2 of the Row events.
Definition: binlog_event.h:348
@ DELETE_ROWS_EVENT
Definition: binlog_event.h:350
@ TABLE_MAP_EVENT
Definition: binlog_event.h:317
void * bapi_malloc(size_t size, int flags)
This is a wrapper function in order to allocate memory from the heap in the binlogevent library.
Definition: wrapper_functions.h:193
std::vector< uint_pair > charset_pairs
Definition: rows_event.h:591
Metadata_fields organizes m_optional_metadata into a structured format which is easy to access.
Definition: rows_event.h:579
std::vector< str_vector > m_enum_str_value
Definition: rows_event.h:606
std::vector< std::string > m_column_name
Definition: rows_event.h:604
std::vector< unsigned int > m_vector_dimensionality
Definition: rows_event.h:609
std::vector< uint_pair > m_primary_key
Definition: rows_event.h:614
std::vector< bool > m_column_visibility
Definition: rows_event.h:615
Optional_metadata_fields(unsigned char *optional_metadata, unsigned int optional_metadata_len)
Definition: rows_event.cpp:340
std::vector< str_vector > m_set_str_value
Definition: rows_event.h:607
Default_charset m_default_charset
Definition: rows_event.h:595
Default_charset m_enum_and_set_default_charset
Definition: rows_event.h:598
std::vector< unsigned int > m_column_charset
Definition: rows_event.h:601
std::vector< std::string > str_vector
Definition: rows_event.h:581
std::pair< unsigned int, unsigned int > uint_pair
Definition: rows_event.h:580
std::vector< unsigned int > m_geometry_type
Definition: rows_event.h:608
std::vector< unsigned int > m_enum_and_set_column_charset
Definition: rows_event.h:603
std::vector< bool > m_signedness
Definition: rows_event.h:599
Contains the class Table_id, mainly used for row based replication.
#define BAPI_ASSERT(x)
Definition: wrapper_functions.h:61