~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log_event.h

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
886
886
    is calculated during write()
887
887
  */
888
888
  virtual int get_data_size() { return 0;}
889
 
  static Log_event* read_log_event(const char* buf, uint event_len,
 
889
  static Log_event* read_log_event(const char* buf, uint32_t event_len,
890
890
                                   const char **error,
891
891
                                   const Format_description_log_event
892
892
                                   *description_event);
1406
1406
    concerned) from here.
1407
1407
  */
1408
1408
 
1409
 
  uint catalog_len;                     // <= 255 char; 0 means uninited
 
1409
  uint32_t catalog_len;                 // <= 255 char; 0 means uninited
1410
1410
 
1411
1411
  /*
1412
1412
    We want to be able to store a variable number of N-bit status vars:
1448
1448
  ulong sql_mode;
1449
1449
  ulong auto_increment_increment, auto_increment_offset;
1450
1450
  char charset[6];
1451
 
  uint time_zone_len; /* 0 means uninited */
 
1451
  uint32_t time_zone_len; /* 0 means uninited */
1452
1452
  const char *time_zone_str;
1453
 
  uint lc_time_names_number; /* 0 means en_US */
1454
 
  uint charset_database_number;
 
1453
  uint32_t lc_time_names_number; /* 0 means en_US */
 
1454
  uint32_t charset_database_number;
1455
1455
 
1456
1456
 
1457
1457
  Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length,
1461
1461
  void pack_info(Protocol* protocol);
1462
1462
 
1463
1463
  Query_log_event();
