~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log_event.cc

  • Committer: Monty Taylor
  • Date: 2008-10-02 01:31:53 UTC
  • mfrom: (398.1.6 codestyle-new)
  • Revision ID: monty@inaugust.com-20081002013153-b097om921cd3j1pn
MergedĀ fromĀ stdint-includes-fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <mysys/my_dir.h>
26
26
#include <drizzled/drizzled_error_messages.h>
27
27
 
 
28
#include <algorithm>
 
29
 
28
30
#endif /* !DRIZZLE_CLIENT */
29
31
 
30
32
#include <mysys/base64.h>
931
933
    of 13 bytes, whereas LOG_EVENT_MINIMAL_HEADER_LEN is 19 bytes (it's
932
934
    "minimal" over the set {MySQL >=4.0}).
933
935
  */
934
 
  uint header_size= min(description_event->common_header_len,
 
936
  uint header_size= cmin(description_event->common_header_len,
935
937
                        LOG_EVENT_MINIMAL_HEADER_LEN);
936
938
 
937
939
  LOCK_MUTEX;
1803
1805
      be even bigger, but this will suffice to catch most corruption
1804
1806
      errors that can lead to a crash.
1805
1807
    */
1806
 
    if (status_vars_len > min(data_len, (uint32_t)MAX_SIZE_LOG_EVENT_STATUS))
 
1808
    if (status_vars_len > cmin(data_len, (uint32_t)MAX_SIZE_LOG_EVENT_STATUS))
1807
1809
    {
1808
1810
      query= 0;
1809
1811
      return;
2177
2179
    thd->set_time((time_t)when);
2178
2180
    thd->query_length= q_len_arg;
2179
2181
    thd->query= (char*)query_arg;
2180
 
    VOID(pthread_mutex_lock(&LOCK_thread_count));
 
2182
    pthread_mutex_lock(&LOCK_thread_count);
2181
2183
    thd->query_id = next_query_id();
2182
 
    VOID(pthread_mutex_unlock(&LOCK_thread_count));
 
2184
    pthread_mutex_unlock(&LOCK_thread_count);
2183
2185
    thd->variables.pseudo_thread_id= thread_id;         // for temp tables
2184
2186
 
2185
2187
    if (ignored_error_code((expected_error= error_code)) ||
2362
2364
  } /* End of if (db_ok(... */
2363
2365
 
2364
2366
end:
2365
 
  VOID(pthread_mutex_lock(&LOCK_thread_count));
 
2367
  pthread_mutex_lock(&LOCK_thread_count);
2366
2368
  /*
2367
2369
    Probably we have set thd->query, thd->db, thd->catalog to point to places
2368
2370
    in the data_buf of this event. Now the event is going to be deleted
2377
2379
  thd->set_db(NULL, 0);                 /* will free the current database */
2378
2380
  thd->query= 0;                        // just to be sure
2379
2381
  thd->query_length= 0;
2380
 
  VOID(pthread_mutex_unlock(&LOCK_thread_count));
 
2382
  pthread_mutex_unlock(&LOCK_thread_count);
2381
2383
  close_thread_tables(thd);      
2382
2384
  /*
2383
2385
    As a disk space optimization, future masters will not log an event for
3560
3562
  if (rpl_filter->db_ok(thd->db))
3561
3563
  {
3562
3564
    thd->set_time((time_t)when);
3563
 
    VOID(pthread_mutex_lock(&LOCK_thread_count));
 
3565
    pthread_mutex_lock(&LOCK_thread_count);
3564
3566
    thd->query_id = next_query_id();
3565
 
    VOID(pthread_mutex_unlock(&LOCK_thread_count));
 
3567
    pthread_mutex_unlock(&LOCK_thread_count);
3566
3568
    /*
3567
3569
      Initing thd->row_count is not necessary in theory as this variable has no
3568
3570
      influence in the case of the slave SQL thread (it is used to generate a
3716
3718
error:
3717
3719
  thd->net.vio = 0; 
3718
3720
  const char *remember_db= thd->db;
3719
 
  VOID(pthread_mutex_lock(&LOCK_thread_count));
 
3721
  pthread_mutex_lock(&LOCK_thread_count);
3720
3722
  thd->catalog= 0;
3721
3723
  thd->set_db(NULL, 0);                   /* will free the current database */
3722
3724
  thd->query= 0;
3723
3725
  thd->query_length= 0;
3724
 
  VOID(pthread_mutex_unlock(&LOCK_thread_count));
 
3726
  pthread_mutex_unlock(&LOCK_thread_count);
3725
3727
  close_thread_tables(thd);
3726
3728
 
3727
3729
  if (thd->is_slave_error)