~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_repl.cc

  • Committer: Monty Taylor
  • Date: 2008-10-06 04:45:56 UTC
  • mfrom: (438.1.13 drizzle)
  • Revision ID: monty@inaugust.com-20081006044556-5urk8k3yhnnl3o1p
Merged in from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include <drizzled/server_includes.h>
17
17
 
18
 
#ifdef HAVE_REPLICATION
19
18
#include "rpl_mi.h"
20
19
#include "sql_repl.h"
21
20
#include "log_event.h"
53
52
  header[EVENT_TYPE_OFFSET] = ROTATE_EVENT;
54
53
 
55
54
  char* p = log_file_name+dirname_length(log_file_name);
56
 
  uint ident_len = (uint) strlen(p);
 
55
  uint32_t ident_len = (uint32_t) strlen(p);
57
56
  uint32_t event_len = ident_len + LOG_EVENT_HEADER_LEN + ROTATE_HEADER_LEN;
58
57
  int4store(header + SERVER_ID_OFFSET, server_id);
59
58
  int4store(header + EVENT_LEN_OFFSET, event_len);
223
222
 
224
223
bool purge_error_message(THD* thd, int res)
225
224
{
226
 
  uint errmsg= 0;
 
225
  uint32_t errmsg= 0;
227
226
 
228
227
  switch (res)  {
229
228
  case 0: break;
352
351
 
353
352
  char* p= coord->file_name + dirname_length(coord->file_name);
354
353
 
355
 
  uint ident_len = strlen(p);
 
354
  uint32_t ident_len = strlen(p);
356
355
  uint32_t event_len = ident_len + LOG_EVENT_HEADER_LEN;
357
356
  int4store(header + SERVER_ID_OFFSET, server_id);
358
357
  int4store(header + EVENT_LEN_OFFSET, event_len);
377
376
*/
378
377
 
379
378
void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
380
 
                       ushort flags)
 
379
                       uint16_t flags)
381
380
{
382
381
  LOG_INFO linfo;
383
382
  char *log_file_name = linfo.log_file_name;
1020
1019
  struct stat stat_area;
1021
1020
  char fname[FN_REFLEN];
1022
1021
  int thread_mask= 0, error= 0;
1023
 
  uint sql_errno=0;
 
1022
  uint32_t sql_errno=0;
1024
1023
  const char* errmsg=0;
1025
1024
 
1026
1025
  lock_slave_threads(mi);
1349
1348
                   const char* log_file_name2, uint64_t log_pos2)
1350
1349
{
1351
1350
  int res;
1352
 
  uint log_file_name1_len=  strlen(log_file_name1);
1353
 
  uint log_file_name2_len=  strlen(log_file_name2);
 
1351
  uint32_t log_file_name1_len=  strlen(log_file_name1);
 
1352
  uint32_t log_file_name2_len=  strlen(log_file_name2);
1354
1353
 
1355
1354
  //  We assume that both log names match up to '.'
1356
1355
  if (log_file_name1_len == log_file_name2_len)
1556
1555
  File file;
1557
1556
  char fname[FN_REFLEN];
1558
1557
  List<Item> field_list;
1559
 
  uint length;
 
1558
  uint32_t length;
1560
1559
  int cur_dir_len;
1561
1560
  Protocol *protocol= thd->protocol;
1562
1561
 
1633
1632
int log_loaded_block(IO_CACHE* file)
1634
1633
{
1635
1634
  LOAD_FILE_INFO *lf_info;
1636
 
  uint block_len;
 
1635
  uint32_t block_len;
1637
1636
  /* buffer contains position where we started last read */
1638
1637
  uchar* buffer= (uchar*) my_b_get_buffer_start(file);
1639
 
  uint max_event_size= current_thd->variables.max_allowed_packet;
 
1638
  uint32_t max_event_size= current_thd->variables.max_allowed_packet;
1640
1639
  lf_info= (LOAD_FILE_INFO*) file->arg;
1641
1640
  if (lf_info->thd->current_stmt_binlog_row_based)
1642
1641
    return(0);
1700
1699
static void fix_slave_net_timeout(THD *thd,
1701
1700
                                  enum_var_type type __attribute__((unused)))
1702
1701
{
1703
 
#ifdef HAVE_REPLICATION
1704
1702
  pthread_mutex_lock(&LOCK_active_mi);
1705
1703
  if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
1706
1704
    push_warning_printf(thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1710
1708
                        " A sensible value for the period should be"
1711
1709
                        " less than the timeout.");
1712
1710
  pthread_mutex_unlock(&LOCK_active_mi);
1713
 
#endif
1714
1711
  return;
1715
1712
}
1716
1713
 
1840
1837
  }
1841
1838
  return 0;
1842
1839
}
1843
 
 
1844
 
#endif /* HAVE_REPLICATION */