~vadim-tk/percona-server/flushing-algo

« back to all changes in this revision

Viewing changes to sql/log_event_old.h

  • Committer: root
  • Date: 2011-10-29 01:34:40 UTC
  • Revision ID: root@hppro1.office.percona.com-20111029013440-qhnf4jk8kdjcf4e0
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2007 MySQL AB. 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 as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef LOG_EVENT_OLD_H
 
17
#define LOG_EVENT_OLD_H
 
18
 
 
19
/*
 
20
  Need to include this file at the proper position of log_event.h
 
21
 */
 
22
 
 
23
 
 
24
/**
 
25
  @file
 
26
 
 
27
  @brief This file contains classes handling old formats of row-based
 
28
  binlog events.
 
29
*/
 
30
/*
 
31
  Around 2007-10-31, I made these classes completely separated from
 
32
  the new classes (before, there was a complex class hierarchy
 
33
  involving multiple inheritance; see BUG#31581), by simply copying
 
34
  and pasting the entire contents of Rows_log_event into
 
35
  Old_rows_log_event and the entire contents of
 
36
  {Write|Update|Delete}_rows_log_event into
 
37
  {Write|Update|Delete}_rows_log_event_old.  For clarity, I will keep
 
38
  the comments marking which code was cut-and-pasted for some time.
 
39
  With the classes collapsed into one, there is probably some
 
40
  redundancy (maybe some methods can be simplified and/or removed),
 
41
  but we keep them this way for now.  /Sven
 
42
*/
 
43
 
 
44
 
 
45
/**
 
46
  @class Old_rows_log_event
 
47
  
 
48
  Base class for the three types of row-based events
 
49
  {Write|Update|Delete}_row_log_event_old, with event type codes
 
50
  PRE_GA_{WRITE|UPDATE|DELETE}_ROWS_EVENT.  These events are never
 
51
  created any more, except when reading a relay log created by an old
 
52
  server.
 
53
*/
 
54
class Old_rows_log_event : public Log_event
 
55
{
 
56
  /********** BEGIN CUT & PASTE FROM Rows_log_event **********/
 
57
public:
 
58
  /**
 
59
     Enumeration of the errors that can be returned.
 
60
   */
 
61
  enum enum_error
 
62
  {
 
63
    ERR_OPEN_FAILURE = -1,               /**< Failure to open table */
 
64
    ERR_OK = 0,                                 /**< No error */
 
65
    ERR_TABLE_LIMIT_EXCEEDED = 1,      /**< No more room for tables */
 
66
    ERR_OUT_OF_MEM = 2,                         /**< Out of memory */
 
67
    ERR_BAD_TABLE_DEF = 3,     /**< Table definition does not match */
 
68
    ERR_RBR_TO_SBR = 4  /**< daisy-chanining RBR to SBR not allowed */
 
69
  };
 
70
 
 
71
  /*
 
72
    These definitions allow you to combine the flags into an
 
73
    appropriate flag set using the normal bitwise operators.  The
 
74
    implicit conversion from an enum-constant to an integer is
 
75
    accepted by the compiler, which is then used to set the real set
 
76
    of flags.
 
77
  */
 
78
  enum enum_flag
 
79
  {
 
80
    /* Last event of a statement */
 
81
    STMT_END_F = (1U << 0),
 
82
 
 
83
    /* Value of the OPTION_NO_FOREIGN_KEY_CHECKS flag in thd->options */
 
84
    NO_FOREIGN_KEY_CHECKS_F = (1U << 1),
 
85
 
 
86
    /* Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options */
 
87
    RELAXED_UNIQUE_CHECKS_F = (1U << 2),
 
88
 
 
89
    /** 
 
90
      Indicates that rows in this event are complete, that is contain
 
91
      values for all columns of the table.
 
92
     */
 
93
    COMPLETE_ROWS_F = (1U << 3)
 
94
  };
 
95
 
 
96
  typedef uint16 flag_set;
 
97
 
 
98
  /* Special constants representing sets of flags */
 
99
  enum 
 
100
  {
 
101
      RLE_NO_FLAGS = 0U
 
102
  };
 
103
 
 
104
  virtual ~Old_rows_log_event();
 
105
 
 
106
  void set_flags(flag_set flags_arg) { m_flags |= flags_arg; }
 
107
  void clear_flags(flag_set flags_arg) { m_flags &= ~flags_arg; }
 
108
  flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; }
 
109
 
 
110
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
111
  virtual void pack_info(Protocol *protocol);
 
112
#endif
 
113
 
 
114
#ifdef MYSQL_CLIENT
 
115
  /* not for direct call, each derived has its own ::print() */
 
