~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log_event.h

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
547
547
 
548
548
class String;
549
549
class DRIZZLE_BIN_LOG;
550
 
class THD;
 
550
class Session;
551
551
 
552
552
class Format_description_log_event;
553
553
class Relay_log_info;
785
785
  */
786
786
  ulong slave_exec_mode;
787
787
 
788
 
  THD* thd;
 
788
  Session* thd;
789
789
 
790
790
  Log_event();
791
 
  Log_event(THD* thd_arg, uint16_t flags_arg, bool cache_stmt);
 
791
  Log_event(Session* thd_arg, uint16_t flags_arg, bool cache_stmt);
792
792
  /*
793
793
    read_log_event() functions read an event from a binlog or relay
794
794
    log; used by SHOW BINLOG EVENTS, the binlog_dump thread on the
854
854
  { return 0; }
855
855
  inline time_t get_time()
856
856
  {
857
 
    THD *tmp_thd;
 
857
    Session *tmp_thd;
858
858
    if (when)
859
859
      return when;
860
860
    if (thd)
1452
1452
  uint32_t charset_database_number;
1453
1453
 
1454
1454
 
1455
 
  Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length,
 
1455
  Query_log_event(Session* thd_arg, const char* query_arg, ulong query_length,
1456
1456
                  bool using_trans, bool suppress_use,
1457
 
                  THD::killed_state killed_err_arg= THD::KILLED_NO_VALUE);
 
1457
                  Session::killed_state killed_err_arg= Session::KILLED_NO_VALUE);
1458
1458
  const char* get_db() { return db; }
1459
1459
  void pack_info(Protocol* protocol);
1460
1460
 
1551
1551
  std::string master_log;
1552
1552
  uint16_t master_port;
1553
1553
 
1554
 
  Slave_log_event(THD* thd_arg, Relay_log_info* rli);
 
1554
  Slave_log_event(Session* thd_arg, Relay_log_info* rli);
1555
1555
  void pack_info(Protocol* protocol);
1556
1556
 
1557
1557
  Slave_log_event(const char* buf, uint32_t event_len);
1815
1815
  String field_lens_buf;
1816
1816
  String fields_buf;
1817
1817
 
1818
 
  Load_log_event(THD* thd, sql_exchange* ex, const char* db_arg,
 
1818
  Load_log_event(Session* thd, sql_exchange* ex, const char* db_arg,
1819
1819
                 const char* table_name_arg,
1820
1820
                 List<Item>& fields_arg, enum enum_duplicates handle_dup, bool ignore,
1821
1821
                 bool using_trans);
2050
2050
  uint64_t val;
2051
2051
  unsigned char type;
2052
2052
 
2053
 
  Intvar_log_event(THD* thd_arg,unsigned char type_arg, uint64_t val_arg)
 
2053
  Intvar_log_event(Session* thd_arg,unsigned char type_arg, uint64_t val_arg)
2054
2054
    :Log_event(thd_arg,0,0),val(val_arg),type(type_arg)
2055
2055
  {}
2056
2056
  void pack_info(Protocol* protocol);
2115
2115
  uint64_t seed1;
2116
2116
  uint64_t seed2;
2117
2117
 
2118
 
  Rand_log_event(THD* thd_arg, uint64_t seed1_arg, uint64_t seed2_arg)
 
2118
  Rand_log_event(Session* thd_arg, uint64_t seed1_arg, uint64_t seed2_arg)
2119
2119
    :Log_event(thd_arg,0,0),seed1(seed1_arg),seed2(seed2_arg)
2120
2120
  {}
2121
2121
  void pack_info(Protocol* protocol);
2147
2147
 public:
2148
2148
   my_xid xid;
2149
2149
 
2150
 
  Xid_log_event(THD* thd_arg, my_xid x): Log_event(thd_arg,0,0), xid(x) {}
 
2150
  Xid_log_event(Session* thd_arg, my_xid x): Log_event(thd_arg,0,0), xid(x) {}
2151
2151
  void pack_info(Protocol* protocol);
2152
2152
 
2153
2153
  Xid_log_event(const char* buf,
2182
2182
  Item_result type;
2183
2183
  uint32_t charset_number;
2184
2184
  bool is_null;
2185
 
  User_var_log_event(THD* thd_arg __attribute__((unused)),
 
2185
  User_var_log_event(Session* thd_arg __attribute__((unused)),
2186
2186
                     char *name_arg, uint32_t name_len_arg,
2187
2187
                     char *val_arg, ulong val_len_arg, Item_result type_arg,
2188
2188
                     uint32_t charset_number_arg)
2348
2348
  uint32_t file_id;
2349
2349
  bool inited_from_old;
2350
2350
 
2351
 
  Create_file_log_event(THD* thd, sql_exchange* ex, const char* db_arg,
 
2351
  Create_file_log_event(Session* thd, sql_exchange* ex, const char* db_arg,
2352
2352
                        const char* table_name_arg,
2353
2353
                        List<Item>& fields_arg,
2354
2354
                        enum enum_duplicates handle_dup, bool ignore,
2412
2412
  */
