2003-01-15 09:11:44 +01:00
|
|
|
#ifdef HAVE_REPLICATION
|
2002-12-16 14:33:29 +01:00
|
|
|
|
2000-11-11 22:50:39 +01:00
|
|
|
#ifndef SLAVE_H
|
|
|
|
#define SLAVE_H
|
|
|
|
|
2001-05-29 03:18:23 +02:00
|
|
|
#include "mysql.h"
|
2002-01-20 03:16:52 +01:00
|
|
|
#include "my_list.h"
|
2001-07-17 22:22:52 +02:00
|
|
|
#define SLAVE_NET_TIMEOUT 3600
|
2002-01-20 03:16:52 +01:00
|
|
|
#define MAX_SLAVE_ERRMSG 1024
|
2002-01-22 23:05:11 +01:00
|
|
|
#define MAX_SLAVE_ERROR 2000
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-10-29 23:12:47 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
MySQL Replication
|
|
|
|
|
|
|
|
Replication is implemented via two types of threads:
|
|
|
|
|
|
|
|
I/O Thread - One of these threads is started for each master server.
|
|
|
|
They maintain a connection to their master server, read log
|
|
|
|
events from the master as they arrive, and queues them into
|
|
|
|
a single, shared relay log file. A MASTER_INFO struct
|
|
|
|
represents each of these threads.
|
|
|
|
|
|
|
|
SQL Thread - One of these threads is started and reads from the relay log
|
|
|
|
file, executing each event. A RELAY_LOG_INFO struct
|
|
|
|
represents this thread.
|
|
|
|
|
|
|
|
Buffering in the relay log file makes it unnecessary to reread events from
|
|
|
|
a master server across a slave restart. It also decouples the slave from
|
|
|
|
the master where long-running updates and event logging are concerned--ie
|
|
|
|
it can continue to log new events while a slow query executes on the slave.
|
|
|
|
|
|
|
|
*****************************************************************************/
|
2001-07-17 22:22:52 +02:00
|
|
|
|
2003-06-04 07:57:42 +02:00
|
|
|
extern ulong master_retry_count;
|
2002-01-22 23:05:11 +01:00
|
|
|
extern MY_BITMAP slave_error_mask;
|
|
|
|
extern bool use_slave_mask;
|
2001-08-03 23:57:53 +02:00
|
|
|
extern char* slave_load_tmpdir;
|
2002-01-20 03:16:52 +01:00
|
|
|
extern my_string master_info_file,relay_log_info_file;
|
|
|
|
extern my_string opt_relay_logname, opt_relaylog_index_name;
|
2002-08-22 15:50:58 +02:00
|
|
|
extern my_bool opt_skip_slave_start, opt_reckless_slave;
|
|
|
|
extern my_bool opt_log_slave_updates;
|
2002-08-23 14:14:01 +02:00
|
|
|
extern ulonglong relay_log_space_limit;
|
2002-01-20 03:16:52 +01:00
|
|
|
struct st_master_info;
|
|
|
|
|
2003-06-04 07:57:42 +02:00
|
|
|
extern "C" {
|
|
|
|
extern ulong slave_net_timeout;
|
|
|
|
};
|
|
|
|
|
Fix for bug 254 :
we now make a distinction between if the master is < 3.23.57, 3.23 && >=57, and 4.x
(before the 2 3.23 were one). This is because in 3.23.57 we have a way to distinguish between
a Start_log_event written at server startup and one written at FLUSH LOGS, so we
have a way to know if the slave must drop old temp tables or not.
Change: mi->old_format was bool, now it's enum (to handle 3 cases). However, functions
which had 'bool old_format' as an argument have their prototypes unchanged, because
the old old_format == 0 now corresponds to the enum value BINLOG_FORMAT_CURRENT which
is equal to 0, so boolean tests are left untouched. The only case were we use mi->old_format
as an enum instead of casting it implicitly to a bool, is in Start_log_event::exec_event,
where we want to distinguish between the 3 possible enum values.
sql/log_event.cc:
Fix for bug 254 :
we now make a distinction between if the master is < 3.23.57, 3.23 && >=57, and 4.x
(before the 2 3.23 were one), to know if the slave must drop old temp tables or not.
sql/slave.cc:
Fix for bug 254 : mi->old_format is now enum.
An unrelated comment.
sql/slave.h:
fix for bug 254 : mi->old_format is now enum.
2003-06-06 16:41:28 +02:00
|
|
|
enum enum_binlog_formats {
|
|
|
|
BINLOG_FORMAT_CURRENT=0, /* 0 is important for easy 'if (mi->old_format)' */
|
|
|
|
BINLOG_FORMAT_323_LESS_57,
|
|
|
|
BINLOG_FORMAT_323_GEQ_57 };
|
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
TODO: this needs to be redone, but for now it does not matter since
|
|
|
|
we do not have multi-master yet.
|
|
|
|
*/
|
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
#define LOCK_ACTIVE_MI { pthread_mutex_lock(&LOCK_active_mi); \
|
|
|
|
++active_mi_in_use; \
|
|
|
|
pthread_mutex_unlock(&LOCK_active_mi);}
|
|
|
|
|
|
|
|
#define UNLOCK_ACTIVE_MI { pthread_mutex_lock(&LOCK_active_mi); \
|
|
|
|
--active_mi_in_use; \
|
|
|
|
pthread_mutex_unlock(&LOCK_active_mi); }
|
|
|
|
|
2002-10-29 23:12:47 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
Replication SQL Thread
|
|
|
|
|
|
|
|
st_relay_log_info contains:
|
|
|
|
- the current relay log
|
|
|
|
- the current relay log offset
|
|
|
|
- master log name
|
|
|
|
- master log sequence corresponding to the last update
|
|
|
|
- misc information specific to the SQL thread
|
2002-01-20 03:16:52 +01:00
|
|
|
|
|
|
|
st_relay_log_info is initialized from the slave.info file if such exists.
|
|
|
|
Otherwise, data members are intialized with defaults. The initialization is
|
|
|
|
done with init_relay_log_info() call.
|
|
|
|
|
|
|
|
The format of slave.info file:
|
|
|
|
|
|
|
|
relay_log_name
|
|
|
|
relay_log_pos
|
|
|
|
master_log_name
|
|
|
|
master_log_pos
|
|
|
|
|
|
|
|
To clean up, call end_relay_log_info()
|
2002-10-29 23:12:47 +01:00
|
|
|
|
|
|
|
*****************************************************************************/
|
2002-01-29 17:32:16 +01:00
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
typedef struct st_relay_log_info
|
|
|
|
{
|
2002-01-29 17:32:16 +01:00
|
|
|
/*** The following variables can only be read when protect by data lock ****/
|
2002-06-11 10:20:31 +02:00
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
info_fd - file descriptor of the info file. set only during
|
|
|
|
initialization or clean up - safe to read anytime
|
|
|
|
cur_log_fd - file descriptor of the current read relay log
|
|
|
|
*/
|
2002-01-20 03:16:52 +01:00
|
|
|
File info_fd,cur_log_fd;
|
2002-01-29 17:32:16 +01:00
|
|
|
|
|
|
|
/*
|
2002-06-05 22:04:38 +02:00
|
|
|
Protected with internal locks.
|
|
|
|
Must get data_lock when resetting the logs.
|
2002-01-29 17:32:16 +01:00
|
|
|
*/
|
|
|
|
MYSQL_LOG relay_log;
|
|
|
|
LOG_INFO linfo;
|
|
|
|
IO_CACHE cache_buf,*cur_log;
|
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* The following variables are safe to read any time */
|
2002-01-29 17:32:16 +01:00
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* IO_CACHE of the info file - set only during init or end */
|
2002-01-29 17:32:16 +01:00
|
|
|
IO_CACHE info_file;
|
2001-05-29 03:18:23 +02:00
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
When we restart slave thread we need to have access to the previously
|
|
|
|
created temporary tables. Modified only on init/end and by the SQL
|
|
|
|
thread, read only by SQL thread.
|
|
|
|
*/
|
2003-01-28 07:38:28 +01:00
|
|
|
TABLE *save_temporary_tables;
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
standard lock acquistion order to avoid deadlocks:
|
|
|
|
run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index
|
|
|
|
*/
|
2002-01-20 03:16:52 +01:00
|
|
|
pthread_mutex_t data_lock,run_lock;
|
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
start_cond is broadcast when SQL thread is started
|
|
|
|
stop_cond - when stopped
|
|
|
|
data_cond - when data protected by data_lock changes
|
|
|
|
*/
|
|
|
|
pthread_cond_t start_cond, stop_cond, data_cond;
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* parent master info structure */
|
2002-01-20 03:16:52 +01:00
|
|
|
struct st_master_info *mi;
|
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
Needed to deal properly with cur_log getting closed and re-opened with
|
|
|
|
a different log under our feet
|
2002-01-20 03:16:52 +01:00
|
|
|
*/
|
2002-06-05 22:04:38 +02:00
|
|
|
uint32 cur_log_old_open_count;
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-06-05 22:04:38 +02:00
|
|
|
/*
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
Let's call a group (of events) :
|
|
|
|
- a transaction
|
|
|
|
or
|
|
|
|
- an autocommiting query + its associated events (INSERT_ID,
|
|
|
|
TIMESTAMP...)
|
|
|
|
We need these rli coordinates :
|
|
|
|
- relay log name and position of the beginning of the group we currently are
|
|
|
|
executing. Needed to know where we have to restart when replication has
|
|
|
|
stopped in the middle of a group (which has been rolled back by the slave).
|
|
|
|
- relay log name and position just after the event we have just
|
|
|
|
executed. This event is part of the current group.
|
|
|
|
Formerly we only had the immediately above coordinates, plus a 'pending'
|
|
|
|
variable, but this dealt wrong with the case of a transaction starting on a
|
|
|
|
relay log and finishing (commiting) on another relay log. Case which can
|
|
|
|
happen when, for example, the relay log gets rotated because of
|
|
|
|
max_binlog_size.
|
|
|
|
*/
|
|
|
|
char group_relay_log_name[FN_REFLEN];
|
|
|
|
ulonglong group_relay_log_pos;
|
|
|
|
char event_relay_log_name[FN_REFLEN];
|
|
|
|
ulonglong event_relay_log_pos;
|
|
|
|
/*
|
|
|
|
Original log name and position of the group we're currently executing
|
|
|
|
(whose coordinates are group_relay_log_name/pos in the relay log)
|
|
|
|
in the master's binlog. These concern the *group*, because in the master's
|
|
|
|
binlog the log_pos that comes with each event is the position of the
|
|
|
|
beginning of the group.
|
2002-06-05 22:04:38 +02:00
|
|
|
*/
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
char group_master_log_name[FN_REFLEN];
|
|
|
|
volatile my_off_t group_master_log_pos;
|
2003-03-17 22:51:56 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
Handling of the relay_log_space_limit optional constraint.
|
|
|
|
ignore_log_space_limit is used to resolve a deadlock between I/O and SQL
|
|
|
|
threads, it makes the I/O thread temporarily forget about the constraint
|
|
|
|
*/
|
2002-06-05 22:04:38 +02:00
|
|
|
ulonglong log_space_limit,log_space_total;
|
2003-03-17 22:51:56 +01:00
|
|
|
bool ignore_log_space_limit;
|
2002-01-29 17:32:16 +01:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
/*
|
|
|
|
InnoDB internally stores the master log position it has processed
|
|
|
|
so far; the position to store is really the sum of
|
|
|
|
pos + pending + event_len here since we must store the pos of the
|
|
|
|
END of the current log event
|
|
|
|
*/
|
|
|
|
int event_len;
|
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
Needed for problems when slave stops and we want to restart it
|
|
|
|
skipping one or more events in the master log that have caused
|
|
|
|
errors, and have been manually applied by DBA already.
|
|
|
|
*/
|
2002-01-20 03:16:52 +01:00
|
|
|
volatile uint32 slave_skip_counter;
|
2002-08-21 21:04:22 +02:00
|
|
|
volatile ulong abort_pos_wait; /* Incremented on change master */
|
2002-08-24 04:44:16 +02:00
|
|
|
volatile ulong slave_run_id; /* Incremented on slave start */
|
2002-06-05 22:04:38 +02:00
|
|
|
pthread_mutex_t log_space_lock;
|
|
|
|
pthread_cond_t log_space_cond;
|
|
|
|
THD * sql_thd;
|
|
|
|
int last_slave_errno;
|
2002-01-20 03:16:52 +01:00
|
|
|
#ifndef DBUG_OFF
|
|
|
|
int events_till_abort;
|
|
|
|
#endif
|
|
|
|
char last_slave_error[MAX_SLAVE_ERRMSG];
|
2002-06-05 22:04:38 +02:00
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* if not set, the value of other members of the structure are undefined */
|
2002-06-05 22:04:38 +02:00
|
|
|
bool inited;
|
|
|
|
volatile bool abort_slave, slave_running;
|
2002-12-11 14:46:39 +01:00
|
|
|
|
2003-01-28 07:38:28 +01:00
|
|
|
st_relay_log_info();
|
|
|
|
~st_relay_log_info();
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
|
|
|
|
inline void inc_event_relay_log_pos(ulonglong val)
|
2002-01-20 03:16:52 +01:00
|
|
|
{
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
event_relay_log_pos+= val;
|
2002-01-20 03:16:52 +01:00
|
|
|
}
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
|
|
|
|
void inc_group_relay_log_pos(ulonglong val, ulonglong log_pos, bool skip_lock=0)
|
2002-01-20 03:16:52 +01:00
|
|
|
{
|
|
|
|
if (!skip_lock)
|
|
|
|
pthread_mutex_lock(&data_lock);
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
inc_event_relay_log_pos(val);
|
|
|
|
group_relay_log_pos= event_relay_log_pos;
|
|
|
|
strmake(group_relay_log_name,event_relay_log_name,
|
|
|
|
sizeof(group_relay_log_name)-1);
|
|
|
|
/*
|
|
|
|
If the slave does not support transactions and replicates a transaction,
|
|
|
|
users should not trust group_master_log_pos (which they can display with
|
|
|
|
SHOW SLAVE STATUS or read from relay-log.info), because to compute
|
|
|
|
group_master_log_pos the slave relies on log_pos stored in the master's
|
|
|
|
binlog, but if we are in a master's transaction these positions are always
|
|
|
|
the BEGIN's one (excepted for the COMMIT), so group_master_log_pos does
|
|
|
|
not advance as it should on the non-transactional slave (it advances by
|
|
|
|
big leaps, whereas it should advance by small leaps).
|
|
|
|
*/
|
|
|
|
if (log_pos) // 3.23 binlogs don't have log_posx
|
|
|
|
group_master_log_pos= log_pos+ val;
|
2002-01-20 03:16:52 +01:00
|
|
|
pthread_cond_broadcast(&data_cond);
|
|
|
|
if (!skip_lock)
|
|
|
|
pthread_mutex_unlock(&data_lock);
|
|
|
|
}
|
|
|
|
|
2003-01-25 14:07:51 +01:00
|
|
|
int wait_for_pos(THD* thd, String* log_name, longlong log_pos,
|
|
|
|
longlong timeout);
|
2002-01-20 03:16:52 +01:00
|
|
|
} RELAY_LOG_INFO;
|
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
Log_event* next_event(RELAY_LOG_INFO* rli);
|
|
|
|
|
2002-10-29 23:12:47 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
Replication IO Thread
|
|
|
|
|
|
|
|
st_master_info contains:
|
|
|
|
- information about how to connect to a master
|
|
|
|
- current master log name
|
|
|
|
- current master log offset
|
|
|
|
- misc control variables
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-06-05 22:04:38 +02:00
|
|
|
st_master_info is initialized once from the master.info file if such
|
|
|
|
exists. Otherwise, data members corresponding to master.info fields
|
|
|
|
are initialized with defaults specified by master-* options. The
|
|
|
|
initialization is done through init_master_info() call.
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-06-05 22:04:38 +02:00
|
|
|
The format of master.info file:
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-06-05 22:04:38 +02:00
|
|
|
log_name
|
|
|
|
log_pos
|
|
|
|
master_host
|
|
|
|
master_user
|
|
|
|
master_pass
|
|
|
|
master_port
|
|
|
|
master_connect_retry
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-06-05 22:04:38 +02:00
|
|
|
To write out the contents of master.info file to disk ( needed every
|
|
|
|
time we read and queue data from the master ), a call to
|
|
|
|
flush_master_info() is required.
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-06-05 22:04:38 +02:00
|
|
|
To clean up, call end_master_info()
|
2002-01-29 17:32:16 +01:00
|
|
|
|
2002-10-29 23:12:47 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2000-11-11 22:50:39 +01:00
|
|
|
typedef struct st_master_info
|
|
|
|
{
|
2002-01-20 03:16:52 +01:00
|
|
|
char master_log_name[FN_REFLEN];
|
2003-07-04 02:18:15 +02:00
|
|
|
char host[HOSTNAME_LENGTH+1];
|
|
|
|
char user[USERNAME_LENGTH+1];
|
|
|
|
char password[MAX_PASSWORD_LENGTH+1];
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
my_off_t master_log_pos;
|
2002-08-08 02:12:02 +02:00
|
|
|
File fd; // we keep the file open, so we need to remember the file pointer
|
2000-11-25 03:49:13 +01:00
|
|
|
IO_CACHE file;
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* the variables below are needed because we can change masters on the fly */
|
2002-01-20 03:16:52 +01:00
|
|
|
pthread_mutex_t data_lock,run_lock;
|
|
|
|
pthread_cond_t data_cond,start_cond,stop_cond;
|
2002-01-29 17:32:16 +01:00
|
|
|
THD *io_thd;
|
2002-02-07 23:29:46 +01:00
|
|
|
MYSQL* mysql;
|
2003-07-04 02:18:15 +02:00
|
|
|
uint32 file_id; /* for 3.23 load data infile */
|
2002-01-20 03:16:52 +01:00
|
|
|
RELAY_LOG_INFO rli;
|
2002-01-29 17:32:16 +01:00
|
|
|
uint port;
|
|
|
|
uint connect_retry;
|
2002-01-20 03:16:52 +01:00
|
|
|
#ifndef DBUG_OFF
|
|
|
|
int events_till_abort;
|
|
|
|
#endif
|
2002-01-29 17:32:16 +01:00
|
|
|
bool inited;
|
2003-08-11 21:44:43 +02:00
|
|
|
enum enum_binlog_formats old_format;
|
2002-01-20 03:16:52 +01:00
|
|
|
volatile bool abort_slave, slave_running;
|
2002-08-24 04:44:16 +02:00
|
|
|
volatile ulong slave_run_id;
|
2000-11-11 22:50:39 +01:00
|
|
|
|
2002-08-24 04:44:16 +02:00
|
|
|
st_master_info()
|
Fix for bug 254 :
we now make a distinction between if the master is < 3.23.57, 3.23 && >=57, and 4.x
(before the 2 3.23 were one). This is because in 3.23.57 we have a way to distinguish between
a Start_log_event written at server startup and one written at FLUSH LOGS, so we
have a way to know if the slave must drop old temp tables or not.
Change: mi->old_format was bool, now it's enum (to handle 3 cases). However, functions
which had 'bool old_format' as an argument have their prototypes unchanged, because
the old old_format == 0 now corresponds to the enum value BINLOG_FORMAT_CURRENT which
is equal to 0, so boolean tests are left untouched. The only case were we use mi->old_format
as an enum instead of casting it implicitly to a bool, is in Start_log_event::exec_event,
where we want to distinguish between the 3 possible enum values.
sql/log_event.cc:
Fix for bug 254 :
we now make a distinction between if the master is < 3.23.57, 3.23 && >=57, and 4.x
(before the 2 3.23 were one), to know if the slave must drop old temp tables or not.
sql/slave.cc:
Fix for bug 254 : mi->old_format is now enum.
An unrelated comment.
sql/slave.h:
fix for bug 254 : mi->old_format is now enum.
2003-06-06 16:41:28 +02:00
|
|
|
:fd(-1), io_thd(0), inited(0), old_format(BINLOG_FORMAT_CURRENT),
|
|
|
|
abort_slave(0),slave_running(0), slave_run_id(0)
|
2000-11-11 22:50:39 +01:00
|
|
|
{
|
|
|
|
host[0] = 0; user[0] = 0; password[0] = 0;
|
2003-08-11 21:44:43 +02:00
|
|
|
bzero((char*) &file, sizeof(file));
|
2002-01-20 03:16:52 +01:00
|
|
|
pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
|
|
|
|
pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
|
|
|
|
pthread_cond_init(&data_cond, NULL);
|
|
|
|
pthread_cond_init(&start_cond, NULL);
|
|
|
|
pthread_cond_init(&stop_cond, NULL);
|
2000-11-11 22:50:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
~st_master_info()
|
|
|
|
{
|
2002-01-20 03:16:52 +01:00
|
|
|
pthread_mutex_destroy(&run_lock);
|
|
|
|
pthread_mutex_destroy(&data_lock);
|
|
|
|
pthread_cond_destroy(&data_cond);
|
|
|
|
pthread_cond_destroy(&start_cond);
|
|
|
|
pthread_cond_destroy(&stop_cond);
|
2000-11-11 22:50:39 +01:00
|
|
|
}
|
2001-01-17 13:47:33 +01:00
|
|
|
|
2000-11-11 22:50:39 +01:00
|
|
|
} MASTER_INFO;
|
|
|
|
|
2002-09-11 05:40:08 +02:00
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
int queue_event(MASTER_INFO* mi,const char* buf,ulong event_len);
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2000-11-11 22:50:39 +01:00
|
|
|
typedef struct st_table_rule_ent
|
|
|
|
{
|
|
|
|
char* db;
|
|
|
|
char* tbl_name;
|
|
|
|
uint key_len;
|
|
|
|
} TABLE_RULE_ENT;
|
|
|
|
|
|
|
|
#define TABLE_RULE_HASH_SIZE 16
|
2000-11-21 07:38:08 +01:00
|
|
|
#define TABLE_RULE_ARR_SIZE 16
|
2001-08-03 23:57:53 +02:00
|
|
|
#define MAX_SLAVE_ERRMSG 1024
|
|
|
|
|
Replication: new code to not modify in-memory log positions until the COMMIT
is executed, even if the transaction spans on >=2 relay logs (bug #53).
New variable relay_log_purge =0|1
New test to verify bug #53
sql/log.cc:
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT.
sql/log_event.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/mysql_priv.h:
new option relay_log_purge (the user can now decide himself
if he wants his relay logs to be automatically purged or not,
we don't make unsafe guesses like before)
sql/mysqld.cc:
new option --innodb (replaces --skip-innodb).
Useful for the test suite : we have skip-innodb in mysql-test-run,
but we can ('-opt.info' file) choose to start the server with
InnoDB for this test only.
New option --bdb
sql/repl_failsafe.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/set_var.cc:
new variable relay_log_purge
sql/slave.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Now we purge a relay log only when we are sure we won't need it,
i.e. we have executed the final query (if autocommit=1) or the COMMIT
sql/slave.h:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
sql/sql_class.h:
prototypes change
sql/sql_parse.cc:
removed thd argument (was not used in the function's body)
sql/sql_repl.cc:
Better tracking of the relay log's name and position
lastly executed, even if we are in a transaction which spans on
2 or more relay logs.
Turn relay_log_purge silently off when someone does CHANGE
MASTER TO RELAY_LOG_*
2003-04-24 15:29:25 +02:00
|
|
|
#define RPL_LOG_NAME (rli->group_master_log_name[0] ? rli->group_master_log_name :\
|
2002-01-20 03:16:52 +01:00
|
|
|
"FIRST")
|
|
|
|
#define IO_RPL_LOG_NAME (mi->master_log_name[0] ? mi->master_log_name :\
|
2001-08-03 23:57:53 +02:00
|
|
|
"FIRST")
|
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
/* masks for start/stop operations on io and sql slave threads */
|
|
|
|
#define SLAVE_IO 1
|
|
|
|
#define SLAVE_SQL 2
|
2002-01-29 17:32:16 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
If the following is set, if first gives an error, second will be
|
|
|
|
tried. Otherwise, if first fails, we fail.
|
|
|
|
*/
|
|
|
|
#define SLAVE_FORCE_ALL 4
|
2000-11-11 22:50:39 +01:00
|
|
|
|
2002-01-20 03:16:52 +01:00
|
|
|
int init_slave();
|
2002-04-30 15:40:46 +02:00
|
|
|
void init_slave_skip_errors(const char* arg);
|
2002-08-08 02:12:02 +02:00
|
|
|
bool flush_master_info(MASTER_INFO* mi);
|
|
|
|
bool flush_relay_log_info(RELAY_LOG_INFO* rli);
|
2001-05-31 02:50:56 +02:00
|
|
|
int register_slave_on_master(MYSQL* mysql);
|
2002-01-20 03:16:52 +01:00
|
|
|
int terminate_slave_threads(MASTER_INFO* mi, int thread_mask,
|
|
|
|
bool skip_lock = 0);
|
|
|
|
int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex,
|
|
|
|
pthread_mutex_t* cond_lock,
|
|
|
|
pthread_cond_t* term_cond,
|
|
|
|
volatile bool* slave_running);
|
|
|
|
int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
|
|
|
|
MASTER_INFO* mi, const char* master_info_fname,
|
|
|
|
const char* slave_info_fname, int thread_mask);
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
cond_lock is usually same as start_lock. It is needed for the case when
|
|
|
|
start_lock is 0 which happens if start_slave_thread() is called already
|
|
|
|
inside the start_lock section, but at the same time we want a
|
|
|
|
pthread_cond_wait() on start_cond,start_lock
|
2002-01-20 03:16:52 +01:00
|
|
|
*/
|
|
|
|
int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
|
|
|
|
pthread_mutex_t *cond_lock,
|
|
|
|
pthread_cond_t* start_cond,
|
2002-08-24 04:44:16 +02:00
|
|
|
volatile bool *slave_running,
|
|
|
|
volatile ulong *slave_run_id,
|
2003-03-01 23:59:27 +01:00
|
|
|
MASTER_INFO* mi,
|
|
|
|
bool high_priority);
|
2000-11-11 22:50:39 +01:00
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* If fd is -1, dump to NET */
|
2001-05-29 03:18:23 +02:00
|
|
|
int mysql_table_dump(THD* thd, const char* db,
|
|
|
|
const char* tbl_name, int fd = -1);
|
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* retrieve non-exitent table from master */
|
2002-01-29 17:32:16 +01:00
|
|
|
int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
|
|
|
|
MASTER_INFO* mi, MYSQL* mysql);
|
2001-05-29 03:18:23 +02:00
|
|
|
|
2003-07-23 15:46:46 +02:00
|
|
|
void table_rule_ent_hash_to_str(String* s, HASH* h);
|
|
|
|
void table_rule_ent_dynamic_array_to_str(String* s, DYNAMIC_ARRAY* a);
|
2002-01-20 03:16:52 +01:00
|
|
|
int show_master_info(THD* thd, MASTER_INFO* mi);
|
2000-11-11 22:50:39 +01:00
|
|
|
int show_binlog_info(THD* thd);
|
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* See if the query uses any tables that should not be replicated */
|
2000-11-14 07:43:02 +01:00
|
|
|
int tables_ok(THD* thd, TABLE_LIST* tables);
|
|
|
|
|
2002-01-29 17:32:16 +01:00
|
|
|
/*
|
|
|
|
Check to see if the database is ok to operate on with respect to the
|
|
|
|
do and ignore lists - used in replication
|
|
|
|
*/
|
2000-11-11 22:50:39 +01:00
|
|
|
int db_ok(const char* db, I_List<i_string> &do_list,
|
|
|
|
I_List<i_string> &ignore_list );
|
2003-01-25 14:07:51 +01:00
|
|
|
int db_ok_with_wild_table(const char *db);
|
2000-11-11 22:50:39 +01:00
|
|
|
|
2000-11-14 07:43:02 +01:00
|
|
|
int add_table_rule(HASH* h, const char* table_spec);
|
2000-11-21 07:38:08 +01:00
|
|
|
int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec);
|
2000-11-14 07:43:02 +01:00
|
|
|
void init_table_rule_hash(HASH* h, bool* h_inited);
|
2000-11-21 07:38:08 +01:00
|
|
|
void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited);
|
2003-08-07 19:16:37 +02:00
|
|
|
const char *rewrite_db(const char* db);
|
|
|
|
const char *print_slave_db_safe(const char* db);
|
2002-01-20 03:16:52 +01:00
|
|
|
int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code);
|
2001-08-03 23:57:53 +02:00
|
|
|
void skip_load_data_infile(NET* net);
|
WL#1036 (print the db in slave error messages).
I extended the task to cleaning error messages, making them look nicer,
and making the output of SHOW SLAVE STATUS (column Last_error) be as complete
as what's printed on the .err file;
previously we would have, for a failure of a replicated LOAD DATA INFILE:
- in the .err, 2 lines:
"duplicate entry 2708 for key 1"
"failed loading SQL_LOAD-5-2-2.info"
- and in SHOW SLAVE STATUS, only:
"failed loading SQL_LOAD-5-2-2.info".
Now SHOW SLAVE STATUS will contain the concatenation of the 2 messages.
sql/log_event.cc:
Print the default database when replication stops because of an error. Previously, we had:
"error "Duplicate entry 87987 for key 1", query 'insert into t values(87987)'", ie the db
was not mentioned, making it hard for cases where the same table name is used in
several databases.
Lengthened some error messages (for failing replication of LOAD DATA: mention the table
and the db).
Changes so that SHOW SLAVE STATUS reports as complete errors as the .err file.
sql/slave.cc:
Removed a useless declaration (the rewrite_db() function is already declared in slave.h).
Added missing ')' in error messages.
Tried to make error messages look nicer (previously we had
"do START SLAVE;, error_code=1062"
now we'll have
"do START SLAVE; . Error_code=1062".
This form has been discussed, I agree it's no panacea, but it's still more readable
like this. To be improved in the future :)
sql/slave.h:
declarations.
2003-07-24 22:25:36 +02:00
|
|
|
void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...);
|
2000-11-11 22:50:39 +01:00
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
void end_slave(); /* clean up */
|
2003-08-04 10:59:44 +02:00
|
|
|
void init_master_info_with_options(MASTER_INFO* mi);
|
|
|
|
void clear_last_slave_error(RELAY_LOG_INFO* rli);
|
2002-01-20 03:16:52 +01:00
|
|
|
int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
|
2002-08-08 02:12:02 +02:00
|
|
|
const char* slave_info_fname,
|
|
|
|
bool abort_if_no_master_info_file);
|
2000-12-09 22:28:51 +01:00
|
|
|
void end_master_info(MASTER_INFO* mi);
|
2002-01-20 03:16:52 +01:00
|
|
|
int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname);
|
|
|
|
void end_relay_log_info(RELAY_LOG_INFO* rli);
|
|
|
|
void lock_slave_threads(MASTER_INFO* mi);
|
|
|
|
void unlock_slave_threads(MASTER_INFO* mi);
|
|
|
|
void init_thread_mask(int* mask,MASTER_INFO* mi,bool inverse);
|
|
|
|
int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,ulonglong pos,
|
|
|
|
bool need_data_lock, const char** errmsg);
|
2001-01-24 17:15:34 +01:00
|
|
|
|
2002-08-08 02:12:02 +02:00
|
|
|
int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset,
|
|
|
|
const char** errmsg);
|
2003-07-06 17:59:54 +02:00
|
|
|
void rotate_relay_log(MASTER_INFO* mi);
|
2002-01-20 03:16:52 +01:00
|
|
|
|
2002-11-07 02:54:00 +01:00
|
|
|
extern "C" pthread_handler_decl(handle_slave_io,arg);
|
|
|
|
extern "C" pthread_handler_decl(handle_slave_sql,arg);
|
2002-01-20 03:16:52 +01:00
|
|
|
extern bool volatile abort_loop;
|
2002-07-17 14:17:20 +02:00
|
|
|
extern MASTER_INFO main_mi, *active_mi; /* active_mi for multi-master */
|
2002-01-20 03:16:52 +01:00
|
|
|
extern volatile int active_mi_in_use;
|
|
|
|
extern LIST master_list;
|
2000-11-11 22:50:39 +01:00
|
|
|
extern HASH replicate_do_table, replicate_ignore_table;
|
2000-11-14 07:43:02 +01:00
|
|
|
extern DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table;
|
|
|
|
extern bool do_table_inited, ignore_table_inited,
|
|
|
|
wild_do_table_inited, wild_ignore_table_inited;
|
|
|
|
extern bool table_rules_on;
|
2000-11-11 22:50:39 +01:00
|
|
|
|
2000-12-02 18:11:50 +01:00
|
|
|
extern int disconnect_slave_event_count, abort_slave_event_count ;
|
2000-11-22 08:23:31 +01:00
|
|
|
|
2002-07-17 14:17:20 +02:00
|
|
|
/* the master variables are defaults read from my.cnf or command line */
|
2001-05-31 02:50:56 +02:00
|
|
|
extern uint master_port, master_connect_retry, report_port;
|
2000-11-11 22:50:39 +01:00
|
|
|
extern my_string master_user, master_password, master_host,
|
2002-01-29 17:32:16 +01:00
|
|
|
master_info_file, relay_log_info_file, report_user, report_host,
|
|
|
|
report_password;
|
2000-11-11 22:50:39 +01:00
|
|
|
|
|
|
|
extern I_List<i_string> replicate_do_db, replicate_ignore_db;
|
|
|
|
extern I_List<i_string_pair> replicate_rewrite_db;
|
|
|
|
extern I_List<THD> threads;
|
|
|
|
|
|
|
|
#endif
|
2002-12-16 14:33:29 +01:00
|
|
|
#else
|
|
|
|
#define SLAVE_IO 1
|
|
|
|
#define SLAVE_SQL 2
|
2003-01-15 09:11:44 +01:00
|
|
|
#endif /* HAVE_REPLICATION */
|