116
  virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0;
 
117
#endif
 
118
 
 
119
#ifndef MYSQL_CLIENT
 
120
  int add_row_data(uchar *data, size_t length)
 
121
  {
 
122
    return do_add_row_data(data,length); 
 
123
  }
 
124
#endif
 
125
 
 
126
  /* Member functions to implement superclass interface */
 
127
  virtual int get_data_size();
 
128
 
 
129
  MY_BITMAP const *get_cols() const { return &m_cols; }
 
130
  size_t get_width() const          { return m_width; }
 
131
  ulong get_table_id() const        { return m_table_id; }
 
132
 
 
133
#ifndef MYSQL_CLIENT
 
134
  virtual bool write_data_header(IO_CACHE *file);
 
135
  virtual bool write_data_body(IO_CACHE *file);
 
136
  virtual const char *get_db() { return m_table->s->db.str; }
 
137
#endif
 
138
  /*
 
139
    Check that malloc() succeeded in allocating memory for the rows
 
140
    buffer and the COLS vector. Checking that an Update_rows_log_event_old
 
141
    is valid is done in the Update_rows_log_event_old::is_valid()
 
142
    function.
 
143
  */
 
144
  virtual bool is_valid() const
 
145
  {
 
146
    return m_rows_buf && m_cols.bitmap;
 
147
  }
 
148
 
 
149
  uint     m_row_count;         /* The number of rows added to the event */
 
150
 
 
151
protected:
 
152
  /* 
 
153
     The constructors are protected since you're supposed to inherit
 
154
     this class, not create instances of this class.
 
155
  */
 
156
#ifndef MYSQL_CLIENT
 
157
  Old_rows_log_event(THD*, TABLE*, ulong table_id,
 
158
                     MY_BITMAP const *cols, bool is_transactional);
 
159
#endif
 
160
  Old_rows_log_event(const char *row_data, uint event_len,
 
161
                     Log_event_type event_type,
 
162
                     const Format_description_log_event *description_event);
 
163
 
 
164
#ifdef MYSQL_CLIENT
 
165
  void print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name);
 
166
#endif
 
167
 
 
168
#ifndef MYSQL_CLIENT
 
169
  virtual int do_add_row_data(uchar *data, size_t length);
 
170
#endif
 
171
 
 
172
#ifndef MYSQL_CLIENT
 
173
  TABLE *m_table;               /* The table the rows belong to */
 
174
#endif
 
175
  ulong       m_table_id;       /* Table ID */
 
176
  MY_BITMAP   m_cols;           /* Bitmap denoting columns available */
 
177
  ulong       m_width;          /* The width of the columns bitmap */
 
178
 
 
179
  ulong       m_master_reclength; /* Length of record on master side */
 
180
 
 
181
  /* Bit buffers in the same memory as the class */
 
182
  uint32    m_bitbuf[128/(sizeof(uint32)*8)];
 
183
  uint32    m_bitbuf_ai[128/(sizeof(uint32)*8)];
 
184
 
 
185
  uchar    *m_rows_buf;         /* The rows in packed format */
 
186
  uchar    *m_rows_cur;         /* One-after the end of the data */
 
187
  uchar    *m_rows_end;         /* One-after the end of the allocated space */
 
188
 
 
189
  flag_set m_flags;             /* Flags for row-level events */
 
190
 
 
191
  /* helper functions */
 
192
 
 
193
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
194
  const uchar *m_curr_row;     /* Start of the row being processed */
 
195
  const uchar *m_curr_row_end; /* One-after the end of the current row */
 
196
  uchar    *m_key;      /* Buffer to keep key value during searches */
 
197
 
 
198
  int find_row(const Relay_log_info *const);
 
199
  int write_row(const Relay_log_info *const, const bool);
 
200
 
 
201
  // Unpack the current row into m_table->record[0]
 
202
  int unpack_current_row(const Relay_log_info *const rli)
 
203
  { 
 
204
    DBUG_ASSERT(m_table);
 
205
    ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
 
206
    int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
 
207
                                   &m_curr_row_end, &m_master_reclength);
 
208
    ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT);
 
209
    return result;
 
210
  }
 
211
#endif
 
212
 
 
213
private:
 
214
 
 
215
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
216
  virtual int do_apply_event(Relay_log_info const *rli);
 
217
  virtual int do_update_pos(Relay_log_info *rli);
 
218
  virtual enum_skip_reason do_shall_skip(Relay_log_info *rli);
 
