~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_repl.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 04:28:21 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-20081020042821-rqqdrccuu8195k3y
Second pass of thd cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
  return(0);
74
74
}
75
75
 
76
 
static int send_file(Session *thd)
 
76
static int send_file(Session *session)
77
77
{
78
 
  NET* net = &thd->net;
 
78
  NET* net = &session->net;
79
79
  int fd = -1, error = 1;
80
80
  size_t bytes;
81
81
  char fname[FN_REFLEN+1];
89
89
    the job
90
90
  */
91
91
  old_timeout= net->read_timeout;
92
 
  my_net_set_read_timeout(net, thd->variables.net_wait_timeout);
 
92
  my_net_set_read_timeout(net, session->variables.net_wait_timeout);
93
93
 
94
94
  /*
95
95
    We need net_flush here because the client will not know it needs to send
220
220
  return result;
221
221
}
222
222
 
223
 
bool purge_error_message(Session* thd, int res)
 
223
bool purge_error_message(Session* session, int res)
224
224
{
225
225
  uint32_t errmsg= 0;
226
226
 
242
242
    my_message(errmsg, ER(errmsg), MYF(0));
243
243
    return true;
244
244
  }
245
 
  my_ok(thd);
 
245
  my_ok(session);
246
246
  return false;
247
247
}
248
248
 
249
249
 
250
 
bool purge_master_logs(Session* thd, const char* to_log)
 
250
bool purge_master_logs(Session* session, const char* to_log)
251
251
{
252
252
  char search_file_name[FN_REFLEN];
253
253
  if (!mysql_bin_log.is_open())
254
254
  {
255
 
    my_ok(thd);
 
255
    my_ok(session);
256
256
    return false;
257
257
  }
258
258
 
259
259
  mysql_bin_log.make_log_name(search_file_name, to_log);
260
 
  return purge_error_message(thd,
 
260
  return purge_error_message(session,
261
261
                             mysql_bin_log.purge_logs(search_file_name, 0, 1,
262
262
                                                      1, NULL));
263
263
}
264
264
 
265
265
 
266
 
bool purge_master_logs_before_date(Session* thd, time_t purge_time)
 
266
bool purge_master_logs_before_date(Session* session, time_t purge_time)
267
267
{
268
268
  if (!mysql_bin_log.is_open())
269
269
  {
270
 
    my_ok(thd);
 
270
    my_ok(session);
271
271
    return 0;
272
272
  }
273
 
  return purge_error_message(thd,
 
273
  return purge_error_message(session,
274
274
                             mysql_bin_log.purge_logs_before_date(purge_time));
275
275
}
276
276
 
308
308
  An auxiliary function for calling in mysql_binlog_send
309
309
  to initialize the heartbeat timeout in waiting for a binlogged event.
310
310
 
311
 
  @param[in]    thd  Session to access a user variable
 
311
  @param[in]    session  Session to access a user variable
312
312
 
313
313
  @return        heartbeat period an uint64_t of nanoseconds
314
314
                 or zero if heartbeat was not demanded by slave
315
315
*/ 
316
 
static uint64_t get_heartbeat_period(Session * thd)
 
316
static uint64_t get_heartbeat_period(Session * session)
317
317
{
318
318
  bool null_value;
319
319
  LEX_STRING name=  { C_STRING_WITH_LEN("master_heartbeat_period")};
320
320
  user_var_entry *entry= 
321
 
    (user_var_entry*) hash_search(&thd->user_vars, (unsigned char*) name.str,
 
321
    (user_var_entry*) hash_search(&session->user_vars, (unsigned char*) name.str,
322
322
                                  name.length);
323
323
  return entry? entry->val_int(&null_value) : 0;
324
324
}
375
375
  TODO: Clean up loop to only have one call to send_file()
376
376
*/
377
377
 
378
 
void mysql_binlog_send(Session* thd, char* log_ident, my_off_t pos,
 
378
void mysql_binlog_send(Session* session, char* log_ident, my_off_t pos,
379
379
                       uint16_t flags)
380
380
{
381
381
  LOG_INFO linfo;
383
383
  char search_file_name[FN_REFLEN], *name;
384
384
  IO_CACHE log;
385
385
  File file = -1;
386
 
  String* packet = &thd->packet;
 
386
  String* packet = &session->packet;
387
387
  int error;
388
388
  const char *errmsg = "Unknown error";
389
 
  NET* net = &thd->net;
 
389
  NET* net = &session->net;
390
390
  pthread_mutex_t *log_lock;
391
391
  bool binlog_can_be_corrupted= false;
392
392
 
394
394
  /* 
395
395
     heartbeat_period from @master_heartbeat_period user variable
396
396
  */
397
 
  uint64_t heartbeat_period= get_heartbeat_period(thd);
 
397
  uint64_t heartbeat_period= get_heartbeat_period(session);
398
398
  struct timespec heartbeat_buf;
399
399
  struct event_coordinates coord_buf;
400
400
  struct timespec *heartbeat_ts= NULL;
437
437
  }
438
438
 
439
439
  pthread_mutex_lock(&LOCK_thread_count);
440
 
  thd->current_linfo = &linfo;
 
440
  session->current_linfo = &linfo;
441
441
  pthread_mutex_unlock(&LOCK_thread_count);
442
442
 
443
443
  if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0)
503
503
    this larger than the corresponding packet (query) sent 
504
504
    from client to master.
505
505
  */
506
 
  thd->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER;
 
506
  session->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER;
507
507
 
508
508
  /*
509
509
    We can set log_lock now, it does not move (it's a member of
576
576
  /* seek to the requested position, to start the requested dump */
577
577
  my_b_seek(&log, pos);                 // Seek will done on next read
578
578
 
579
 
  while (!net->error && net->vio != 0 && !thd->killed)
 
579
  while (!net->error && net->vio != 0 && !session->killed)
580
580
  {
581
581
    while (!(error = Log_event::read_log_event(&log, packet, log_lock)))
582
582
    {
604
604
 
605
605
      if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
606
606
      {
607
 
        if (send_file(thd))
 
607
        if (send_file(session))
608
608
        {
609
609
          errmsg = "failed in send_file()";
610
610
          my_errno= ER_UNKNOWN_ERROR;
676
676
        case LOG_READ_EOF:
677
677
        {
678
678
          int ret;
679
 
          if (thd->server_id==0) // for mysqlbinlog (mysqlbinlog.server_id==0)
 
679
          if (session->server_id==0) // for mysqlbinlog (mysqlbinlog.server_id==0)
680
680
          {
681
681
            pthread_mutex_unlock(log_lock);
682
682
            goto end;
689
689
              assert(heartbeat_ts && heartbeat_period != 0L);
690
690
              set_timespec_nsec(*heartbeat_ts, heartbeat_period);
691
691
            }
692
 
            ret= mysql_bin_log.wait_for_update_bin_log(thd, heartbeat_ts);
 
692
            ret= mysql_bin_log.wait_for_update_bin_log(session, heartbeat_ts);
693
693
            assert(ret == 0 || (heartbeat_period != 0L && coord != NULL));
694
694
            if (ret == ETIMEDOUT || ret == ETIME)
695
695
            {
705
705
            {
706
706
              assert(ret == 0);
707
707
            }
708
 
          } while (ret != 0 && coord != NULL && !thd->killed);
 
708
          } while (ret != 0 && coord != NULL && !session->killed);
709
709
          pthread_mutex_unlock(log_lock);
710
710
        }    
711
711
        break;
718
718
 
719
719
        if (read_packet)
720
720
        {
721
 
          thd->set_proc_info("Sending binlog event to slave");
 
721
          session->set_proc_info("Sending binlog event to slave");
722
722
          if (my_net_write(net, (unsigned char*) packet->ptr(), packet->length()) )
723
723
          {
724
724
            errmsg = "Failed on my_net_write()";
728
728
 
729
729
          if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
730
730
          {
731
 
            if (send_file(thd))
 
731
            if (send_file(session))
732
732
            {
733
733
              errmsg = "failed in send_file()";
734
734
              my_errno= ER_UNKNOWN_ERROR;
756
756
      bool loop_breaker = 0;
757
757
      /* need this to break out of the for loop from switch */
758
758
 
759
 
      thd->set_proc_info("Finished reading one binlog; switching to next binlog");
 
759
      session->set_proc_info("Finished reading one binlog; switching to next binlog");
760
760
      switch (mysql_bin_log.find_next_log(&linfo, 1)) {
761
761
      case LOG_INFO_EOF:
762
762
        loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
803
803
  end_io_cache(&log);
804
804
  (void)my_close(file, MYF(MY_WME));
805
805
 
806
 
  my_eof(thd);
807
 
  thd->set_proc_info("Waiting to finalize termination");
 
806
  my_eof(session);
 
807
  session->set_proc_info("Waiting to finalize termination");
808
808
  pthread_mutex_lock(&LOCK_thread_count);
809
 
  thd->current_linfo = 0;
 
809
  session->current_linfo = 0;
810
810
  pthread_mutex_unlock(&LOCK_thread_count);
811
811
  return;
812
812
 
813
813
err:
814
 
  thd->set_proc_info("Waiting to finalize termination");
 
814
  session->set_proc_info("Waiting to finalize termination");
815
815
  end_io_cache(&log);
816
816
  /*
817
817
    Exclude  iteration through thread list
818
818
    this is needed for purge_logs() - it will iterate through
819
 
    thread list and update thd->current_linfo->index_file_offset
 
819
    thread list and update session->current_linfo->index_file_offset
820
820
    this mutex will make sure that it never tried to update our linfo
821
821
    after we return from this stack frame
822
822
  */
823
823
  pthread_mutex_lock(&LOCK_thread_count);
824
 
  thd->current_linfo = 0;
 
824
  session->current_linfo = 0;
825
825
  pthread_mutex_unlock(&LOCK_thread_count);
826
826
  if (file >= 0)
827
827
    (void) my_close(file, MYF(MY_WME));
830
830
  return;
831
831
}
832
832
 
833
 
int start_slave(Session* thd , Master_info* mi,  bool net_report)
 
833
int start_slave(Session* session , Master_info* mi,  bool net_report)
834
834
{
835
835
  int slave_errno= 0;
836
836
  int thread_mask;
844
844
    don't wan't to touch the other thread), so set the bit to 0 for the
845
845
    other thread
846
846
  */
847
 
  if (thd->lex->slave_thd_opt)
848
 
    thread_mask&= thd->lex->slave_thd_opt;
 
847
  if (session->lex->slave_session_opt)
 
848
    thread_mask&= session->lex->slave_session_opt;
849
849
  if (thread_mask) //some threads are stopped, start them
850
850
  {
851
851
    if (mi->init_master_info(master_info_file, relay_log_info_file, thread_mask))
861
861
      {
862
862
        pthread_mutex_lock(&mi->rli.data_lock);
863
863
 
864
 
        if (thd->lex->mi.pos)
 
864
        if (session->lex->mi.pos)
865
865
        {
866
866
          mi->rli.until_condition= Relay_log_info::UNTIL_MASTER_POS;
867
 
          mi->rli.until_log_pos= thd->lex->mi.pos;
 
867
          mi->rli.until_log_pos= session->lex->mi.pos;
868
868
          /*
869
 
             We don't check thd->lex->mi.log_file_name for NULL here
 
869
             We don't check session->lex->mi.log_file_name for NULL here
870
870
             since it is checked in sql_yacc.yy
871
871
          */
872
 
          strmake(mi->rli.until_log_name, thd->lex->mi.log_file_name,
 
872
          strmake(mi->rli.until_log_name, session->lex->mi.log_file_name,
873
873
                  sizeof(mi->rli.until_log_name)-1);
874
874
        }
875
 
        else if (thd->lex->mi.relay_log_pos)
 
875
        else if (session->lex->mi.relay_log_pos)
876
876
        {
877
877
          mi->rli.until_condition= Relay_log_info::UNTIL_RELAY_POS;
878
 
          mi->rli.until_log_pos= thd->lex->mi.relay_log_pos;
879
 
          strmake(mi->rli.until_log_name, thd->lex->mi.relay_log_name,
 
878
          mi->rli.until_log_pos= session->lex->mi.relay_log_pos;
 
879
          strmake(mi->rli.until_log_name, session->lex->mi.relay_log_name,
880
880
                  sizeof(mi->rli.until_log_name)-1);
881
881
        }
882
882
        else
908
908
 
909
909
          /* Issuing warning then started without --skip-slave-start */
910
910
          if (!opt_skip_slave_start)
911
 
            push_warning(thd, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
 
911
            push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
912
912
                         ER_MISSING_SKIP_SLAVE,
913
913
                         ER(ER_MISSING_SKIP_SLAVE));
914
914
        }
915
915
 
916
916
        pthread_mutex_unlock(&mi->rli.data_lock);
917
917
      }
918
 
      else if (thd->lex->mi.pos || thd->lex->mi.relay_log_pos)
919
 
        push_warning(thd, DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_UNTIL_COND_IGNORED,
 
918
      else if (session->lex->mi.pos || session->lex->mi.relay_log_pos)
 
919
        push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_UNTIL_COND_IGNORED,
920
920
                     ER(ER_UNTIL_COND_IGNORED));
921
921
 
922
922
      if (!slave_errno)
932
932
  else
933
933
  {
934
934
    /* no error if all threads are already started, only a warning */
935
 
    push_warning(thd, DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_RUNNING,
 
935
    push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_RUNNING,
936
936
                 ER(ER_SLAVE_WAS_RUNNING));
937
937
  }
938
938
 
945
945
    return(1);
946
946
  }
947
947
  else if (net_report)
948
 
    my_ok(thd);
 
948
    my_ok(session);
949
949
 
950
950
  return(0);
951
951
}
952
952
 
953
953
 
954
 
int stop_slave(Session* thd, Master_info* mi, bool net_report )
 
954
int stop_slave(Session* session, Master_info* mi, bool net_report )
955
955
{
956
956
  int slave_errno;
957
 
  if (!thd)
958
 
    thd = current_thd;
 
957
  if (!session)
 
958
    session = current_session;
959
959
 
960
 
  thd->set_proc_info("Killing slave");
 
960
  session->set_proc_info("Killing slave");
961
961
  int thread_mask;
962
962
  lock_slave_threads(mi);
963
963
  // Get a mask of _running_ threads
968
968
    was stopped (as we don't wan't to touch the other thread), so set the
969
969
    bit to 0 for the other thread
970
970
  */
971
 
  if (thd->lex->slave_thd_opt)
972
 
    thread_mask &= thd->lex->slave_thd_opt;
 
971
  if (session->lex->slave_session_opt)
 
972
    thread_mask &= session->lex->slave_session_opt;
973
973
 
974
974
  if (thread_mask)
975
975
  {
980
980
  {
981
981
    //no error if both threads are already stopped, only a warning
982
982
    slave_errno= 0;
983
 
    push_warning(thd, DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_NOT_RUNNING,
 
983
    push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_NOT_RUNNING,
984
984
                 ER(ER_SLAVE_WAS_NOT_RUNNING));
985
985
  }
986
986
  unlock_slave_threads(mi);
987
 
  thd->set_proc_info(0);
 
987
  session->set_proc_info(0);
988
988
 
989
989
  if (slave_errno)
990
990
  {
993
993
    return(1);
994
994
  }
995
995
  else if (net_report)
996
 
    my_ok(thd);
 
996
    my_ok(session);
997
997
 
998
998
  return(0);
999
999
}
1004
1004
 
1005
1005
  SYNOPSIS
1006
1006
    reset_slave()
1007
 
    thd                 Thread handler
 
1007
    session                     Thread handler
1008
1008
    mi                  Master info for the slave
1009
1009
 
1010
1010
  RETURN
1013
1013
*/
1014
1014
 
1015
1015
 
1016
 
int reset_slave(Session *thd, Master_info* mi)
 
1016
int reset_slave(Session *session, Master_info* mi)
1017
1017
{
1018
1018
  struct stat stat_area;
1019
1019
  char fname[FN_REFLEN];
1031
1031
  }
1032
1032
 
1033
1033
  // delete relay logs, clear relay log coordinates
1034
 
  if ((error= purge_relay_logs(&mi->rli, thd,
 
1034
  if ((error= purge_relay_logs(&mi->rli, session,
1035
1035
                               1 /* just reset */,
1036
1036
                               &errmsg)))
1037
1037
    goto err;
1118
1118
}
1119
1119
 
1120
1120
 
1121
 
bool change_master(Session* thd, Master_info* mi)
 
1121
bool change_master(Session* session, Master_info* mi)
1122
1122
{
1123
1123
  int thread_mask;
1124
1124
  const char* errmsg= 0;
1133
1133
    return(true);
1134
1134
  }
1135
1135
 
1136
 
  thd->set_proc_info("Changing master");
1137
 
  LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
 
1136
  session->set_proc_info("Changing master");
 
1137
  LEX_MASTER_INFO* lex_mi= &session->lex->mi;
1138
1138
  // TODO: see if needs re-write
1139
1139
  if (mi->init_master_info(master_info_file, relay_log_info_file, thread_mask))
1140
1140
  {
1234
1234
  if (need_relay_log_purge)
1235
1235
  {
1236
1236
    relay_log_purge= 1;
1237
 
    thd->set_proc_info("Purging old relay logs");
1238
 
    if (purge_relay_logs(&mi->rli, thd,
 
1237
    session->set_proc_info("Purging old relay logs");
 
1238
    if (purge_relay_logs(&mi->rli, session,
1239
1239
                         0 /* not only reset, but also reinit */,
1240
1240
                         &errmsg))
1241
1241
    {
1293
1293
  pthread_mutex_unlock(&mi->rli.data_lock);
1294
1294
 
1295
1295
  unlock_slave_threads(mi);
1296
 
  thd->set_proc_info(0);
1297
 
  my_ok(thd);
 
1296
  session->set_proc_info(0);
 
1297
  my_ok(session);
1298
1298
  return(false);
1299
1299
}
1300
1300
 
1301
 
int reset_master(Session* thd)
 
1301
int reset_master(Session* session)
1302
1302
{
1303
1303
  if (!mysql_bin_log.is_open())
1304
1304
  {
1306
1306
               ER(ER_FLUSH_MASTER_BINLOG_CLOSED), MYF(ME_BELL+ME_WAITTANG));
1307
1307
    return 1;
1308
1308
  }
1309
 
  return mysql_bin_log.reset_logs(thd);
 
1309
  return mysql_bin_log.reset_logs(session);
1310
1310
}
1311
1311
 
1312
1312
int cmp_master_pos(const char* log_file_name1, uint64_t log_pos1,
1327
1327
}
1328
1328
 
1329
1329
 
1330
 
bool show_binlog_info(Session* thd)
 
1330
bool show_binlog_info(Session* session)
1331
1331
{
1332
 
  Protocol *protocol= thd->protocol;
 
1332
  Protocol *protocol= session->protocol;
1333
1333
  List<Item> field_list;
1334
1334
  field_list.push_back(new Item_empty_string("File", FN_REFLEN));
1335
1335
  field_list.push_back(new Item_return_int("Position",20,
1354
1354
    if (protocol->write())
1355
1355
      return(true);
1356
1356
  }
1357
 
  my_eof(thd);
 
1357
  my_eof(session);
1358
1358
  return(false);
1359
1359
}
1360
1360
 
1364
1364
 
1365
1365
  SYNOPSIS
1366
1366
    show_binlogs()
1367
 
    thd         Thread specific variable
 
1367
    session             Thread specific variable
1368
1368
 
1369
1369
  RETURN VALUES
1370
1370
    false OK
1371
1371
    true  error
1372
1372
*/
1373
1373
 
1374
 
bool show_binlogs(Session* thd)
 
1374
bool show_binlogs(Session* session)
1375
1375
{
1376
1376
  IO_CACHE *index_file;
1377
1377
  LOG_INFO cur;
1380
1380
  List<Item> field_list;
1381
1381
  uint32_t length;
1382
1382
  int cur_dir_len;
1383
 
  Protocol *protocol= thd->protocol;
 
1383
  Protocol *protocol= session->protocol;
1384
1384
 
1385
1385
  if (!mysql_bin_log.is_open())
1386
1386
  {
1435
1435
      goto err;
1436
1436
  }
1437
1437
  mysql_bin_log.unlock_index();
1438
 
  my_eof(thd);
 
1438
  my_eof(session);
1439
1439
  return(false);
1440
1440
 
1441
1441
err:
1458
1458
  uint32_t block_len;
1459
1459
  /* buffer contains position where we started last read */
1460
1460
  unsigned char* buffer= (unsigned char*) my_b_get_buffer_start(file);
1461
 
  uint32_t max_event_size= current_thd->variables.max_allowed_packet;
 
1461
  uint32_t max_event_size= current_session->variables.max_allowed_packet;
1462
1462
  lf_info= (LOAD_FILE_INFO*) file->arg;
1463
 
  if (lf_info->thd->current_stmt_binlog_row_based)
 
1463
  if (lf_info->session->current_stmt_binlog_row_based)
1464
1464
    return(0);
1465
1465
  if (lf_info->last_pos_in_file != HA_POS_ERROR &&
1466
1466
      lf_info->last_pos_in_file >= my_b_get_pos_in_file(file))
1473
1473
    lf_info->last_pos_in_file= my_b_get_pos_in_file(file);
1474
1474
    if (lf_info->wrote_create_file)
1475
1475
    {
1476
 
      Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer,
 
1476
      Append_block_log_event a(lf_info->session, lf_info->session->db, buffer,
1477
1477
                               cmin(block_len, max_event_size),
1478
1478
                               lf_info->log_delayed);
1479
1479
      mysql_bin_log.write(&a);
1480
1480
    }
1481
1481
    else
1482
1482
    {
1483
 
      Begin_load_query_log_event b(lf_info->thd, lf_info->thd->db,
 
1483
      Begin_load_query_log_event b(lf_info->session, lf_info->session->db,
1484
1484
                                   buffer,
1485
1485
                                   cmin(block_len, max_event_size),
1486
1486
                                   lf_info->log_delayed);
1501
1501
  sys_var_slave_skip_counter(sys_var_chain *chain, const char *name_arg)
1502
1502
    :sys_var(name_arg)
1503
1503
  { chain_sys_var(chain); }
1504
 
  bool check(Session *thd, set_var *var);
1505
 
  bool update(Session *thd, set_var *var);
 
1504
  bool check(Session *session, set_var *var);
 
1505
  bool update(Session *session, set_var *var);
1506
1506
  bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
1507
1507
  /*
1508
1508
    We can't retrieve the value of this, so we don't have to define
1516
1516
  sys_var_sync_binlog_period(sys_var_chain *chain, const char *name_arg,
1517
1517
                             ulong *value_ptr)
1518
1518
    :sys_var_long_ptr(chain, name_arg,value_ptr) {}
1519
 
  bool update(Session *thd, set_var *var);
 
1519
  bool update(Session *session, set_var *var);
1520
1520
};
1521
1521
 
1522
 
static void fix_slave_net_timeout(Session *thd,
 
1522
static void fix_slave_net_timeout(Session *session,
1523
1523
                                  enum_var_type type __attribute__((unused)))
1524
1524
{
1525
1525
  pthread_mutex_lock(&LOCK_active_mi);
1526
1526
  if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
1527
 
    push_warning_printf(thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
1527
    push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
1528
1528
                        ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
1529
1529
                        "The currect value for master_heartbeat_period"
1530
1530
                        " exceeds the new value of `slave_net_timeout' sec."
1546
1546
static sys_var_sync_binlog_period sys_sync_binlog_period(&vars, "sync_binlog", &sync_binlog_period);
1547
1547
static sys_var_slave_skip_counter sys_slave_skip_counter(&vars, "sql_slave_skip_counter");
1548
1548
 
1549
 
static int show_slave_skip_errors(Session *thd, SHOW_VAR *var, char *buff);
1550
 
 
1551
 
 
1552
 
static int show_slave_skip_errors(Session *thd __attribute__((unused)),
 
1549
static int show_slave_skip_errors(Session *session, SHOW_VAR *var, char *buff);
 
1550
 
 
1551
 
 
1552
static int show_slave_skip_errors(Session *session __attribute__((unused)),
1553
1553
                                  SHOW_VAR *var, char *buff)
1554
1554
{
1555
1555
  var->type=SHOW_CHAR;
1601
1601
  {"slave_skip_errors",       (char*) &show_slave_skip_errors_cont,      SHOW_FUNC},
1602
1602
};
1603
1603
 
1604
 
bool sys_var_slave_skip_counter::check(Session *thd __attribute__((unused)),
 
1604
bool sys_var_slave_skip_counter::check(Session *session __attribute__((unused)),
1605
1605
                                       set_var *var)
1606
1606
{
1607
1607
  int result= 0;
1619
1619
}
1620
1620
 
1621
1621
 
1622
 
bool sys_var_slave_skip_counter::update(Session *thd __attribute__((unused)),
 
1622
bool sys_var_slave_skip_counter::update(Session *session __attribute__((unused)),
1623
1623
                                        set_var *var)
1624
1624
{
1625
1625
  pthread_mutex_lock(&LOCK_active_mi);
1641
1641
}
1642
1642
 
1643
1643
 
1644
 
bool sys_var_sync_binlog_period::update(Session *thd __attribute__((unused)),
 
1644
bool sys_var_sync_binlog_period::update(Session *session __attribute__((unused)),
1645
1645
                                        set_var *var)
1646
1646
{
1647
1647
  sync_binlog_period= (uint32_t) var->save_result.uint64_t_value;