MySQL  8.0.19
Source Code Documentation
event_reader.h
Go to the documentation of this file.
1 /* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
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 event_reader.h
28 
29  @brief Contains the class responsible for deserializing fields of an event
30  previously stored in a buffer.
31 */
32 
33 #ifndef EVENT_READER_INCLUDED
34 #define EVENT_READER_INCLUDED
35 
36 #include <list>
37 #include <map>
38 #include <vector>
39 #include "byteorder.h"
40 #include "wrapper_functions.h"
41 
42 namespace binary_log {
43 
44 #define PRINT_READER_STATUS(message) \
45  BAPI_PRINT("debug", (message ": m_buffer= %p, " \
46  "m_limit= %llu, " \
47  "m_length= %llu, " \
48  "position()= %llu", \
49  m_buffer, m_limit, m_length, Event_reader::position()))
50 
51 /**
52  Event_reader class purpose is to avoid out-of-buffer reads when deserializing
53  binary log events and increase robustness when dealing with corrupted event
54  buffers.
55 
56  The Event_reader is composed by a pointer to the beginning of the serialized
57  event buffer (m_buffer), a variable containing the buffer length (m_length), a
58  cursor pointer that tells the current position to be read from the buffer
59  (m_ptr) and the buffer limit the reader shall respect (m_limit <= m_length).
60 
61  All buffer reading functions shall move the cursor forward.
62 
63  Before reading from the buffer, the Event_reader will check if the amount of
64  bytes expected to be read are less or equal to the remaining bytes to read:
65 
66  remaining = m_limit - (m_ptr - m_buffer)
67 
68  When there are no enough bytes to read from the buffer, Event_reader enters
69  in error state, so its owner can take an action.
70 */
71 
72 class Event_reader {
73  public:
74  /**
75  Event_reader constructor.
76 
77  It sets the cursor to the first position of the buffer.
78 
79  @param[in] buffer buffer holding a serialized event
80  @param[in] length known buffer length.
81  */
82  Event_reader(const char *buffer, unsigned long long length)
83  : m_buffer(buffer),
84  m_ptr(buffer),
86  m_limit(length),
87  m_error(nullptr) {}
88 
89  /**
90  Returns if the Event_reader is in an error state or not.
91 
92  @retval true if the Event_reader is in error state.
93  @retval false if the Event_reader is not in error state.
94  */
95  bool has_error() {
96  BAPI_PRINT("debug", ("m_error= %s", m_error ? m_error : "nullptr"));
97  return m_error != nullptr;
98  }
99 
100  /**
101  Returns the pointer to the error message.
102 
103  @return the pointer to the error message when Event_reader is in error
104  state, or a nullptr otherwise.
105  */
106  const char *get_error() { return m_error; }
107 
108  /**
109  Sets Event_reader error state by setting the error message.
110 
111  @param[in] error pointer to the error message.
112  */
113  void set_error(const char *error);
114 
115  /**
116  Returns the Event_reader buffer length.
117 
118  Note: the buffer length might be larger than reader allowed buffer limit,
119  but the Event_reader will enter error state when trying to read above the
120  limit.
121 
122  Example: an event buffer may contain the serialized event + checksum. The
123  event reader object will be configured with a buffer length that contains
124  both the serialized event and the checksum information, but once
125  Log_event_footer is instantiated, it shall adjust the event reader buffer
126  limit to the buffer position right before the checksum. This will avoid some
127  event deserialization relying on event buffer size to assume the checksum as
128  serialized event content.
129 
130  @return the Event_reader buffer length.
131  */
132  unsigned long long length() { return (m_length); }
133 
134  /**
135  Sets Event_reader buffer length and limit.
136 
137  The length of the buffer should only be set to values greater or equal to
138  the current buffer length. Trying to set the length to less than current
139  buffer length will make the Event_buffer to enter error state.
140 
141  The length is initially set in Event_reader constructor to
142  LOG_EVENT_MINIMAL_HEADER_LEN by the Log_event_header when instantiating it.
143  This should be enough to read the event header and determine the correct
144  buffer length. The Log_event_header will adjust the Event_reader length by
145  calling this function based on the value of event data_written header field.
146 
147  @param[in] length the new Event_reader buffer length.
148  */
149  void set_length(unsigned long long length);
150 
151  /**
152  Shrinks the Event_reader buffer limit.
153 
154  This function is used by Log_event_footer to remove the checksum payload (if
155  necessary) from the serialized event size, as many event types rely on the
156  serialized event size to determine the size of some fields.
157 
158  @param[in] bytes the amount of bytes to shrink the Event_reader buffer
159  length.
160  */
161  void shrink_limit(unsigned long long bytes);
162 
163  /**
164  Returns the Event_reader buffer pointer.
165 
166  @return the Event_reader buffer pointer.
167  */
168  const char *buffer() { return m_buffer; }
169 
170  /**
171  Returns a pointer to the Event_reader cursor (next position to be read by
172  the Event_reader functions).
173 
174  @return the pointer to the Event_reader cursor.
175  */
176  const char *ptr() { return m_ptr; }
177 
178  /**
179  Returns a pointer to the Event_reader cursor (next position to be read) and
180  moves the cursor forward.
181 
182  This function is used when the buffer contains a field of a known size and
183  the deserialization procedure must keep the pointer to the field but moving
184  the cursor to after it.
185 
186  @param[in] length the amount of bytes to move the cursor forward.
187 
188  @return the pointer to the Event_reader cursor before forwarding it.
189  */
190  const char *ptr(unsigned long long length);
191 
192  /**
193  Returns the current Event_reader cursor position in bytes.
194 
195  @retval m_limit if cursor position is invalid.
196  @retval position current Event_reader cursor position (if valid).
197  */
198  unsigned long long position() {
199  return m_ptr >= m_buffer ? m_ptr - m_buffer : m_limit;
200  }
201 
202  /**
203  Returns the amount of bytes still available to read from cursor position.
204 
205  @return the amount of bytes still available to read.
206  */
207  unsigned long long available_to_read() {
209  return m_limit - position();
210  }
211 
212  /**
213  Returns if the Event_reader can read a given amount of bytes from cursor
214  position.
215 
216  @param bytes the amount of bytes expected to be read.
217 
218  @retval true if the Event_reader can read the specified amount of bytes.
219  @retval false if the Event_reader cannot read the specified amount of bytes.
220  */
221  bool can_read(unsigned long long bytes) {
222  return (available_to_read() >= bytes);
223  }
224 
225  /**
226  Moves cursor to a given absolute buffer position and returns the pointer to
227  the cursor.
228 
229  @param position the position to jump to.
230 
231  @retval pointer a pointer to the new cursor position.
232  @retval nullptr if the position is out of buffer boundaries.
233  */
234  const char *go_to(unsigned long long position);
235 
236  /**
237  Moves the buffer position forward to a given relative position and returns
238  the pointer to the buffer on the specified position.
239 
240  @param bytes the amount of bytes to move forward.
241 
242  @retval pointer a pointer to the new buffer position.
243  @retval nullptr if the cursor is out of buffer boundaries.
244  */
245  const char *forward(unsigned long long bytes) {
246  BAPI_PRINT("debug", ("Event_reader::forward(%llu)", bytes));
247  return go_to((m_ptr - m_buffer) + bytes);
248  }
249 
250  /**
251  Reads a basic type - bool, char, int, long, double, etc - from the buffer,
252  moves the cursor forward the number of bytes returned by sizeof(T)) and
253  returns the read value.
254 
255  @retval value the T read from the cursor position.
256  @retval 0 if the cursor was out of buffer boundaries.
257  */
258  template <class T>
259  T read() {
260  PRINT_READER_STATUS("Event_reader::read");
261  if (!can_read(sizeof(T))) {
262  set_error("Cannot read from out of buffer bounds");
263  BAPI_PRINT("debug", ("Event_reader::tread(): "
264  "sizeof()= %zu",
265  sizeof(T)));
266  return 0;
267  }
268  T value = 0;
269  value = (T) * (m_ptr);
270  m_ptr = m_ptr + sizeof(T);
271  return value;
272  }
273 
274  /**
275  Copies a basic type - bool, char, int, long, double, etc - from the buffer,
276  moves the cursor forward the number of bytes returned by sizeof(T)) and
277  returns the copied value.
278 
279  @retval value the T copied from the cursor position.
280  @retval 0 if the cursor was out of buffer boundaries.
281  */
282  template <class T>
283  T memcpy() {
284  PRINT_READER_STATUS("Event_reader::memcpy");
285  if (!can_read(sizeof(T))) {
286  set_error("Cannot read from out of buffer bounds");
287  BAPI_PRINT("debug", ("Event_reader::memcpy(): "
288  "sizeof()= %zu",
289  sizeof(T)));
290  return 0;
291  }
292  T value = 0;
293  ::memcpy((char *)&value, m_ptr, sizeof(T));
294  m_ptr = m_ptr + sizeof(T);
295  return value;
296  }
297 
298  /**
299  Copies a basic arithmetic type - uint8_t, [u]int16_t, [u]int32_t,
300  [u]int64_t - from the buffer, moves the cursor forward using specified bytes
301  parameter (or the number of bytes returned by sizeof(T) when not specified)
302  and returns the copied value transformed from little endian if necessary).
303 
304  @param[in] bytes the amount of bytes to read from the buffer (and to move
305  forward). When not specified, will use sizeof(T).
306 
307  @retval value the T copied from the cursor position.
308  @retval 0 if the cursor was out of buffer boundaries or there was no memory
309  to allocate to the new string..
310  */
311  template <typename T>
312  T read_and_letoh(unsigned char bytes = sizeof(T)) {
313  PRINT_READER_STATUS("Event_reader::read_and_letoh");
314  if (!can_read(bytes)) {
315  set_error("Cannot read from out of buffer bounds");
316  BAPI_PRINT("debug", ("Event_reader::read_and_letoh(): "
317  "sizeof()= %zu, bytes= %u",
318  sizeof(T), bytes));
319  return 0;
320  }
321  T value = 0;
322  ::memcpy((char *)&value, m_ptr, bytes);
323  m_ptr = m_ptr + bytes;
324  return letoh(value);
325  }
326 
327  /**
328  Returns a pointer to a new string which is a duplicate of the input string.
329  The terminating null character is added. See: bapi_strndup().
330 
331  @param[in] length the amount of bytes to read from the buffer (and to move
332  forward).
333 
334  @retval pointer the T pointer from the cursor position.
335  @retval nullptr if the cursor was out of buffer boundaries.
336  */
337  template <typename T>
338  T strndup(size_t length) {
339  PRINT_READER_STATUS("Event_reader::strndup");
340  if (!can_read(length)) {
341  BAPI_PRINT("debug", ("Event_reader::strndup(%zu)", length));
342  set_error("Cannot read from out of buffer bounds");
343  return nullptr;
344  }
345  T str;
346  str = reinterpret_cast<T>(bapi_strndup(m_ptr, length));
347  m_ptr = m_ptr + length;
348  return str;
349  }
350 
351  /**
352  Copies from the cursor to an already existent (and allocated) buffer and
353  moves forward the cursor.
354 
355  @param[out] destination a pointer to the destination buffer.
356  @param[in] length the amount of bytes to read from the buffer (and to move
357  forward).
358  */
359  template <typename T>
360  void memcpy(T destination, size_t length) {
361  PRINT_READER_STATUS("Event_reader::memcpy");
362  if (!can_read(length)) {
363  BAPI_PRINT("debug", ("Event_reader::memcpy(%zu)", length));
364  set_error("Cannot read from out of buffer bounds");
365  return;
366  }
367  ::memcpy(destination, m_ptr, length);
368  m_ptr = m_ptr + length;
369  }
370 
371  /**
372  Allocates memory to a destination buffer, copies from the cursor to the
373  destination buffer using memcpy() and moves forward the cursor.
374 
375  This function is useful for pairs of fields when a first field describes the
376  second field size and the deserialization procedure must allocate a buffer
377  for the second field and then copy the event buffer content to the new
378  allocated buffer.
379 
380  Before implementing this function and the Event_reader, the deserialization
381  process did like:
382 
383  memcpy(length, ptr, sizeof(length);
384  ptr+=sizeof(length);
385  field = malloc(length);
386  memcpy(field, ptr, length);
387 
388  Allocating the memory for the field before knowing if the content can be
389  read from the event buffer is a mistake, as it might allocate a very large
390  amount of memory that will not be used.
391 
392  So, alloc_and_memcpy ensures that it will only allocate memory for the field
393  if it can be read from the event buffer, avoiding allocating a memory that
394  will not be used.
395 
396  @param[out] destination the destination buffer.
397  @param[in] length the amount of bytes to allocate and read from the buffer
398  (and to move forward).
399  @param[in] flags flags to pass to MySQL server my_malloc() function.
400  */
401  void alloc_and_memcpy(unsigned char **destination, size_t length, int flags);
402 
403  /**
404  Allocates memory to a destination buffer, copies from the cursor to the
405  destination buffer using strncpy() and moves forward the cursor.
406 
407  See comments on alloc_and_memcpy() for more details.
408 
409  @param[out] destination the destination buffer.
410  @param[in] length the amount of bytes to allocate and read from the buffer
411  (and to forward).
412  @param[in] flags flags to pass to MySQL server my_malloc() function.
413  */
414  void alloc_and_strncpy(char **destination, size_t length, int flags);
415 
416  /**
417  Reads string from cursor.
418 
419  Reads in the following format:
420  1) Reads length stored on cursor first index. Moves cursor forward 1 byte.
421  2) Set destination pointer to the cursor. Moves cursor forward length bytes.
422 
423  @param[out] destination the destination pointer.
424  @param[out] length the amount of bytes to allocate and read from the buffer
425  (and to move forward).
426  */
427  void read_str_at_most_255_bytes(const char **destination, uint8_t *length);
428 
429  /**
430  Reads a packed value.
431 
432  This function can move the cursor forward by 1, 3, 4 or 9 bytes depending on
433  the value to be returned.
434 
435  @return the packed value.
436  */
437  uint64_t net_field_length_ll();
438 
439  /**
440  Reads a transaction context data set.
441 
442  @param[in] set_len length of the set object (and to move forward).
443  @param[out] set pointer to the set object to be filled.
444  */
445  void read_data_set(uint32_t set_len, std::list<const char *> *set);
446 
447  /**
448  Reads a view change certification map.
449 
450  @param[in] map_len the length of the certification info map (and to move
451  forward).
452  @param[out] map the certification info map to be filled.
453  */
454  void read_data_map(uint32_t map_len, std::map<std::string, std::string> *map);
455 
456  /**
457  Copy a string into the destination buffer up to a max length.
458 
459  @param[out] destination the destination buffer.
460  @param[in] max_length the max length to copy from the cursor.
461  @param[in] dest_length the max length supported by the destination buffer.
462  */
463  void strncpyz(char *destination, size_t max_length, size_t dest_length);
464 
465  /**
466  Fills a vector with a sequence of bytes from the cursor.
467 
468  @param[out] destination the vector be filled.
469  @param[in] length the amount of bytes to read from the cursor (and to move
470  forward).
471  */
472  void assign(std::vector<uint8_t> *destination, size_t length);
473 
474  private:
475  /* The buffer with the serialized binary log event */
476  const char *m_buffer;
477  /* The cursor: a pointer to the current read position in the buffer */
478  const char *m_ptr;
479  /* The length of the buffer */
480  unsigned long long m_length;
481  /* The limit the reader shall respect when reading from the buffer */
482  unsigned long long m_limit;
483  /* The pointer to the current error message, or nullptr */
484  const char *m_error;
485 
486  /**
487  Wrapper to le16toh to be used by read_and_letoh function.
488 
489  @param[in] value the value to be converted.
490 
491  @return the converted value.
492  */
493  uint16_t letoh(uint16_t value) { return le16toh(value); }
494 
495  /**
496  Wrapper to le32toh to be used by read_and_letoh function.
497 
498  @param[in] value the value to be converted.
499 
500  @return the converted value.
501  */
502  int32_t letoh(int32_t value) { return le32toh(value); }
503 
504  /**
505  Wrapper to le32toh to be used by read_and_letoh function.
506 
507  @param[in] value the value to be converted.
508 
509  @return the converted value.
510  */
511  uint32_t letoh(uint32_t value) { return le32toh(value); }
512 
513  /**
514  Wrapper to le64toh to be used by read_and_letoh function.
515 
516  @param[in] value the value to be converted.
517 
518  @return the converted value.
519  */
520  int64_t letoh(int64_t value) { return le64toh(value); }
521 
522  /**
523  Wrapper to le64toh to be used by read_and_letoh function.
524 
525  @param[in] value the value to be converted.
526 
527  @return the converted value.
528  */
529  uint64_t letoh(uint64_t value) { return le64toh(value); }
530 };
531 } // end namespace binary_log
532 /**
533  @} (end of group Replication)
534 */
535 #endif /* EVENT_READER_INCLUDED */
binary_log::Event_reader::letoh
int64_t letoh(int64_t value)
Wrapper to le64toh to be used by read_and_letoh function.
Definition: event_reader.h:520
le32toh
uint32_t le32toh(uint32_t x)
Converting a 32 bit integer from little-endian byte order to host byteorder.
Definition: byteorder.h:76
wrapper_functions.h
Contains wrapper functions for memory allocation and deallocation. This includes generic functions to...
binary_log::Event_reader::read_data_set
void read_data_set(uint32_t set_len, std::list< const char * > *set)
Reads a transaction context data set.
Definition: event_reader.cpp:159
binary_log::Event_reader::available_to_read
unsigned long long available_to_read()
Returns the amount of bytes still available to read from cursor position.
Definition: event_reader.h:207
le16toh
uint16_t le16toh(uint16_t x)
Converting a 16 bit integer from little-endian byte order to host byteorder.
Definition: byteorder.h:60
binary_log::Event_reader::length
unsigned long long length()
Returns the Event_reader buffer length.
Definition: event_reader.h:132
binary_log::Event_reader::memcpy
T memcpy()
Copies a basic type - bool, char, int, long, double, etc - from the buffer, moves the cursor forward ...
Definition: event_reader.h:283
le64toh
uint64_t le64toh(uint64_t x)
Converting a 64 bit integer from little-endian byte order to host byteorder.
Definition: byteorder.h:110
binary_log::Event_reader::letoh
int32_t letoh(int32_t value)
Wrapper to le32toh to be used by read_and_letoh function.
Definition: event_reader.h:502
binary_log::Event_reader::can_read
bool can_read(unsigned long long bytes)
Returns if the Event_reader can read a given amount of bytes from cursor position.
Definition: event_reader.h:221
binary_log::Event_reader::m_ptr
const char * m_ptr
Definition: event_reader.h:478
binary_log::Event_reader::strncpyz
void strncpyz(char *destination, size_t max_length, size_t dest_length)
Copy a string into the destination buffer up to a max length.
Definition: event_reader.cpp:199
binary_log::Event_reader::Event_reader
Event_reader(const char *buffer, unsigned long long length)
Event_reader constructor.
Definition: event_reader.h:82
value
const string value("\"Value\"")
binary_log::Event_reader
Event_reader class purpose is to avoid out-of-buffer reads when deserializing binary log events and i...
Definition: event_reader.h:72
binary_log::Event_reader::set_length
void set_length(unsigned long long length)
Sets Event_reader buffer length and limit.
Definition: event_reader.cpp:35
binary_log::Event_reader::m_buffer
const char * m_buffer
Definition: event_reader.h:476
bapi_strndup
const char * bapi_strndup(const char *destination, size_t n)
This is a wrapper function, and returns a pointer to a new string which is a duplicate of the input s...
Definition: wrapper_functions.h:126
BAPI_PRINT
#define BAPI_PRINT(name, params)
Definition: wrapper_functions.h:62
binary_log::Event_reader::set_error
void set_error(const char *error)
Sets Event_reader error state by setting the error message.
Definition: event_reader.cpp:29
binary_log::Event_reader::get_error
const char * get_error()
Returns the pointer to the error message.
Definition: event_reader.h:106
binary_log::Event_reader::letoh
uint32_t letoh(uint32_t value)
Wrapper to le32toh to be used by read_and_letoh function.
Definition: event_reader.h:511
binary_log::Event_reader::shrink_limit
void shrink_limit(unsigned long long bytes)
Shrinks the Event_reader buffer limit.
Definition: event_reader.cpp:45
binary_log::Event_reader::ptr
const char * ptr()
Returns a pointer to the Event_reader cursor (next position to be read by the Event_reader functions)...
Definition: event_reader.h:176
BAPI_ASSERT
#define BAPI_ASSERT(x)
Definition: wrapper_functions.h:61
binary_log::Event_reader::m_length
unsigned long long m_length
Definition: event_reader.h:480
binary_log::Event_reader::m_error
const char * m_error
Definition: event_reader.h:484
binary_log::Event_reader::alloc_and_memcpy
void alloc_and_memcpy(unsigned char **destination, size_t length, int flags)
Allocates memory to a destination buffer, copies from the cursor to the destination buffer using memc...
Definition: event_reader.cpp:77
binary_log::Event_reader::m_limit
unsigned long long m_limit
Definition: event_reader.h:482
binary_log::Event_reader::assign
void assign(std::vector< uint8_t > *destination, size_t length)
Fills a vector with a sequence of bytes from the cursor.
Definition: event_reader.cpp:213
binary_log::Event_reader::read_str_at_most_255_bytes
void read_str_at_most_255_bytes(const char **destination, uint8_t *length)
Reads string from cursor.
Definition: event_reader.cpp:116
binary_log::Event_reader::alloc_and_strncpy
void alloc_and_strncpy(char **destination, size_t length, int flags)
Allocates memory to a destination buffer, copies from the cursor to the destination buffer using strn...
Definition: event_reader.cpp:96
binary_log::Event_reader::read
T read()
Reads a basic type - bool, char, int, long, double, etc - from the buffer, moves the cursor forward t...
Definition: event_reader.h:259
binary_log::Event_reader::has_error
bool has_error()
Returns if the Event_reader is in an error state or not.
Definition: event_reader.h:95
binary_log
set
void set(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1)
Definition: suite_stubs.c:105
binary_log::Event_reader::position
unsigned long long position()
Returns the current Event_reader cursor position in bytes.
Definition: event_reader.h:198
byteorder.h
The file contains functions to convert the byte encoding of integer values to and from little-endian ...
binary_log::Event_reader::letoh
uint16_t letoh(uint16_t value)
Wrapper to le16toh to be used by read_and_letoh function.
Definition: event_reader.h:493
binary_log::Event_reader::net_field_length_ll
uint64_t net_field_length_ll()
Reads a packed value.
Definition: event_reader.cpp:136
binary_log::Event_reader::read_data_map
void read_data_map(uint32_t map_len, std::map< std::string, std::string > *map)
Reads a view change certification map.
Definition: event_reader.cpp:172
binary_log::Event_reader::read_and_letoh
T read_and_letoh(unsigned char bytes=sizeof(T))
Copies a basic arithmetic type - uint8_t, [u]int16_t, [u]int32_t, [u]int64_t - from the buffer,...
Definition: event_reader.h:312
binary_log::Event_reader::memcpy
void memcpy(T destination, size_t length)
Copies from the cursor to an already existent (and allocated) buffer and moves forward the cursor.
Definition: event_reader.h:360
binary_log::Event_reader::strndup
T strndup(size_t length)
Returns a pointer to a new string which is a duplicate of the input string.
Definition: event_reader.h:338
binary_log::Event_reader::forward
const char * forward(unsigned long long bytes)
Moves the buffer position forward to a given relative position and returns the pointer to the buffer ...
Definition: event_reader.h:245
binary_log::Event_reader::letoh
uint64_t letoh(uint64_t value)
Wrapper to le64toh to be used by read_and_letoh function.
Definition: event_reader.h:529
binary_log::Event_reader::buffer
const char * buffer()
Returns the Event_reader buffer pointer.
Definition: event_reader.h:168
binary_log::Event_reader::go_to
const char * go_to(unsigned long long position)
Moves cursor to a given absolute buffer position and returns the pointer to the cursor.
Definition: event_reader.cpp:66
flags
static int flags[50]
Definition: hp_test1.cc:39
PRINT_READER_STATUS
#define PRINT_READER_STATUS(message)
Definition: event_reader.h:44