~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/log_event.h

Merged changes from codestyle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#ifndef MYSQL_CLIENT
38
38
#include "rpl_record.h"
39
39
#include "rpl_reporting.h"
 
40
#else
 
41
#include "my_decimal.h"
40
42
#endif
41
43
 
42
44
/**
375
377
#define BINLOG_MAGIC        "\xfe\x62\x69\x6e"
376
378
 
377
379
/*
378
 
  The 2 flags below were useless :
379
 
  - the first one was never set
380
 
  - the second one was set in all Rotate events on the master, but not used for
381
 
  anything useful.
382
 
  So they are now removed and their place may later be reused for other
383
 
  flags. Then one must remember that Rotate events in 4.x have
384
 
  LOG_EVENT_FORCED_ROTATE_F set, so one should not rely on the value of the
385
 
  replacing flag when reading a Rotate event.
386
 
  I keep the defines here just to remember what they were.
387
 
*/
388
 
#ifdef TO_BE_REMOVED
389
 
#define LOG_EVENT_TIME_F            0x1
390
 
#define LOG_EVENT_FORCED_ROTATE_F   0x2
391
 
#endif
392
 
 
393
 
/*
394
380
   This flag only makes sense for Format_description_log_event. It is set
395
381
   when the event is written, and *reset* when a binlog file is
396
382
   closed (yes, it's the only case when MySQL modifies already written
472
458
 
473
459
/* Shouldn't be defined before */
474
460
#define EXPECTED_OPTIONS \
475
 
  ((ULL(1) << 14) | (ULL(1) << 26) | (ULL(1) << 27) | (ULL(1) << 19))
 
461
  ((1ULL << 14) | (1ULL << 26) | (1ULL << 27) | (1ULL << 19))
476
462
 
477
463
#if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS
478
464
#error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values!
947
933
    return (void*) my_malloc((uint)size, MYF(MY_WME|MY_FAE));
948
934
  }
949
935
 
950
 
  static void operator delete(void *ptr, size_t size)
 
936
  static void operator delete(void *ptr,
 
937
                              size_t size __attribute__((__unused__)))
951
938
  {
952
939
    my_free((uchar*) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
953
940
  }
964
951
            write_data_header(file) ||
965
952
            write_data_body(file));
966
953
  }
967
 
  virtual bool write_data_header(IO_CACHE* file)
 
954
  virtual bool write_data_header(IO_CACHE* file __attribute__((__unused__)))
968
955
  { return 0; }
969
956
  virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
970
957
  { return 0; }
1093
1080
    @retval 0     Event applied successfully
1094
1081
    @retval errno Error code if event application failed
1095
1082
  */
1096
 
  virtual int do_apply_event(Relay_log_info const *rli)
 
1083
  virtual int do_apply_event(Relay_log_info const *rli __attribute__((__unused__)))
1097
1084
  {
1098
1085
    return 0;                /* Default implementation does nothing */
1099
1086
  }
1596
1583
  Log_event_type get_type_code() { return QUERY_EVENT; }
1597
1584
#ifndef MYSQL_CLIENT
1598
1585
  bool write(IO_CACHE* file);
1599
 
  virtual bool write_post_header_for_derived(IO_CACHE* file) { return FALSE; }
 
1586
  virtual bool write_post_header_for_derived(IO_CACHE* file __attribute__((__unused__)))
 
1587
  { return FALSE; }
1600
1588
#endif
1601
1589
  bool is_valid() const { return query != 0; }
1602
1590
 
2385
2373
  uint charset_number;
2386
2374
  bool is_null;
2387
2375
#ifndef MYSQL_CLIENT
2388
 
  User_var_log_event(THD* thd_arg, char *name_arg, uint name_len_arg,
 
2376
  User_var_log_event(THD* thd_arg __attribute__((__unused__)),
 
2377
                     char *name_arg, uint name_len_arg,
2389
2378
                     char *val_arg, ulong val_len_arg, Item_result type_arg,
2390
2379
                     uint charset_number_arg)
2391
2380
    :Log_event(), name(name_arg), name_len(name_len_arg), val(val_arg),
2443
2432
private:
2444
2433
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
2445
2434
  virtual int do_update_pos(Relay_log_info *rli);
2446
 
  virtual enum_skip_reason do_shall_skip(Relay_log_info *rli)
 
2435
  virtual enum_skip_reason do_shall_skip(Relay_log_info *rli __attribute__((__unused__)))
2447
2436
  {
2448
2437
    /*
2449
2438
      Events from ourself should be skipped, but they should not
3013
3002
  </tr>
3014
3003
 
3015
3004
  <tr>
3016
 
    <td>MYSQL_TYPE_DECIMAL</td><td>0</td>
3017
 
    <td>0</td>
3018
 
    <td>No column metadata.</td>
3019
 
  </tr>
3020
 
 
3021
 
  <tr>
3022
3005
    <td>MYSQL_TYPE_TINY</td><td>1</td>
3023
3006
    <td>0</td>
3024
3007
    <td>No column metadata.</td>
3071
3054
  </tr>
3072
3055
 
3073
3056
  <tr>
3074
 
    <td>MYSQL_TYPE_INT24</td><td>9</td>
3075
 
    <td>0</td>
3076
 
    <td>No column metadata.</td>
3077
 
  </tr>
3078
 
 
3079
 
  <tr>
3080
3057
    <td>MYSQL_TYPE_DATE</td><td>10</td>
3081
3058
    <td>0</td>
3082
3059
    <td>No column metadata.</td>
3115
3092
  </tr>
3116
3093
 
3117
3094
  <tr>
3118
 
    <td>MYSQL_TYPE_BIT</td><td>16</td>
3119
 
    <td>2 bytes</td>
3120
 
    <td>A 1 byte unsigned int representing the length in bits of the
3121
 
    bitfield (0 to 64), followed by a 1 byte unsigned int
3122
 
    representing the number of bytes occupied by the bitfield.  The
3123
 
    number of bytes is either int((length+7)/8) or int(length/8).</td>
3124
 
  </tr>
3125
 
 
3126
 
  <tr>
3127
3095
    <td>MYSQL_TYPE_NEWDECIMAL</td><td>246</td>
3128
3096
    <td>2 bytes</td>
3129
3097
    <td>A 1 byte unsigned int representing the precision, followed
3191
3159
    the representation of size of the string: 3 or 4.</td>
3192
3160
  </tr>
3193
3161
 
3194
 
  <tr>
3195
 
    <td>MYSQL_TYPE_GEOMETRY</td><td>255</td>
3196
 
    <td>1 byte</td>
3197
 
    <td>The pack length, i.e., the number of bytes needed to represent
3198
 
    the length of the geometry: 1, 2, 3, or 4.</td>
3199
 
  </tr>
3200
 
 
3201
3162
  </table>
3202
3163
*/
3203
3164
class Table_map_log_event : public Log_event