~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/replication/rli.h

  • Committer: Monty Taylor
  • Date: 2008-11-13 22:41:09 UTC
  • mto: (589.1.3 devel) (584.1.7 devel)
  • mto: This revision was merged to the branch mainline in revision 585.
  • Revision ID: monty@inaugust.com-20081113224109-4rkzdtn5f2ppzf9q
Check gnu ld status rather than gcc status (you never know)

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
    a different log under our feet
135
135
  */
136
136
  uint32_t cur_log_old_open_count;
137
 
 
 
137
  
138
138
  /*
139
139
    Let's call a group (of events) :
140
140
      - a transaction
163
163
  bool is_fake; /* Mark that this is a fake relay log info structure */
164
164
#endif
165
165
 
166
 
  /*
 
166
  /* 
167
167
     Original log name and position of the group we're currently executing
168
168
     (whose coordinates are group_relay_log_name/pos in the relay log)
169
169
     in the master's binlog. These concern the *group*, because in the master's
212
212
  volatile bool abort_slave;
213
213
  volatile uint32_t slave_running;
214
214
 
215
 
  /*
 
215
  /* 
216
216
     Condition and its parameters from START SLAVE UNTIL clause.
217
 
 
218
 
     UNTIL condition is tested with is_until_satisfied() method that is
 
217
     
 
218
     UNTIL condition is tested with is_until_satisfied() method that is 
219
219
     called by exec_relay_log_event(). is_until_satisfied() caches the result
220
220
     of the comparison of log names because log names don't change very often;
221
221
     this cache is invalidated by parts of code which change log names with
222
222
     notify_*_log_name_updated() methods. (They need to be called only if SQL
223
223
     thread is running).
224
224
   */
225
 
 
 
225
  
226
226
  enum {UNTIL_NONE= 0, UNTIL_MASTER_POS, UNTIL_RELAY_POS} until_condition;
227
227
  char until_log_name[FN_REFLEN];
228
228
  uint64_t until_log_pos;
229
229
  /* extension extracted from log_name and converted to int32_t */
230
 
  uint32_t until_log_name_extension;
231
 
  /*
 
230
  uint32_t until_log_name_extension;   
 
231
  /* 
232
232
     Cached result of comparison of until_log_name and current log name
233
 
     -2 means unitialised, -1,0,1 are comarison results
 
233
     -2 means unitialised, -1,0,1 are comarison results 
234
234
  */
235
 
  enum
236
 
  {
 
235
  enum 
 
236
  { 
237
237
    UNTIL_LOG_NAMES_CMP_UNKNOWN= -2, UNTIL_LOG_NAMES_CMP_LESS= -1,
238
238
    UNTIL_LOG_NAMES_CMP_EQUAL= 0, UNTIL_LOG_NAMES_CMP_GREATER= 1
239
239
  } until_log_names_cmp_result;
262
262
  ~Relay_log_info();
263
263
 
264
264
  /*
265
 
    Invalidate cached until_log_name and group_relay_log_name comparison
 
265
    Invalidate cached until_log_name and group_relay_log_name comparison 
266
266
    result. Should be called after any update of group_realy_log_name if
267
267
    there chances that sql_thread is running.
268
268
  */
273
273
  }
274
274
 
275
275
  /*
276
 
    The same as previous but for group_master_log_name.
 
276
    The same as previous but for group_master_log_name. 
277
277
  */
278
278
  inline void notify_group_master_log_name_update()
279
279
  {
280
280
    if (until_condition==UNTIL_MASTER_POS)
281
281
      until_log_names_cmp_result= UNTIL_LOG_NAMES_CMP_UNKNOWN;
282
282
  }
283
 
 
 
283
  
284
284
  inline void inc_event_relay_log_pos()
285
285
  {
286
286
    event_relay_log_pos= future_event_relay_log_pos;
289
289
  void inc_group_relay_log_pos(uint64_t log_pos,
290
290
                               bool skip_lock=0);
291
291
 
292
 
  int32_t wait_for_pos(Session* session, String* log_name, int64_t log_pos,
 
292
  int32_t wait_for_pos(Session* session, String* log_name, int64_t log_pos, 
293
293
                   int64_t timeout);
294
294
  void close_temporary_tables();
295
295
 
390
390
     @retval true Replication thread is currently inside a group
391
391
     @retval false Replication thread is currently not inside a group
392
392
   */
393
 
  bool is_in_group() const;
 
393
  bool is_in_group() const {
 
394
    return (sql_session->options & OPTION_BEGIN) ||
 
395
      (m_flags & (1UL << IN_STMT));
 
396
  }
394
397
 
395
398
private:
396
399
  uint32_t m_flags;