1464
 
  Query_log_event(const char* buf, uint event_len,
 
1464
  Query_log_event(const char* buf, uint32_t event_len,
1465
1465
                  const Format_description_log_event *description_event,
1466
1466
                  Log_event_type event_type);
1467
1467
  ~Query_log_event()
1557
1557
  Slave_log_event(THD* thd_arg, Relay_log_info* rli);
1558
1558
  void pack_info(Protocol* protocol);
1559
1559
 
1560
 
  Slave_log_event(const char* buf, uint event_len);
 
1560
  Slave_log_event(const char* buf, uint32_t event_len);
1561
1561
  ~Slave_log_event();
1562
1562
  int get_data_size();
1563
1563
  bool is_valid() const { return master_host != 0; }
1771
1771
class Load_log_event: public Log_event
1772
1772
{
1773
1773
private:
1774
 
  uint get_query_buffer_length();
 
1774
  uint32_t get_query_buffer_length();
1775
1775
  void print_query(bool need_db, char *buf, char **end,
1776
1776
                   char **fn_start, char **fn_end);
1777
1777
protected:
1803
1803
  bool local_fname;
1804
1804
 
1805
1805
  /* fname doesn't point to memory inside Log_event::temp_buf  */
1806
 
  void set_fname_outside_temp_buf(const char *afname, uint alen)
 
1806
  void set_fname_outside_temp_buf(const char *afname, uint32_t alen)
1807
1807
  {
1808
1808
    fname= afname;
1809
1809
    fname_len= alen;
1833
1833
    logging of LOAD DATA is going to be changed in 4.1 or 5.0, this is only used
1834
1834
    for the common_header_len (post_header_len will not be changed).
1835
1835
  */
1836
 
  Load_log_event(const char* buf, uint event_len,
 
1836
  Load_log_event(const char* buf, uint32_t event_len,
1837
1837
                 const Format_description_log_event* description_event);
1838
1838
  ~Load_log_event()
1839
1839
  {}
1976
1976
  const uint8_t *event_type_permutation;
1977
1977
 
1978
1978
  Format_description_log_event(uint8_t binlog_ver, const char* server_ver=0);
1979
 
  Format_description_log_event(const char* buf, uint event_len,
 
1979
  Format_description_log_event(const char* buf, uint32_t event_len,
1980
1980
                               const Format_description_log_event
1981
1981
                               *description_event);
1982
1982
  ~Format_description_log_event()
2179
2179
{
2180
2180
public:
2181
2181
  char *name;
2182
 
  uint name_len;
 
2182
  uint32_t name_len;
2183
2183
  char *val;
2184
2184
  ulong val_len;
2185
2185
  Item_result type;
2186
 
  uint charset_number;
 
2186
  uint32_t charset_number;
2187
2187
  bool is_null;
2188
2188
  User_var_log_event(THD* thd_arg __attribute__((unused)),
2189
 
                     char *name_arg, uint name_len_arg,
 
2189
                     char *name_arg, uint32_t name_len_arg,
2190
2190
                     char *val_arg, ulong val_len_arg, Item_result type_arg,
2191
 
                     uint charset_number_arg)
 
2191
                     uint32_t charset_number_arg)
2192
2192
    :Log_event(), name(name_arg), name_len(name_len_arg), val(val_arg),
2193
2193
    val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg)
2194
2194
    { is_null= !val; }
2302
2302
  };
2303
2303
  const char* new_log_ident;
2304
2304
  uint64_t pos;
2305
 
  uint ident_len;
2306
 
  uint flags;
 
2305
  uint32_t ident_len;
 
2306
  uint32_t flags;
2307
2307
  Rotate_log_event(const char* new_log_ident_arg,
2308
 
                   uint ident_len_arg,
2309
 
                   uint64_t pos_arg, uint flags);
 
2308
                   uint32_t ident_len_arg,
 
2309
                   uint64_t pos_arg, uint32_t flags);
2310
2310
  void pack_info(Protocol* protocol);
2311
2311
 
2312
 
  Rotate_log_event(const char* buf, uint event_len,
 
2312
  Rotate_log_event(const char* buf, uint32_t event_len,
2313
2313
                   const Format_description_log_event* description_event);
2314
2314
  ~Rotate_log_event()
2315
2315
  {
2347
2347
public:
2348
2348
  unsigned char* block;
2349
2349
  const char *event_buf;
2350
 
  uint block_len;
2351
 
  uint file_id;
 
2350
  uint32_t block_len;
 
2351
  uint32_t file_id;
2352
2352
  bool inited_from_old;
2353
2353
 
2354
2354
  Create_file_log_event(THD* thd, sql_exchange* ex, const char* db_arg,
2355
2355
                        const char* table_name_arg,
2356
2356
                        List<Item>& fields_arg,
2357
2357
                        enum enum_duplicates handle_dup, bool ignore,
2358
 
                        unsigned char* block_arg, uint block_len_arg,
 
2358
                        unsigned char* block_arg, uint32_t block_len_arg,
2359
2359
                        bool using_trans);
2360
2360
  void pack_info(Protocol* protocol);
2361
2361
 
2362
 
  Create_file_log_event(const char* buf, uint event_len,
 
2362
  Create_file_log_event(const char* buf, uint32_t event_len,
2363
2363
                        const Format_description_log_event* description_event);
2364
2364
  ~Create_file_log_event()
2365
2365
  {
2400
2400
{
2401
2401
public:
2402
2402
  unsigned char* block;
2403
 
  uint block_len;
2404
 
  uint file_id;
 
2403
  uint32_t block_len;
 
2404
  uint32_t file_id;
2405
2405
  /*
2406
2406
    'db' is filled when the event is created in mysql_load() (the
2407
2407
    event needs to have a 'db' member to be well filtered by
2416
2416
  const char* db;
2417
2417
 
2418
2418
  Append_block_log_event(THD* thd, const char* db_arg, unsigned char* block_arg,
2419
 
                         uint block_len_arg, bool using_trans);
 
2419
                         uint32_t block_len_arg, bool using_trans);
2420
2420
  void pack_info(Protocol* protocol);
2421
2421
  virtual int get_create_or_append() const;
2422
2422
 
2423
 
  Append_block_log_event(const char* buf, uint event_len,
 
2423
  Append_block_log_event(const char* buf, uint32_t event_len,
2424
2424
                         const Format_description_log_event
2425
2425
                         *description_event);
2426
2426
  ~Append_block_log_event() {}
2444
2444
class Delete_file_log_event: public Log_event
2445
2445
{
2446
2446
public:
2447
 
  uint file_id;
 
2447
  uint32_t file_id;
2448
2448
  const char* db; /* see comment in Append_block_log_event */
2449
2449
 
2450
2450
  Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans);
2451
2451
  void pack_info(Protocol* protocol);
2452
2452
 
2453
 
  Delete_file_log_event(const char* buf, uint event_len,
 
2453
  Delete_file_log_event(const char* buf, uint32_t event_len,
2454
2454
                        const Format_description_log_event* description_event);
2455
2455
  ~Delete_file_log_event() {}
2456
2456
  Log_event_type get_type_code() { return DELETE_FILE_EVENT;}
2473
2473
class Execute_load_log_event: public Log_event
2474
2474
{
2475
2475
public:
2476
 
  uint file_id;
 
2476
  uint32_t file_id;
2477
2477
  const char* db; /* see comment in Append_block_log_event */
2478
2478
 
2479
2479
  Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans);
2480
2480
  void pack_info(Protocol* protocol);
2481
2481
 
2482
 
  Execute_load_log_event(const char* buf, uint event_len,
 
2482
  Execute_load_log_event(const char* buf, uint32_t event_len,
2483
2483
                         const Format_description_log_event
2484
2484
                         *description_event);
2485
2485
  ~Execute_load_log_event() {}
2507
2507
{
2508
2508
public:
2509
2509
  Begin_load_query_log_event(THD* thd_arg, const char *db_arg,
2510
 
                             unsigned char* block_arg, uint block_len_arg,
 
2510
                             unsigned char* block_arg, uint32_t block_len_arg,
2511
2511
                             bool using_trans);
2512
2512
  Begin_load_query_log_event(THD* thd);
2513
2513
  int get_create_or_append() const;
2514
 
  Begin_load_query_log_event(const char* buf, uint event_len,
 
2514
  Begin_load_query_log_event(const char* buf, uint32_t event_len,
2515
2515
                             const Format_description_log_event
2516
2516
                             *description_event);
2517
2517
  ~Begin_load_query_log_event() {}
2539
2539
class Execute_load_query_log_event: public Query_log_event
2540
2540
{
2541
2541
public:
2542
 
  uint file_id;       // file_id of temporary file
2543
 
  uint fn_pos_start;  // pointer to the part of the query that should
 
2542
  uint32_t file_id;       // file_id of temporary file
 
2543
  uint32_t fn_pos_start;  // pointer to the part of the query that should
2544
2544
                      // be substituted
2545
 
  uint fn_pos_end;    // pointer to the end of this part of query
 
2545
  uint32_t fn_pos_end;    // pointer to the end of this part of query
2546
2546
  /*
2547
2547
    We have to store type of duplicate handling explicitly, because
2548
2548
    for LOAD DATA it also depends on LOCAL option. And this part
2552
2552
  enum_load_dup_handling dup_handling;
2553
2553
 
2554
2554
  Execute_load_query_log_event(THD* thd, const char* query_arg,
2555
 
                               ulong query_length, uint fn_pos_start_arg,
2556
 
                               uint fn_pos_end_arg,
 
2555
                               ulong query_length, uint32_t fn_pos_start_arg,
 
2556
                               uint32_t fn_pos_end_arg,
2557
2557
                               enum_load_dup_handling dup_handling_arg,
2558
2558
                               bool using_trans, bool suppress_use,
2559
2559
                               THD::killed_state
2560
2560
                               killed_err_arg= THD::KILLED_NO_VALUE);
2561
2561
  void pack_info(Protocol* protocol);
2562
 
  Execute_load_query_log_event(const char* buf, uint event_len,
 
2562
  Execute_load_query_log_event(const char* buf, uint32_t event_len,
2563
2563
                               const Format_description_log_event
2564
2564
                               *description_event);
2565
2565
  ~Execute_load_query_log_event() {}
2575
2575
};
2576
2576
 
2577
2577
 
2578
 
char *str_to_hex(char *to, const char *from, uint len);
 
2578
char *str_to_hex(char *to, const char *from, uint32_t len);
2579
2579
 
2580
2580
/**
2581
2581
  @class Table_map_log_event
2870
2870
 
2871
2871
  Table_map_log_event(THD *thd, Table *tbl, ulong tid, 
2872
2872
                      bool is_transactional, uint16_t flags);
2873
 
  Table_map_log_event(const char *buf, uint event_len, 
 
2873
  Table_map_log_event(const char *buf, uint32_t event_len, 
2874
2874
                      const Format_description_log_event *description_event);
2875
2875
 
2876
2876
  ~Table_map_log_event();
3012
3012
    return m_rows_buf && m_cols.bitmap;
3013
3013
  }
3014
3014
 
3015
 
  uint     m_row_count;         /* The number of rows added to the event */
 
3015
  uint32_t     m_row_count;         /* The number of rows added to the event */
3016
3016
 
3017
3017
protected:
3018
3018
  /* 
3021
3021
  */
3022
3022
  Rows_log_event(THD*, Table*, ulong table_id, 
3023
3023
                 MY_BITMAP const *cols, bool is_transactional);
3024
 
  Rows_log_event(const char *row_data, uint event_len, 
 
3024
  Rows_log_event(const char *row_data, uint32_t event_len, 
3025
3025
                 Log_event_type event_type,
3026
3026
                 const Format_description_log_event *description_event);
3027
3027
 
3155
3155
 
3156
3156
  Write_rows_log_event(THD*, Table*, ulong table_id, 
3157
3157
                       bool is_transactional);
3158
 
  Write_rows_log_event(const char *buf, uint event_len, 
 
3158
  Write_rows_log_event(const char *buf, uint32_t event_len, 
3159
3159
                       const Format_description_log_event *description_event);
3160
3160
  static bool binlog_row_logging_function(THD *thd, Table *table,
3161
3161
                                          bool is_transactional,
3203
3203
 
3204
3204
  virtual ~Update_rows_log_event();
3205
3205
 
3206
 
  Update_rows_log_event(const char *buf, uint event_len, 
 
3206
  Update_rows_log_event(const char *buf, uint32_t event_len, 
3207
3207
                        const Format_description_log_event *description_event);
3208
3208
 
3209
3209
  static bool binlog_row_logging_function(THD *thd, Table *table,
3259
3259
 
3260
3260
  Delete_rows_log_event(THD*, Table*, ulong, 
3261
3261
                        bool is_transactional);
3262
 
  Delete_rows_log_event(const char *buf, uint event_len, 
 
3262
  Delete_rows_log_event(const char *buf, uint32_t event_len, 
3263
3263
                        const Format_description_log_event *description_event);
3264
3264
  static bool binlog_row_logging_function(THD *thd, Table *table,
3265
3265
                                          bool is_transactional,
3334
3334
 
3335
3335
  void pack_info(Protocol*);
3336
3336
 
3337
 
  Incident_log_event(const char *buf, uint event_len,
 
3337
  Incident_log_event(const char *buf, uint32_t event_len,
3338
3338
                     const Format_description_log_event *descr_event);
3339
3339
 
3340
3340
  virtual ~Incident_log_event();
3387
3387
class Heartbeat_log_event: public Log_event
3388
3388
{
3389
3389
public:
3390
 
  Heartbeat_log_event(const char* buf, uint event_len,
 
3390
  Heartbeat_log_event(const char* buf, uint32_t event_len,
3391
3391
                      const Format_description_log_event* description_event);
3392
3392
  Log_event_type get_type_code() { return HEARTBEAT_LOG_EVENT; }
3393
3393
  bool is_valid() const
3396
3396
              log_pos >= BIN_LOG_HEADER_SIZE);
3397
3397
    }
3398
3398
  const char * get_log_ident() { return log_ident; }
3399
 
  uint get_ident_len() { return ident_len; }
 
3399
  uint32_t get_ident_len() { return ident_len; }
3400
3400
  
3401
3401
private:
3402
3402
  const char* log_ident;
3403
 
  uint ident_len;
 
3403
  uint32_t ident_len;
3404
3404
};
3405
3405
 
3406
3406
/**