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