MySQL 8.4.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 };
573
574 /**
575 Metadata_fields organizes m_optional_metadata into a structured format which
576 is easy to access.
577 */
579 typedef std::pair<unsigned int, unsigned int> uint_pair;
580 typedef std::vector<std::string> str_vector;
581
584 bool empty() const { return default_charset == 0; }
585
586 // Default charset for the columns which are not in charset_pairs.
587 unsigned int default_charset;
588
589 /* The uint_pair means <column index, column charset number>. */
590 std::vector<uint_pair> charset_pairs;
591 };
592
593 // Contents of DEFAULT_CHARSET field are converted into Default_charset.
595 // Contents of ENUM_AND_SET_DEFAULT_CHARSET are converted into
596 // Default_charset.
598 std::vector<bool> m_signedness;
599 // Character set number of every string column
600 std::vector<unsigned int> m_column_charset;
601 // Character set number of every ENUM or SET column.
602 std::vector<unsigned int> m_enum_and_set_column_charset;
603 std::vector<std::string> m_column_name;
604 // each str_vector stores values of one enum/set column
605 std::vector<str_vector> m_enum_str_value;
606 std::vector<str_vector> m_set_str_value;
607 std::vector<unsigned int> m_geometry_type;
608 /*
609 The uint_pair means <column index, prefix length>. Prefix length is 0 if
610 whole column value is used.
611 */
612 std::vector<uint_pair> m_primary_key;
613 std::vector<bool> m_column_visibility;
614
615 /*
616 It parses m_optional_metadata and populates into above variables.
617
618 @param[in] optional_metadata points to the begin of optional metadata
619 fields in table_map_event.
620 @param[in] optional_metadata_len length of optional_metadata field.
621 */
622 Optional_metadata_fields(unsigned char *optional_metadata,
623 unsigned int optional_metadata_len);
624 // It is used to specify the validity of the deserialized structure
626 };
627
628 /**
629 <pre>
630 The buffer layout for fixed data part is as follows:
631 +-----------------------------------+
632 | table_id | Reserved for future use|
633 +-----------------------------------+
634 </pre>
635
636 <pre>
637 The buffer layout for variable data part is as follows:
638 +--------------------------------------------------------------------------+
639 | db len| db name | table len| table name | no of cols | array of col types|
640 +--------------------------------------------------------------------------+
641 +---------------------------------------------+
642 | metadata len | metadata block | m_null_bits |
643 +---------------------------------------------+
644 </pre>
645
646 @param buf Contains the serialized event.
647 @param fde An FDE event (see Rotate_event constructor for more info).
648 */
649 Table_map_event(const char *buf, const Format_description_event *fde);
650
651 Table_map_event(const Table_id &tid, unsigned long colcnt, const char *dbnam,
652 size_t dblen, const char *tblnam, size_t tbllen)
654 m_table_id(tid),
655 m_data_size(0),
656 m_dbnam(""),
657 m_dblen(dblen),
658 m_tblnam(""),
659 m_tbllen(tbllen),
660 m_colcnt(colcnt),
666 if (dbnam) m_dbnam = std::string(dbnam, m_dblen);
667 if (tblnam) m_tblnam = std::string(tblnam, m_tbllen);
668 }
669
670 ~Table_map_event() override;
671
672 /** Event post header contents */
675
676 size_t m_data_size; /** event data size */
677
678 /** Event body contents */
679 std::string m_dbnam;
680 unsigned long long int m_dblen;
681 std::string m_tblnam;
682 unsigned long long int m_tbllen;
683 unsigned long m_colcnt;
684 unsigned char *m_coltype;
685
686 /**
687 The size of field metadata buffer set by calling save_field_metadata()
688 */
690 unsigned char *m_field_metadata; /** field metadata */
691 unsigned char *m_null_bits;
693 unsigned char *m_optional_metadata;
694
703
704 unsigned long long get_table_id() { return m_table_id.id(); }
705 std::string get_table_name() { return m_tblnam; }
706 std::string get_db_name() { return m_dbnam; }
707
708#ifndef HAVE_MYSYS
709 void print_event_info(std::ostream &info) override;
710 void print_long_info(std::ostream &info) override;
711#endif
712};
713
714/**
715 @class Rows_event
716
717 Common base class for all row-containing binary log events.
718
719 RESPONSIBILITIES
720
721 - Provide an interface for adding an individual row to the event.
722
723 @section Rows_event_binary_format Binary Format
724
725 The Post-Header has the following components:
726
727 <table>
728 <caption>Post-Header for Rows_event</caption>
729
730 <tr>
731 <th>Name</th>
732 <th>Format</th>
733 <th>Description</th>
734 </tr>
735
736 <tr>
737 <td>table_id</td>
738 <td>6 bytes unsigned integer</td>
739 <td>The number that identifies the table</td>
740 </tr>
741
742 <tr>
743 <td>flags</td>
744 <td>2 byte bitfield</td>
745 <td>Reserved for future use; currently always 0.</td>
746 </tr>
747
748 </table>
749
750 The Body has the following components:
751
752 <table>
753 <caption>Body for Rows_event</caption>
754
755 <tr>
756 <th>Name</th>
757 <th>Format</th>
758 <th>Description</th>
759 </tr>
760
761
762 <tr>
763 <td>width</td>
764 <td>packed integer</td>
765 <td>Represents the number of columns in the table</td>
766 </tr>
767
768 <tr>
769 <td>cols</td>
770 <td>Bitfield, variable sized</td>
771 <td>Indicates whether each column is used, one bit per column.
772 For this field, the amount of storage required is
773 INT((width + 7) / 8) bytes. </td>
774 </tr>
775
776 <tr>
777 <td>extra_row_info</td>
778 <td>An object of class Extra_row_info</td>
779 <td>The class Extra_row_info will be storing the information related
780 to m_extra_row_ndb_info and partition info (partition_id and
781 source_partition_id). At any given time a Rows_event can have both, one
782 or none of ndb_info and partition_info present as part of Rows_event.
783 In case both ndb_info and partition_info are present then below will
784 be the order in which they will be stored.
785
786 @verbatim
787 +----------+--------------------------------------+
788 |type_code | extra_row_ndb_info |
789 +--- ------+--------------------------------------+
790 | NDB |Len of ndb_info |Format |ndb_data |
791 | 1 byte |1 byte |1 byte |len - 2 byte |
792 +----------+----------------+-------+-------------+
793
794 In case of INSERT/DELETE
795 +-----------+----------------+
796 | type_code | partition_info |
797 +-----------+----------------+
798 | PART | partition_id |
799 | (1 byte) | 2 byte |
800 +-----------+----------------+
801
802 In case of UPDATE
803 +-----------+------------------------------------+
804 | type_code | partition_info |
805 +-----------+--------------+---------------------+
806 | PART | partition_id | source_partition_id |
807 | (1 byte) | 2 byte | 2 byte |
808 +-----------+--------------+---------------------+
809
810 source_partition_id is used only in the case of Update_event
811 to log the partition_id of the source partition.
812
813 @endverbatim
814 This is the format for any information stored as extra_row_info.
815 type_code is not a part of the class Extra_row_info as it is a constant
816 values used at the time of serializing and decoding the event.
817 </td>
818 </tr>
819
820 <tr>
821 <td>columns_before_image</td>
822 <td>vector of elements of type uint8_t</td>
823 <td>For DELETE and UPDATE only.
824 Bit-field indicating whether each column is used
825 one bit per column. For this field, the amount of storage
826 required for N columns is INT((N + 7) / 8) bytes.</td>
827 </tr>
828
829 <tr>
830 <td>columns_after_image</td>
831 <td>vector of elements of type uint8_t</td>
832 <td>For WRITE and UPDATE only.
833 Bit-field indicating whether each column is used in the
834 UPDATE_ROWS_EVENT and WRITE_ROWS_EVENT after-image; one bit per column.
835 For this field, the amount of storage required for N columns
836 is INT((N + 7) / 8) bytes.
837
838 @verbatim
839 +-------------------------------------------------------+
840 | Event Type | Cols_before_image | Cols_after_image |
841 +-------------------------------------------------------+
842 | DELETE | Deleted row | NULL |
843 | INSERT | NULL | Inserted row |
844 | UPDATE | Old row | Updated row |
845 +-------------------------------------------------------+
846 @endverbatim
847 </td>
848 </tr>
849
850 <tr>
851 <td>row</td>
852 <td>vector of elements of type uint8_t</td>
853 <td> A sequence of zero or more rows. The end is determined by the size
854 of the event. Each row has the following format:
855 - A Bit-field indicating whether each field in the row is NULL.
856 Only columns that are "used" according to the second field in
857 the variable data part are listed here. If the second field in
858 the variable data part has N one-bits, the amount of storage
859 required for this field is INT((N + 7) / 8) bytes.
860 - The row-image, containing values of all table fields. This only
861 lists table fields that are used (according to the second field
862 of the variable data part) and non-NULL (according to the
863 previous field). In other words, the number of values listed here
864 is equal to the number of zero bits in the previous field.
865 (not counting padding bits in the last byte).
866 @verbatim
867 For example, if a INSERT statement inserts into 4 columns of a
868 table, N= 4 (in the formula above).
869 length of bitmask= (4 + 7) / 8 = 1
870 Number of fields in the row= 4.
871
872 +------------------------------------------------+
873 |Null_bit_mask(4)|field-1|field-2|field-3|field 4|
874 +------------------------------------------------+
875 @endverbatim
876 </td>
877 </tr>
878 </table>
879*/
881 public:
882 /**
883 These definitions allow to combine the flags into an
884 appropriate flag set using the normal bitwise operators. The
885 implicit conversion from an enum-constant to an integer is
886 accepted by the compiler, which is then used to set the real set
887 of flags.
888 */
890 /** Last event of a statement */
891 STMT_END_F = (1U << 0),
892 /** Value of the OPTION_NO_FOREIGN_KEY_CHECKS flag in thd->options */
894 /** Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options */
896 /**
897 Indicates that rows in this event are complete, that is contain
898 values for all columns of the table.
899 */
900 COMPLETE_ROWS_F = (1U << 3),
901 /**
902 Flags for everything. Please update when you add new flags.
903 */
906 };
907
908 /**
909 Constructs an event directly. The members are assigned default values.
910
911 @param type_arg Type of ROW_EVENT. Expected types are:
912 - WRITE_ROWS_EVENT
913 - UPDATE_ROWS_EVENT, PARTIAL_UPDATE_ROWS_EVENT
914 - DELETE_ROWS_EVENT
915 */
916 explicit Rows_event(Log_event_type type_arg)
917 : Binary_log_event(type_arg),
918 m_table_id(0),
919 m_width(0),
922 row(0) {}
923 /**
924 The constructor is responsible for decoding the event contained in
925 the buffer.
926
927 <pre>
928 The buffer layout for fixed data part is as follows
929 +------------------------------------+
930 | table_id | reserved for future use |
931 +------------------------------------+
932 </pre>
933
934 <pre>
935 The buffer layout for variable data part is as follows
936 +------------------------------------------------------------------+
937 | var_header_len | column_before_image | columns_after_image | row |
938 +------------------------------------------------------------------+
939 </pre>
940
941 @param buf Contains the serialized event.
942 @param fde An FDE event (see Rotate_event constructor for more info).
943 */
944 Rows_event(const char *buf, const Format_description_event *fde);
945
946 ~Rows_event() override;
947
948 protected:
949 Log_event_type m_type; /** Actual event type */
950
951 /** Post header content */
953 uint16_t m_flags; /** Flags for row-level events */
954
955 /* Body of the event */
956 unsigned long m_width; /** The width of the columns bitmap */
957 uint32_t n_bits_len; /** value determined by (m_width + 7) / 8 */
959
960 std::vector<uint8_t> columns_before_image;
961 std::vector<uint8_t> columns_after_image;
962 std::vector<uint8_t> row;
963
964 public:
966 private:
967 /** partition_id for a row in a partitioned table */
969 /**
970 It is the partition_id of the source partition in case
971 of Update_event, the target's partition_id is m_partition_id.
972 This variable is used only in case of Update_event.
973 */
975 /** The extra row info provided by NDB */
976 unsigned char *m_extra_row_ndb_info;
977
978 public:
983
985
986 int get_partition_id() const { return m_partition_id; }
987 void set_partition_id(int partition_id) {
988 BAPI_ASSERT(partition_id <= 65535);
989 m_partition_id = partition_id;
990 }
991
993 void set_source_partition_id(int source_partition_id) {
994 BAPI_ASSERT(source_partition_id <= 65535);
995 m_source_partition_id = source_partition_id;
996 }
997
998 unsigned char *get_ndb_info() const { return m_extra_row_ndb_info; }
999 void set_ndb_info(const unsigned char *ndb_info, size_t len) {
1002 static_cast<unsigned char *>(bapi_malloc(len, 16 /* flags */));
1003 std::copy(ndb_info, ndb_info + len, m_extra_row_ndb_info);
1004 }
1005 /**
1006 Compares the extra_row_info in a Row event, it checks three things
1007 1. The m_extra_row_ndb_info pointers. It compares their significant bytes.
1008 2. Partition_id
1009 3. source_partition_id
1010
1011 @return
1012 true all the above variables are same in the event and the one passed
1013 in parameter.
1014 false Any of the above variable has a different value.
1015 */
1016 bool compare_extra_row_info(const unsigned char *ndb_info_arg,
1017 int part_id_arg, int source_part_id);
1018
1019 bool have_part() const { return m_partition_id != UNDEFINED; }
1020
1021 bool have_ndb_info() const { return m_extra_row_ndb_info != nullptr; }
1022 size_t get_ndb_length();
1023 size_t get_part_length();
1025
1026 static const int UNDEFINED{INT_MAX};
1027 };
1029
1030 unsigned long long get_table_id() const { return m_table_id.id(); }
1031
1032 enum_flag get_flags() const { return static_cast<enum_flag>(m_flags); }
1033
1034 uint32_t get_null_bits_len() const { return n_bits_len; }
1035
1036 unsigned long get_width() const { return m_width; }
1037
1038 /**
1039 @brief Gets the flags listed as strings. If there are no flags set, returns
1040 an empty string.
1041
1042 @return A string with the names of the flags set. If no flag is set, returns
1043 an empty string.
1044 */
1045 std::string get_enum_flag_string() const {
1048 if (!m_flags) return "";
1049 std::stringstream ss;
1050 ss << " flags:";
1051 if (m_flags & STMT_END_F) ss << " STMT_END_F";
1052 if (m_flags & NO_FOREIGN_KEY_CHECKS_F) ss << " NO_FOREIGN_KEY_CHECKS_F";
1053 if (m_flags & RELAXED_UNIQUE_CHECKS_F) ss << " RELAXED_UNIQUE_CHECKS_F";
1054 if (m_flags & COMPLETE_ROWS_F) ss << " COMPLETE_ROWS_F";
1055 if (m_flags & ~ALL_FLAGS) {
1056 assert(false);
1057 auto unknown_flags = m_flags & ~ALL_FLAGS;
1058 ss << " UNKNOWN_FLAG(" << std::hex << "0x" << unknown_flags << ")";
1059 }
1060 return ss.str();
1061 }
1062
1063 /**
1064 Gets a string describing the flags.
1065
1066 @param flag A set of flags to get the description for.
1067 @return a string describing the flags.
1068 */
1069 static std::string get_flag_string(enum_flag flag) {
1072 std::string str = "";
1073 if (flag & STMT_END_F) str.append(" Last event of the statement");
1074 if (flag & NO_FOREIGN_KEY_CHECKS_F) str.append(" No foreign Key checks");
1075 if (flag & RELAXED_UNIQUE_CHECKS_F) str.append(" No unique key checks");
1076 if (flag & COMPLETE_ROWS_F) str.append(" Complete Rows");
1077 if (flag & ~ALL_FLAGS) str.append(" Unknown Flag");
1078 return str;
1079 }
1080#ifndef HAVE_MYSYS
1081 void print_event_info(std::ostream &info) override;
1082 void print_long_info(std::ostream &info) override;
1083#endif
1084
1085 template <class Iterator_value_type>
1087};
1088
1089/**
1090 @class Write_rows_event
1091
1092 Log row insertions. The event contain several insert/update rows
1093 for a table. Note that each event contains only rows for one table.
1094
1095 @section Write_rows_event_binary_format Binary Format
1096*/
1097class Write_rows_event : public virtual Rows_event {
1098 public:
1099 Write_rows_event(const char *buf, const Format_description_event *fde);
1101};
1102
1103/**
1104 @class Update_rows_event
1105
1106 Log row updates with a before image. The event contain several
1107 update rows for a table. Note that each event contains only rows for
1108 one table.
1109
1110 Also note that the row data consists of pairs of row data: one row
1111 for the old data and one row for the new data.
1112
1113 @section Update_rows_event_binary_format Binary Format
1114*/
1115class Update_rows_event : public virtual Rows_event {
1116 public:
1117 Update_rows_event(const char *buf, const Format_description_event *fde);
1118 Update_rows_event(Log_event_type event_type) : Rows_event(event_type) {}
1119};
1120
1121/**
1122 @class Delete_rows_event
1123
1124 Log row deletions. The event contain several delete rows for a
1125 table. Note that each event contains only rows for one table.
1126
1127 RESPONSIBILITIES
1128
1129 - Act as a container for rows that has been deleted on the master
1130 and should be deleted on the slave.
1131
1132 @section Delete_rows_event_binary_format Binary Format
1133*/
1134class Delete_rows_event : public virtual Rows_event {
1135 public:
1136 Delete_rows_event(const char *buf, const Format_description_event *fde);
1138};
1139
1140/**
1141 @class Rows_query_event
1142
1143 Rows query event type, which is a subclass
1144 of the Ignorable_event, to record the original query for the rows
1145 events in RBR. This event can be used to display the original query as
1146 comments by SHOW BINLOG EVENTS query, or mysqlbinlog client when the
1147 --verbose option is given twice
1148
1149 @section Rows_query_var_event_binary_format Binary Format
1150
1151 The Post-Header for this event type is empty. The Body has one
1152 component:
1153
1154 <table>
1155 <caption>Body for Rows_query_event</caption>
1156
1157 <tr>
1158 <th>Name</th>
1159 <th>Format</th>
1160 <th>Description</th>
1161 </tr>
1162
1163 <tr>
1164 <td>m_rows_query</td>
1165 <td>char array</td>
1166 <td>Records the original query executed in RBR </td>
1167 </tr>
1168 </table>
1169*/
1170class Rows_query_event : public virtual Ignorable_event {
1171 public:
1172 /**
1173 It is used to write the original query in the binlog file in case of RBR
1174 when the session flag binlog_rows_query_log_events is set.
1175
1176 <pre>
1177 The buffer layout is as follows:
1178 +------------------------------------+
1179 | The original query executed in RBR |
1180 +------------------------------------+
1181 </pre>
1182
1183 @param buf Contains the serialized event.
1184 @param fde An FDE event (see Rotate_event constructor for more info).
1185 */
1186
1187 Rows_query_event(const char *buf, const Format_description_event *fde);
1188 /**
1189 It is the minimal constructor, and all it will do is set the type_code as
1190 ROWS_QUERY_LOG_EVENT in the header object in Binary_log_event.
1191 */
1194
1195 ~Rows_query_event() override;
1196
1197 protected:
1199};
1200} // namespace mysql::binlog::event
1201
1202/// @}
1203
1204#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:1134
Delete_rows_event()
Definition: rows_event.h:1137
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:998
int get_partition_id() const
Definition: rows_event.h:986
Extra_row_info()
Definition: rows_event.h:979
int get_source_partition_id() const
Definition: rows_event.h:992
unsigned char * m_extra_row_ndb_info
The extra row info provided by NDB.
Definition: rows_event.h:976
void set_partition_id(int partition_id)
Definition: rows_event.h:987
bool have_part() const
Definition: rows_event.h:1019
static const int UNDEFINED
Definition: rows_event.h:1026
void set_ndb_info(const unsigned char *ndb_info, size_t len)
Definition: rows_event.h:999
~Extra_row_info()
Definition: rows_event.cpp:518
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:486
void set_source_partition_id(int source_partition_id)
Definition: rows_event.h:993
size_t get_part_length()
Definition: rows_event.cpp:509
int m_partition_id
partition_id for a row in a partitioned table
Definition: rows_event.h:968
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:974
size_t get_ndb_length()
Definition: rows_event.cpp:502
Extra_row_info(const Extra_row_info &)=delete
bool have_ndb_info() const
Definition: rows_event.h:1021
Common base class for all row-containing binary log events.
Definition: rows_event.h:880
unsigned long m_width
Flags for row-level events.
Definition: rows_event.h:956
enum_flag
These definitions allow to combine the flags into an appropriate flag set using the normal bitwise op...
Definition: rows_event.h:889
@ STMT_END_F
Last event of a statement.
Definition: rows_event.h:891
@ NO_FOREIGN_KEY_CHECKS_F
Value of the OPTION_NO_FOREIGN_KEY_CHECKS flag in thd->options.
Definition: rows_event.h:893
@ RELAXED_UNIQUE_CHECKS_F
Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options.
Definition: rows_event.h:895
@ ALL_FLAGS
Flags for everything.
Definition: rows_event.h:904
@ 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:900
unsigned long long get_table_id() const
Definition: rows_event.h:1030
std::string get_enum_flag_string() const
Gets the flags listed as strings.
Definition: rows_event.h:1045
Rows_event(Log_event_type type_arg)
Constructs an event directly.
Definition: rows_event.h:916
uint16_t var_header_len
value determined by (m_width + 7) / 8
Definition: rows_event.h:958
uint32_t n_bits_len
The width of the columns bitmap.
Definition: rows_event.h:957
unsigned long get_width() const
Definition: rows_event.h:1036
Table_id m_table_id
Actual event type.
Definition: rows_event.h:952
std::vector< uint8_t > row
Definition: rows_event.h:962
Extra_row_info m_extra_row_info
Definition: rows_event.h:1028
uint32_t get_null_bits_len() const
Definition: rows_event.h:1034
friend class Row_event_iterator
Definition: rows_event.h:1086
enum_flag get_flags() const
Definition: rows_event.h:1032
static std::string get_flag_string(enum_flag flag)
Gets a string describing the flags.
Definition: rows_event.h:1069
Log_event_type m_type
Definition: rows_event.h:949
std::vector< uint8_t > columns_after_image
Definition: rows_event.h:961
uint16_t m_flags
Definition: rows_event.h:953
std::vector< uint8_t > columns_before_image
Definition: rows_event.h:960
Rows query event type, which is a subclass of the Ignorable_event, to record the original query for t...
Definition: rows_event.h:1170
char * m_rows_query
Definition: rows_event.h:1198
~Rows_query_event() override
Definition: rows_event.cpp:549
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:1192
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:684
Table_map_event()
Definition: rows_event.h:695
std::string m_tblnam
Definition: rows_event.h:681
std::string get_table_name()
Definition: rows_event.h:705
uint16_t flag_set
Definition: rows_event.h:534
unsigned char * m_null_bits
field metadata
Definition: rows_event.h:691
unsigned long long get_table_id()
Definition: rows_event.h:704
unsigned long long int m_dblen
Definition: rows_event.h:680
unsigned long long int m_tbllen
Definition: rows_event.h:682
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
@ 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:683
unsigned char * m_field_metadata
Definition: rows_event.h:690
unsigned long m_field_metadata_size
The size of field metadata buffer set by calling save_field_metadata()
Definition: rows_event.h:689
~Table_map_event() override
Definition: rows_event.cpp:106
std::string get_db_name()
Definition: rows_event.h:706
size_t m_data_size
Definition: rows_event.h:676
std::string m_dbnam
event data size
Definition: rows_event.h:679
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:651
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:674
unsigned int m_optional_metadata_len
Definition: rows_event.h:692
Table_id m_table_id
Event post header contents.
Definition: rows_event.h:673
unsigned char * m_optional_metadata
Definition: rows_event.h:693
Log row updates with a before image.
Definition: rows_event.h:1115
Update_rows_event(const char *buf, const Format_description_event *fde)
Definition: rows_event.cpp:562
Update_rows_event(Log_event_type event_type)
Definition: rows_event.h:1118
Log row insertions.
Definition: rows_event.h:1097
Write_rows_event()
Definition: rows_event.h:1100
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:1073
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:590
Metadata_fields organizes m_optional_metadata into a structured format which is easy to access.
Definition: rows_event.h:578
std::vector< str_vector > m_enum_str_value
Definition: rows_event.h:605
std::vector< std::string > m_column_name
Definition: rows_event.h:603
std::vector< uint_pair > m_primary_key
Definition: rows_event.h:612
std::vector< bool > m_column_visibility
Definition: rows_event.h:613
Optional_metadata_fields(unsigned char *optional_metadata, unsigned int optional_metadata_len)
Definition: rows_event.cpp:321
std::vector< str_vector > m_set_str_value
Definition: rows_event.h:606
Default_charset m_default_charset
Definition: rows_event.h:594
Default_charset m_enum_and_set_default_charset
Definition: rows_event.h:597
std::vector< unsigned int > m_column_charset
Definition: rows_event.h:600
std::vector< std::string > str_vector
Definition: rows_event.h:580
std::pair< unsigned int, unsigned int > uint_pair
Definition: rows_event.h:579
std::vector< unsigned int > m_geometry_type
Definition: rows_event.h:607
std::vector< unsigned int > m_enum_and_set_column_charset
Definition: rows_event.h:602
std::vector< bool > m_signedness
Definition: rows_event.h:598
Contains the class Table_id, mainly used for row based replication.
#define BAPI_ASSERT(x)
Definition: wrapper_functions.h:61