219
 
 
220
  /*
 
221
    Primitive to prepare for a sequence of row executions.
 
222
 
 
223
    DESCRIPTION
 
224
 
 
225
      Before doing a sequence of do_prepare_row() and do_exec_row()
 
226
      calls, this member function should be called to prepare for the
 
227
      entire sequence. Typically, this member function will allocate
 
228
      space for any buffers that are needed for the two member
 
229
      functions mentioned above.
 
230
 
 
231
    RETURN VALUE
 
232
 
 
233
      The member function will return 0 if all went OK, or a non-zero
 
234
      error code otherwise.
 
235
  */
 
236
  virtual 
 
237
  int do_before_row_operations(const Slave_reporting_capability *const log) = 0;
 
238
 
 
239
  /*
 
240
    Primitive to clean up after a sequence of row executions.
 
241
 
 
242
    DESCRIPTION
 
243
    
 
244
      After doing a sequence of do_prepare_row() and do_exec_row(),
 
245
      this member function should be called to clean up and release
 
246
      any allocated buffers.
 
247
      
 
248
      The error argument, if non-zero, indicates an error which happened during
 
249
      row processing before this function was called. In this case, even if 
 
250
      function is successful, it should return the error code given in the argument.
 
251
  */
 
252
  virtual 
 
253
  int do_after_row_operations(const Slave_reporting_capability *const log,
 
254
                              int error) = 0;
 
255
 
 
256
  /*
 
257
    Primitive to do the actual execution necessary for a row.
 
258
 
 
259
    DESCRIPTION
 
260
      The member function will do the actual execution needed to handle a row.
 
261
      The row is located at m_curr_row. When the function returns, 
 
262
      m_curr_row_end should point at the next row (one byte after the end
 
263
      of the current row).    
 
264
 
 
265
    RETURN VALUE
 
266
      0 if execution succeeded, 1 if execution failed.
 
267
      
 
268
  */
 
269
  virtual int do_exec_row(const Relay_log_info *const rli) = 0;
 
270
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
 
271
 
 
272
  /********** END OF CUT & PASTE FROM Rows_log_event **********/
 
273
 protected:
 
274
  
 
275
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
276
 
 
277
  int do_apply_event(Old_rows_log_event*,const Relay_log_info*);
 
278
 
 
279
  /*
 
280
    Primitive to prepare for a sequence of row executions.
 
281
 
 
282
    DESCRIPTION
 
283
 
 
284
      Before doing a sequence of do_prepare_row() and do_exec_row()
 
285
      calls, this member function should be called to prepare for the
 
286
      entire sequence. Typically, this member function will allocate
 
287
      space for any buffers that are needed for the two member
 
288
      functions mentioned above.
 
289
 
 
290
    RETURN VALUE
 
291
 
 
292
      The member function will return 0 if all went OK, or a non-zero
 
293
      error code otherwise.
 
294
  */
 
295
  virtual int do_before_row_operations(TABLE *table) = 0;
 
296
 
 
297
  /*
 
298
    Primitive to clean up after a sequence of row executions.
 
299
 
 
300
    DESCRIPTION
 
301
    
 
302
      After doing a sequence of do_prepare_row() and do_exec_row(),
 
303
      this member function should be called to clean up and release
 
304
      any allocated buffers.
 
305
  */
 
306
  virtual int do_after_row_operations(TABLE *table, int error) = 0;
 
307
 
 
308
  /*
 
309
    Primitive to prepare for handling one row in a row-level event.
 
310
    
 
311
    DESCRIPTION 
 
312
 
 
313
      The member function prepares for execution of operations needed for one
 
314
      row in a row-level event by reading up data from the buffer containing
 
315
      the row. No specific interpretation of the data is normally done here,
 
316
      since SQL thread specific data is not available: that data is made
 
317
      available for the do_exec function.
 
318
 
 
319
      A pointer to the start of the next row, or NULL if the preparation
 
320
      failed. Currently, preparation cannot fail, but don't rely on this
 
321
      behavior. 
 
322
 
 
323
    RETURN VALUE
 
324
      Error code, if something went wrong, 0 otherwise.
 
325
   */
 
326
  virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
 
327
                             uchar const *row_start,
 
328
                             uchar const **row_end) = 0;
 
329
 
 
330
  /*
 
331
    Primitive to do the actual execution necessary for a row.
 
332
 
 
333
    DESCRIPTION
 
334
      The member function will do the actual execution needed to handle a row.
 
335
 
 
336
    RETURN VALUE
 
337
      0 if execution succeeded, 1 if execution failed.
 
338
      
 
339
  */
 
340
  virtual int do_exec_row(TABLE *table) = 0;
 
341
 
 
342
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
 
343
};
 
