16 #ifndef LOG_EVENT_OLD_H
17 #define LOG_EVENT_OLD_H
45 #define ROWS_HEADER_LEN ROWS_HEADER_LEN_V1
83 STMT_END_F = (1
U << 0),
86 NO_FOREIGN_KEY_CHECKS_F = (1
U << 1),
89 RELAXED_UNIQUE_CHECKS_F = (1
U << 2),
98 typedef uint16 flag_set;
108 void set_flags(flag_set flags_arg) { m_flags |= flags_arg; }
109 void clear_flags(flag_set flags_arg) { m_flags &= ~flags_arg; }
110 flag_set get_flags(flag_set flags_arg)
const {
return m_flags & flags_arg; }
112 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
113 virtual int pack_info(
Protocol *protocol);
118 virtual void print(FILE *
file, PRINT_EVENT_INFO *print_event_info)= 0;
122 int add_row_data(uchar *data,
size_t length)
124 return do_add_row_data(data,length);
129 virtual int get_data_size();
131 MY_BITMAP const *get_cols()
const {
return &m_cols; }
132 size_t get_width()
const {
return m_width; }
133 const Table_id& get_table_id()
const {
return m_table_id; }
138 virtual const char *get_db() {
return m_table->s->db.str; }
146 virtual bool is_valid()
const
148 return m_rows_buf && m_cols.bitmap;
160 MY_BITMAP const *cols,
bool is_transactional);
167 void print_helper(FILE *, PRINT_EVENT_INFO *,
char const *
const name);
171 virtual int do_add_row_data(uchar *data,
size_t length);
181 ulong m_master_reclength;
184 uint32 m_bitbuf[128/(
sizeof(uint32)*8)];
185 uint32 m_bitbuf_ai[128/(
sizeof(uint32)*8)];
195 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
196 const uchar *m_curr_row;
197 const uchar *m_curr_row_end;
206 DBUG_ASSERT(m_table);
208 int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
209 &m_curr_row_end, &m_master_reclength);
217 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
277 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
297 virtual int do_before_row_operations(
TABLE *
table) = 0;
308 virtual int do_after_row_operations(
TABLE *
table,
int error) = 0;
329 uchar
const *row_start,
330 uchar
const **row_end) = 0;
361 #if !defined(MYSQL_CLIENT)
364 bool is_transactional);
366 #ifdef HAVE_REPLICATION
370 #if !defined(MYSQL_CLIENT)
371 static bool binlog_row_logging_function(THD *thd,
TABLE *
table,
372 bool is_transactional,
373 const uchar *before_record
374 __attribute__((unused)),
375 const uchar *after_record)
377 return thd->binlog_write_row(table, is_transactional,
384 void print(FILE *
file, PRINT_EVENT_INFO *print_event_info);
387 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
398 TYPE_CODE = PRE_GA_WRITE_ROWS_EVENT
404 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
407 {
return Old_rows_log_event::do_apply_event(
this,rli); }
410 virtual int do_before_row_operations(
TABLE *table);
411 virtual int do_after_row_operations(
TABLE *table,
int error);
413 uchar
const *row_start, uchar
const **row_end);
414 virtual int do_exec_row(
TABLE *table);
437 bool is_transactional);
440 #ifdef HAVE_REPLICATION
445 #if !defined(MYSQL_CLIENT)
446 static bool binlog_row_logging_function(THD *thd,
TABLE *
table,
447 bool is_transactional,
448 const uchar *before_record,
449 const uchar *after_record)
451 return thd->binlog_update_row(table, is_transactional,
452 before_record, after_record, NULL);
458 void print(FILE *
file, PRINT_EVENT_INFO *print_event_info);
461 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
468 uchar *m_after_image, *m_memory;
474 TYPE_CODE = PRE_GA_UPDATE_ROWS_EVENT
480 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
483 {
return Old_rows_log_event::do_apply_event(
this,rli); }
486 virtual int do_before_row_operations(
TABLE *table);
487 virtual int do_after_row_operations(
TABLE *table,
int error);
489 uchar
const *row_start, uchar
const **row_end);
490 virtual int do_exec_row(
TABLE *table);
512 bool is_transactional);
514 #ifdef HAVE_REPLICATION
518 #if !defined(MYSQL_CLIENT)
519 static bool binlog_row_logging_function(THD *thd,
TABLE *
table,
520 bool is_transactional,
521 const uchar *before_record,
522 const uchar *after_record
523 __attribute__((unused)))
525 return thd->binlog_delete_row(table, is_transactional,
526 before_record, NULL);
532 void print(FILE *
file, PRINT_EVENT_INFO *print_event_info);
535 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
542 uchar *m_after_image, *m_memory;
548 TYPE_CODE = PRE_GA_DELETE_ROWS_EVENT
554 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
557 {
return Old_rows_log_event::do_apply_event(
this,rli); }
560 virtual int do_before_row_operations(
TABLE *table);
561 virtual int do_after_row_operations(
TABLE *table,
int error);
563 uchar
const *row_start, uchar
const **row_end);
564 virtual int do_exec_row(
TABLE *table);