2413
2413
  const char* db;
2414
2414
 
2415
 
  Append_block_log_event(THD* thd, const char* db_arg, unsigned char* block_arg,
 
2415
  Append_block_log_event(Session* thd, const char* db_arg, unsigned char* block_arg,
2416
2416
                         uint32_t block_len_arg, bool using_trans);
2417
2417
  void pack_info(Protocol* protocol);
2418
2418
  virtual int get_create_or_append() const;
2444
2444
  uint32_t file_id;
2445
2445
  const char* db; /* see comment in Append_block_log_event */
2446
2446
 
2447
 
  Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans);
 
2447
  Delete_file_log_event(Session* thd, const char* db_arg, bool using_trans);
2448
2448
  void pack_info(Protocol* protocol);
2449
2449
 
2450
2450
  Delete_file_log_event(const char* buf, uint32_t event_len,
2473
2473
  uint32_t file_id;
2474
2474
  const char* db; /* see comment in Append_block_log_event */
2475
2475
 
2476
 
  Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans);
 
2476
  Execute_load_log_event(Session* thd, const char* db_arg, bool using_trans);
2477
2477
  void pack_info(Protocol* protocol);
2478
2478
 
2479
2479
  Execute_load_log_event(const char* buf, uint32_t event_len,
2503
2503
class Begin_load_query_log_event: public Append_block_log_event
2504
2504
{
2505
2505
public:
2506
 
  Begin_load_query_log_event(THD* thd_arg, const char *db_arg,
 
2506
  Begin_load_query_log_event(Session* thd_arg, const char *db_arg,
2507
2507
                             unsigned char* block_arg, uint32_t block_len_arg,
2508
2508
                             bool using_trans);
2509
 
  Begin_load_query_log_event(THD* thd);
 
2509
  Begin_load_query_log_event(Session* thd);
2510
2510
  int get_create_or_append() const;
2511
2511
  Begin_load_query_log_event(const char* buf, uint32_t event_len,
2512
2512
                             const Format_description_log_event
2548
2548
  */
2549
2549
  enum_load_dup_handling dup_handling;
2550
2550
 
2551
 
  Execute_load_query_log_event(THD* thd, const char* query_arg,
 
2551
  Execute_load_query_log_event(Session* thd, const char* query_arg,
2552
2552
                               ulong query_length, uint32_t fn_pos_start_arg,
2553
2553
                               uint32_t fn_pos_end_arg,
2554
2554
                               enum_load_dup_handling dup_handling_arg,
2555
2555
                               bool using_trans, bool suppress_use,
2556
 
                               THD::killed_state
2557
 
                               killed_err_arg= THD::KILLED_NO_VALUE);
 
2556
                               Session::killed_state
 
2557
                               killed_err_arg= Session::KILLED_NO_VALUE);
2558
2558
  void pack_info(Protocol* protocol);
2559
2559
  Execute_load_query_log_event(const char* buf, uint32_t event_len,
2560
2560
                               const Format_description_log_event
2865
2865
  void clear_flags(flag_set flag) { m_flags &= ~flag; }
2866
2866
  flag_set get_flags(flag_set flag) const { return m_flags & flag; }
2867
2867
 
2868
 
  Table_map_log_event(THD *thd, Table *tbl, ulong tid, 
 
2868
  Table_map_log_event(Session *thd, Table *tbl, ulong tid, 
2869
2869
                      bool is_transactional, uint16_t flags);
2870
2870
  Table_map_log_event(const char *buf, uint32_t event_len, 
2871
2871
                      const Format_description_log_event *description_event);
3016
3016
     The constructors are protected since you're supposed to inherit
3017
3017
     this class, not create instances of this class.
3018
3018
  */
3019
 
  Rows_log_event(THD*, Table*, ulong table_id, 
 
3019
  Rows_log_event(Session*, Table*, ulong table_id, 
3020
3020
                 MY_BITMAP const *cols, bool is_transactional);
3021
3021
  Rows_log_event(const char *row_data, uint32_t event_len, 
3022
3022
                 Log_event_type event_type,
3146
3146
public:
3147
3147
  enum 
3148
3148
  {
3149
 
    /* Support interface to THD::binlog_prepare_pending_rows_event */
 
3149
    /* Support interface to Session::binlog_prepare_pending_rows_event */
3150
3150
    TYPE_CODE = WRITE_ROWS_EVENT
3151
3151
  };
3152
3152
 
3153
 
  Write_rows_log_event(THD*, Table*, ulong table_id, 
 
3153
  Write_rows_log_event(Session*, Table*, ulong table_id, 
3154
3154
                       bool is_transactional);
3155
3155
  Write_rows_log_event(const char *buf, uint32_t event_len, 
3156
3156
                       const Format_description_log_event *description_event);
3157
 
  static bool binlog_row_logging_function(THD *thd, Table *table,
 
3157
  static bool binlog_row_logging_function(Session *thd, Table *table,
3158
3158
                                          bool is_transactional,
3159
3159
                                          const unsigned char *before_record
3160
3160
                                          __attribute__((unused)),
3189
3189
public:
3190
3190
  enum 
3191
3191
  {
3192
 
    /* Support interface to THD::binlog_prepare_pending_rows_event */
 
3192
    /* Support interface to Session::binlog_prepare_pending_rows_event */
3193
3193
    TYPE_CODE = UPDATE_ROWS_EVENT
3194
3194
  };
3195
3195
 
3196
 
  Update_rows_log_event(THD*, Table*, ulong table_id,
 
3196
  Update_rows_log_event(Session*, Table*, ulong table_id,
3197
3197
                        bool is_transactional);
3198
3198
 
3199
3199
  void init(MY_BITMAP const *cols);
3203
3203
  Update_rows_log_event(const char *buf, uint32_t event_len, 
3204
3204
                        const Format_description_log_event *description_event);
3205
3205
 
3206
 
  static bool binlog_row_logging_function(THD *thd, Table *table,
 
3206
  static bool binlog_row_logging_function(Session *thd, Table *table,
3207
3207
                                          bool is_transactional,
3208
3208
                                          const unsigned char *before_record,
3209
3209
                                          const unsigned char *after_record)
3250
3250
public:
3251
3251
  enum 
3252
3252
  {
3253
 
    /* Support interface to THD::binlog_prepare_pending_rows_event */
 
3253
    /* Support interface to Session::binlog_prepare_pending_rows_event */
3254
3254
    TYPE_CODE = DELETE_ROWS_EVENT
3255
3255
  };
3256
3256
 
3257
 
  Delete_rows_log_event(THD*, Table*, ulong, 
 
3257
  Delete_rows_log_event(Session*, Table*, ulong, 
3258
3258
                        bool is_transactional);
3259
3259
  Delete_rows_log_event(const char *buf, uint32_t event_len, 
3260
3260
                        const Format_description_log_event *description_event);
3261
 
  static bool binlog_row_logging_function(THD *thd, Table *table,
 
3261
  static bool binlog_row_logging_function(Session *thd, Table *table,
3262
3262
                                          bool is_transactional,
3263
3263
                                          const unsigned char *before_record,
3264
3264
                                          const unsigned char *after_record
3314
3314
*/
3315
3315
class Incident_log_event : public Log_event {
3316
3316
public:
3317
 
  Incident_log_event(THD *thd_arg, Incident incident)
 
3317
  Incident_log_event(Session *thd_arg, Incident incident)
3318
3318
    : Log_event(thd_arg, 0, false), m_incident(incident)
3319
3319
  {
3320
3320
    m_message.str= NULL;                    /* Just as a precaution */
3322
3322
    return;
3323
3323
  }
3324
3324
 
3325
 
  Incident_log_event(THD *thd_arg, Incident incident, LEX_STRING const msg)
 
3325
  Incident_log_event(Session *thd_arg, Incident incident, LEX_STRING const msg)
3326
3326
    : Log_event(thd_arg, 0, false), m_incident(incident)
3327
3327
  {
3328
3328
    m_message= msg;