344
 
 
345
 
 
346
/**
 
347
  @class Write_rows_log_event_old
 
348
 
 
349
  Old class for binlog events that write new rows to a table (event
 
350
  type code PRE_GA_WRITE_ROWS_EVENT).  Such events are never produced
 
351
  by this version of the server, but they may be read from a relay log
 
352
  created by an old server.  New servers create events of class
 
353
  Write_rows_log_event (event type code WRITE_ROWS_EVENT) instead.
 
354
*/
 
355
class Write_rows_log_event_old : public Old_rows_log_event
 
356
{
 
357
  /********** BEGIN CUT & PASTE FROM Write_rows_log_event **********/
 
358
public:
 
359
#if !defined(MYSQL_CLIENT)
 
360
  Write_rows_log_event_old(THD*, TABLE*, ulong table_id,
 
361
                           MY_BITMAP const *cols, bool is_transactional);
 
362
#endif
 
363
#ifdef HAVE_REPLICATION
 
364
  Write_rows_log_event_old(const char *buf, uint event_len,
 
365
                           const Format_description_log_event *description_event);
 
366
#endif
 
367
#if !defined(MYSQL_CLIENT) 
 
368
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
 
369
                                          bool is_transactional,
 
370
                                          MY_BITMAP *cols,
 
371
                                          uint fields,
 
372
                                          const uchar *before_record
 
373
                                          __attribute__((unused)),
 
374
                                          const uchar *after_record)
 
375
  {
 
376
    return thd->binlog_write_row(table, is_transactional,
 
377
                                 cols, fields, after_record);
 
378
  }
 
379
#endif
 
380
 
 
381
private:
 
382
#ifdef MYSQL_CLIENT
 
383
  void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
 
384
#endif
 
385
 
 
386
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
387
  virtual int do_before_row_operations(const Slave_reporting_capability *const);
 
388
  virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
 
389
  virtual int do_exec_row(const Relay_log_info *const);
 
390
#endif
 
391
  /********** END OF CUT & PASTE FROM Write_rows_log_event **********/
 
392
 
 
393
public:
 
394
  enum
 
395
  {
 
396
    /* Support interface to THD::binlog_prepare_pending_rows_event */
 
397
    TYPE_CODE = PRE_GA_WRITE_ROWS_EVENT
 
398
  };
 
399
 
 
400
private:
 
401
  virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; }
 
402
 
 
403
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
404
  // use old definition of do_apply_event()
 
405
  virtual int do_apply_event(const Relay_log_info *rli)
 
406
  { return Old_rows_log_event::do_apply_event(this,rli); }
 
407
 
 
408
  // primitives for old version of do_apply_event()
 
409
  virtual int do_before_row_operations(TABLE *table);
 
410
  virtual int do_after_row_operations(TABLE *table, int error);
 
411
  virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
 
412
                             uchar const *row_start, uchar const **row_end);
 
413
  virtual int do_exec_row(TABLE *table);
 
414
 
 
415
#endif
 
416
};
 
417
 
 
418
 
 
419
/**
 
420
  @class Update_rows_log_event_old
 
421
 
 
422
  Old class for binlog events that modify existing rows to a table
 
423
  (event type code PRE_GA_UPDATE_ROWS_EVENT).  Such events are never
 
424
  produced by this version of the server, but they may be read from a
 
425
  relay log created by an old server.  New servers create events of
 
426
  class Update_rows_log_event (event type code UPDATE_ROWS_EVENT)
 
427
  instead.
 
428
*/
 
429
class Update_rows_log_event_old : public Old_rows_log_event
 
430
{
 
431
  /********** BEGIN CUT & PASTE FROM Update_rows_log_event **********/
 
432
public:
 
433
#ifndef MYSQL_CLIENT
 
434
  Update_rows_log_event_old(THD*, TABLE*, ulong table_id,
 
435
                            MY_BITMAP const *cols,
 
436
                            bool is_transactional);
 
437
#endif
 
438
 
 
439
#ifdef HAVE_REPLICATION
 
440
  Update_rows_log_event_old(const char *buf, uint event_len,
 
441
                            const Format_description_log_event *description_event);
 
442
#endif
 
443
 
 
444
#if !defined(MYSQL_CLIENT) 
 
445
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
 
446
                                          bool is_transactional,
 
447
                                          MY_BITMAP *cols,
 
448
                                          uint fields,
 
449
                                          const uchar *before_record,
 
450
                                          const uchar *after_record)
 
451
  {
 
452
    return thd->binlog_update_row(table, is_transactional,
 
453
                                  cols, fields, before_record, after_record);
 
454
  }
 
455
#endif
 
456
 
 
457
protected:
 
458
#ifdef MYSQL_CLIENT
 
459
  void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
 
