sql_repl.h 2.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB & Sasha

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

hf@deer.mysql.r18.ru's avatar
SCRUM  
hf@deer.mysql.r18.ru committed
17
#ifdef HAVE_REPLICATION
18 19
#include "slave.h"

20 21 22
typedef struct st_slave_info
{
  uint32 server_id;
sasha@mysql.sashanet.com's avatar
sasha@mysql.sashanet.com committed
23
  uint32 rpl_recovery_rank, master_id;
24 25
  char host[HOSTNAME_LENGTH+1];
  char user[USERNAME_LENGTH+1];
26
  char password[MAX_PASSWORD_LENGTH+1];
27
  uint16 port;
28
  THD* thd;
29 30
} SLAVE_INFO;

31
extern my_bool opt_show_slave_auth_info;
32
extern char *master_host, *master_info_file;
sasha@mysql.sashanet.com's avatar
sasha@mysql.sashanet.com committed
33
extern bool server_id_supplied;
34 35
extern I_List<i_string> binlog_do_db, binlog_ignore_db;

36
extern int max_binlog_dump_events;
37
extern my_bool opt_sporadic_binlog_dump_fail;
38

39 40 41 42 43
#define KICK_SLAVE(thd) do {                                            \
                          pthread_mutex_lock(&(thd)->LOCK_delete);      \
                          (thd)->awake(THD::NOT_KILLED);                \
                          pthread_mutex_unlock(&(thd)->LOCK_delete);    \
                        } while(0)
44

45 46
int start_slave(THD* thd, MASTER_INFO* mi, bool net_report);
int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report);
47
bool change_master(THD* thd, MASTER_INFO* mi);
48
bool mysql_show_binlog_events(THD* thd);
49 50
int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
		   const char* log_file_name2, ulonglong log_pos2);
51
int reset_slave(THD *thd, MASTER_INFO* mi);
52
int reset_master(THD* thd);
53 54
bool purge_master_logs(THD* thd, const char* to_log);
bool purge_master_logs_before_date(THD* thd, time_t purge_time);
55 56
bool log_in_use(const char* log_name);
void adjust_linfo_offsets(my_off_t purge_offset);
57
bool show_binlogs(THD* thd);
58 59
extern int init_master_info(MASTER_INFO* mi);
void kill_zombie_dump_threads(uint32 slave_server_id);
60
int check_binlog_magic(IO_CACHE* log, const char** errmsg);
61

62 63 64
typedef struct st_load_file_info
{
  THD* thd;
65
  my_off_t last_pos_in_file;
66
  bool wrote_create_file, log_delayed;
67 68 69
} LOAD_FILE_INFO;

int log_loaded_block(IO_CACHE* file);
70

hf@deer.mysql.r18.ru's avatar
SCRUM  
hf@deer.mysql.r18.ru committed
71
#endif /* HAVE_REPLICATION */
72