460
#endif
 
461
 
 
462
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
463
  virtual int do_before_row_operations(const Slave_reporting_capability *const);
 
464
  virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
 
465
  virtual int do_exec_row(const Relay_log_info *const);
 
466
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
 
467
  /********** END OF CUT & PASTE FROM Update_rows_log_event **********/
 
468
 
 
469
  uchar *m_after_image, *m_memory;
 
470
  
 
471
public:
 
472
  enum 
 
473
  {
 
474
    /* Support interface to THD::binlog_prepare_pending_rows_event */
 
475
    TYPE_CODE = PRE_GA_UPDATE_ROWS_EVENT
 
476
  };
 
477
 
 
478
private:
 
479
  virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; }
 
480
 
 
481
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
482
  // use old definition of do_apply_event()
 
483
  virtual int do_apply_event(const Relay_log_info *rli)
 
484
  { return Old_rows_log_event::do_apply_event(this,rli); }
 
485
 
 
486
  // primitives for old version of do_apply_event()
 
487
  virtual int do_before_row_operations(TABLE *table);
 
488
  virtual int do_after_row_operations(TABLE *table, int error);
 
489
  virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
 
490
                             uchar const *row_start, uchar const **row_end);
 
491
  virtual int do_exec_row(TABLE *table);
 
492
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
 
493
};
 
494
 
 
495
 
 
496
/**
 
497
  @class Delete_rows_log_event_old
 
498
 
 
499
  Old class for binlog events that delete existing rows from a table
 
500
  (event type code PRE_GA_DELETE_ROWS_EVENT).  Such events are never
 
501
  produced by this version of the server, but they may be read from a
 
502
  relay log created by an old server.  New servers create events of
 
503
  class Delete_rows_log_event (event type code DELETE_ROWS_EVENT)
 
504
  instead.
 
505
*/
 
506
class Delete_rows_log_event_old : public Old_rows_log_event
 
507
{
 
508
  /********** BEGIN CUT & PASTE FROM Update_rows_log_event **********/
 
509
public:
 
510
#ifndef MYSQL_CLIENT
 
511
  Delete_rows_log_event_old(THD*, TABLE*, ulong,
 
512
                            MY_BITMAP const *cols, bool is_transactional);
 
513
#endif
 
514
#ifdef HAVE_REPLICATION
 
515
  Delete_rows_log_event_old(const char *buf, uint event_len,
 
516
                            const Format_description_log_event *description_event);
 
517
#endif
 
518
#if !defined(MYSQL_CLIENT) 
 
519
  static bool binlog_row_logging_function(THD *thd, TABLE *table,
 
520
                                          bool is_transactional,
 
521
                                          MY_BITMAP *cols,
 
522
                                          uint fields,
 
523
                                          const uchar *before_record,
 
524
                                          const uchar *after_record
 
525
                                          __attribute__((unused)))
 
526
  {
 
527
    return thd->binlog_delete_row(table, is_transactional,
 
528
                                  cols, fields, before_record);
 
529
  }
 
530
#endif
 
531
  
 
532
protected:
 
533
#ifdef MYSQL_CLIENT
 
534
  void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
 
535
#endif
 
536
 
 
537
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
538
  virtual int do_before_row_operations(const Slave_reporting_capability *const);
 
539
  virtual int do_after_row_operations(const Slave_reporting_capability *const,int);
 
540
  virtual int do_exec_row(const Relay_log_info *const);
 
541
#endif
 
542
  /********** END CUT & PASTE FROM Delete_rows_log_event **********/
 
543
 
 
544
  uchar *m_after_image, *m_memory;
 
545
 
 
546
public:
 
547
  enum 
 
548
  {
 
549
    /* Support interface to THD::binlog_prepare_pending_rows_event */
 
550
    TYPE_CODE = PRE_GA_DELETE_ROWS_EVENT
 
551
  };
 
552
 
 
553
private:
 
554
  virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; }
 
555
 
 
556
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
557
  // use old definition of do_apply_event()
 
558
  virtual int do_apply_event(const Relay_log_info *rli)
 
559
  { return Old_rows_log_event::do_apply_event(this,rli); }
 
560
 
 
561
  // primitives for old version of do_apply_event()
 
562
  virtual int do_before_row_operations(TABLE *table);
 
563
  virtual int do_after_row_operations(TABLE *table, int error);
 
564
  virtual int do_prepare_row(THD*, Relay_log_info const*, TABLE*,
 
565
                             uchar const *row_start, uchar const **row_end);
 
566
  virtual int do_exec_row(TABLE *table);
 
567
#endif
 
568
};
 
569
 
 
570
 
 
571
#endif