diff options
author | unknown <lars@mysql.com> | 2005-12-22 06:39:02 +0100 |
---|---|---|
committer | unknown <lars@mysql.com> | 2005-12-22 06:39:02 +0100 |
commit | 09346e6e2de57fadc94f70beb29eabe5186dbe62 (patch) | |
tree | 192a6c65973c50f6a436a8c6e6bb19efa2ed2419 /sql/slave.h | |
parent | 65c560e9b836953bba66307268430f0faf50ca3c (diff) | |
download | mariadb-git-09346e6e2de57fadc94f70beb29eabe5186dbe62.tar.gz |
WL#1012: All changes as one single changeset.
This includes both code and test cases.
BitKeeper/deleted/.del-ctype_ucs_binlog.result~280d136b1a0bcf17:
Delete: mysql-test/r/ctype_ucs_binlog.result
BitKeeper/deleted/.del-rpl_delete_all.result~7c050d592614b3f:
Delete: mysql-test/r/rpl_delete_all.result
BitKeeper/deleted/.del-rpl000013-slave.opt~18266ad8a2403e8d:
Delete: mysql-test/t/rpl000013-slave.opt
BitKeeper/deleted/.del-rpl_delete_all.test~700a1490277780e0:
Delete: mysql-test/t/rpl_delete_all.test
mysql-test/extra/binlog_tests/binlog.test:
Import patch wl1012.patch
mysql-test/extra/binlog_tests/blackhole.test:
Import patch wl1012.patch
mysql-test/extra/binlog_tests/ctype_cp932.test:
Import patch wl1012.patch
mysql-test/extra/binlog_tests/ctype_cp932_binlog.test:
Import patch wl1012.patch
mysql-test/extra/binlog_tests/ctype_ucs_binlog.test:
Import patch wl1012.patch
mysql-test/extra/binlog_tests/drop_temp_table.test:
Import patch wl1012.patch
mysql-test/extra/binlog_tests/insert_select-binlog.test:
Import patch wl1012.patch
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_ddl.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_deadlock.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_err_ignoredtable.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_loaddata_m.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_log.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_multi_query.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_reset_slave.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_stm_000001.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_stm_EE_err.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_stm_charset.test:
Import patch wl1012.patch
mysql-test/extra/rpl_tests/rpl_user_variables.test:
Import patch wl1012.patch
mysql-test/r/binlog_stm_binlog.result:
Import patch wl1012.patch
mysql-test/r/binlog_stm_blackhole.result:
Import patch wl1012.patch
mysql-test/r/binlog_stm_ctype_cp932.result:
Import patch wl1012.patch
mysql-test/r/binlog_stm_ctype_ucs.result:
Import patch wl1012.patch
mysql-test/r/binlog_stm_drop_tmp_tbl.result:
Import patch wl1012.patch
mysql-test/r/binlog_stm_insert_select.result:
Import patch wl1012.patch
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
Import patch wl1012.patch
mysql-test/r/rpl_000012.result:
Import patch wl1012.patch
mysql-test/r/rpl_000015.result:
Import patch wl1012.patch
mysql-test/r/rpl_deadlock_innodb.result:
Import patch wl1012.patch
mysql-test/r/rpl_flushlog_loop.result:
Import patch wl1012.patch
mysql-test/r/rpl_loaddata_s.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_000001.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_EE_err.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_charset.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_ddl.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_err_ignoredtable.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_flsh_tbls.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_loaddata_m.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_log.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_max_relay_size.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_multi_query.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_mystery22.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_reset_slave.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_rewrt_db.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_sp.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_timezone.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_until.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_user_variables.result:
Import patch wl1012.patch
mysql-test/r/rpl_stm_view.result:
Import patch wl1012.patch
mysql-test/t/binlog_row_binlog-master.opt:
Import patch wl1012.patch
mysql-test/t/rpl_000012.test:
Import patch wl1012.patch
mysql-test/t/rpl_000015-slave.sh:
Import patch wl1012.patch
mysql-test/t/rpl_000015.slave-mi:
Import patch wl1012.patch
mysql-test/t/rpl_000015.test:
Import patch wl1012.patch
mysql-test/t/rpl_deadlock_innodb-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_flushlog_loop-master.opt:
Import patch wl1012.patch
mysql-test/t/rpl_flushlog_loop-master.sh:
Import patch wl1012.patch
mysql-test/t/rpl_flushlog_loop-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_flushlog_loop-slave.sh:
Import patch wl1012.patch
mysql-test/t/rpl_flushlog_loop.test:
Import patch wl1012.patch
mysql-test/t/rpl_loaddata_s-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_loaddata_s.test:
Import patch wl1012.patch
mysql-test/t/rpl_stm_000001-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_err_ignoredtable-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_loaddata_m-master.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_log-master.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_log-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_mystery22.test:
Import patch wl1012.patch
mysql-test/t/rpl_stm_rewrt_db-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_rewrt_db.test:
Import patch wl1012.patch
mysql-test/t/rpl_stm_sp-master.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_sp-slave.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_sp.test:
Import patch wl1012.patch
mysql-test/t/rpl_stm_timezone-master.opt:
Import patch wl1012.patch
mysql-test/t/rpl_stm_timezone-slave.opt:
Import patch wl1012.patch
BUILD/SETUP.sh:
Import patch wl1012.patch
Makefile.am:
Import patch wl1012.patch
mysql-test/t/rpl_stm_timezone.test:
Import patch wl1012.patch
mysql-test/t/rpl_stm_until.test:
Import patch wl1012.patch
mysql-test/t/rpl_stm_view.test:
Import patch wl1012.patch
client/Makefile.am:
Import patch wl1012.patch
client/client_priv.h:
Import patch wl1012.patch
client/mysqlbinlog.cc:
Import patch wl1012.patch
configure.in:
Import patch wl1012.patch
include/Makefile.am:
Import patch wl1012.patch
include/base64.h:
Import patch wl1012.patch
include/config-win.h:
Import patch wl1012.patch
include/my_base.h:
Import patch wl1012.patch
include/my_global.h:
Import patch wl1012.patch
mysql-test/Makefile.am:
Import patch wl1012.patch
mysql-test/mysql-test-run.pl:
Import patch wl1012.patch
mysql-test/mysql-test-run.sh:
Import patch wl1012.patch
mysql-test/r/date_formats.result:
Import patch wl1012.patch
mysql-test/r/flush_block_commit.result:
Import patch wl1012.patch
mysql-test/r/innodb.result:
Import patch wl1012.patch
mysql-test/r/rpl000017.result:
Import patch wl1012.patch
mysql-test/r/rpl_change_master.result:
Import patch wl1012.patch
mysql-test/r/rpl_commit_after_flush.result:
Import patch wl1012.patch
mysql-test/r/rpl_create_database.result:
Import patch wl1012.patch
mysql-test/r/rpl_do_grant.result:
Import patch wl1012.patch
mysql-test/r/rpl_loaddata.result:
Import patch wl1012.patch
mysql-test/r/rpl_log_pos.result:
Import patch wl1012.patch
mysql-test/r/rpl_multi_delete.result:
Import patch wl1012.patch
mysql-test/r/rpl_multi_update.result:
Import patch wl1012.patch
mysql-test/r/rpl_openssl.result:
Import patch wl1012.patch
mysql-test/r/rpl_replicate_do.result:
Import patch wl1012.patch
mysql-test/r/rpl_rotate_logs.result:
Import patch wl1012.patch
mysql-test/r/rpl_server_id1.result:
Import patch wl1012.patch
mysql-test/r/rpl_server_id2.result:
Import patch wl1012.patch
mysql-test/r/rpl_temporary.result:
Import patch wl1012.patch
mysql-test/r/user_var-binlog.result:
Import patch wl1012.patch
mysql-test/t/create_select_tmp.test:
Import patch wl1012.patch
mysql-test/t/date_formats.test:
Import patch wl1012.patch
mysql-test/t/disabled.def:
Import patch wl1012.patch
mysql-test/t/innodb.test:
Import patch wl1012.patch
mysql-test/t/mysqlbinlog.test:
Import patch wl1012.patch
mysql-test/t/mysqlbinlog2.test:
Import patch wl1012.patch
mysql-test/t/rpl000002.test:
Import patch wl1012.patch
mysql-test/t/rpl000006.test:
Import patch wl1012.patch
mysql-test/t/rpl000013.test:
Import patch wl1012.patch
mysql-test/t/rpl000017.test:
Import patch wl1012.patch
mysql-test/t/rpl_auto_increment.test:
Import patch wl1012.patch
mysql-test/t/rpl_change_master.test:
Import patch wl1012.patch
mysql-test/t/rpl_commit_after_flush.test:
Import patch wl1012.patch
mysql-test/t/rpl_create_database.test:
Import patch wl1012.patch
mysql-test/t/rpl_do_grant.test:
Import patch wl1012.patch
mysql-test/t/rpl_drop.test:
Import patch wl1012.patch
mysql-test/t/rpl_empty_master_crash.test:
Import patch wl1012.patch
mysql-test/t/rpl_failed_optimize.test:
Import patch wl1012.patch
mysql-test/t/rpl_heap.test:
Import patch wl1012.patch
mysql-test/t/rpl_insert_id.test:
Import patch wl1012.patch
mysql-test/t/rpl_insert_ignore.test:
Import patch wl1012.patch
mysql-test/t/rpl_loaddata.test:
Import patch wl1012.patch
mysql-test/t/rpl_log_pos.test:
Import patch wl1012.patch
mysql-test/t/rpl_multi_delete.test:
Import patch wl1012.patch
mysql-test/t/rpl_multi_update.test:
Import patch wl1012.patch
mysql-test/t/rpl_multi_update2.test:
Import patch wl1012.patch
mysql-test/t/rpl_multi_update3.test:
Import patch wl1012.patch
mysql-test/t/rpl_openssl.test:
Import patch wl1012.patch
mysql-test/t/rpl_redirect.test:
Import patch wl1012.patch
mysql-test/t/rpl_relayrotate.test:
Import patch wl1012.patch
mysql-test/t/rpl_replicate_do.test:
Import patch wl1012.patch
mysql-test/t/rpl_rotate_logs.test:
Import patch wl1012.patch
mysql-test/t/rpl_server_id1.test:
Import patch wl1012.patch
mysql-test/t/rpl_sp_effects.test:
Import patch wl1012.patch
mysql-test/t/rpl_temporary.test:
Import patch wl1012.patch
mysql-test/t/rpl_trigger.test:
Import patch wl1012.patch
mysql-test/t/sp.test:
Import patch wl1012.patch
mysql-test/t/user_var-binlog.test:
Import patch wl1012.patch
mysys/Makefile.am:
Import patch wl1012.patch
mysys/base64.c:
Import patch wl1012.patch
sql/Makefile.am:
Import patch wl1012.patch
sql/ha_innodb.cc:
Import patch wl1012.patch
sql/ha_innodb.h:
Import patch wl1012.patch
sql/ha_partition.cc:
Import patch wl1012.patch
sql/handler.cc:
Import patch wl1012.patch
sql/handler.h:
Import patch wl1012.patch
sql/item_sum.cc:
Import patch wl1012.patch
sql/log.cc:
Import patch wl1012.patch
sql/log_event.cc:
Import patch wl1012.patch
sql/log_event.h:
Import patch wl1012.patch
sql/mysql_priv.h:
Import patch wl1012.patch
sql/mysqld.cc:
Import patch wl1012.patch
sql/rpl_filter.h:
Import patch wl1012.patch
sql/set_var.cc:
Import patch wl1012.patch
sql/share/errmsg.txt:
Import patch wl1012.patch
sql/slave.cc:
Import patch wl1012.patch
sql/slave.h:
Import patch wl1012.patch
sql/sp.cc:
Import patch wl1012.patch
sql/sp_head.cc:
Import patch wl1012.patch
sql/sql_acl.cc:
Import patch wl1012.patch
sql/sql_base.cc:
Import patch wl1012.patch
sql/sql_class.cc:
Import patch wl1012.patch
sql/sql_class.h:
Import patch wl1012.patch
sql/sql_delete.cc:
Import patch wl1012.patch
sql/sql_insert.cc:
Import patch wl1012.patch
sql/sql_lex.h:
Import patch wl1012.patch
sql/sql_list.h:
Import patch wl1012.patch
sql/sql_load.cc:
Import patch wl1012.patch
sql/sql_parse.cc:
Import patch wl1012.patch
sql/sql_plugin.cc:
Import patch wl1012.patch
sql/sql_rename.cc:
Import patch wl1012.patch
sql/sql_repl.h:
Import patch wl1012.patch
sql/sql_select.cc:
Import patch wl1012.patch
sql/sql_show.cc:
Import patch wl1012.patch
sql/sql_table.cc:
Import patch wl1012.patch
sql/sql_udf.cc:
Import patch wl1012.patch
sql/sql_union.cc:
Import patch wl1012.patch
sql/sql_update.cc:
Import patch wl1012.patch
sql/sql_yacc.yy:
Import patch wl1012.patch
sql/table.cc:
Import patch wl1012.patch
sql/table.h:
Import patch wl1012.patch
storage/innobase/include/lock0lock.h:
Import patch wl1012.patch
storage/innobase/include/row0mysql.h:
Import patch wl1012.patch
storage/innobase/include/row0vers.h:
Import patch wl1012.patch
storage/innobase/lock/lock0lock.c:
Import patch wl1012.patch
storage/innobase/row/row0mysql.c:
Import patch wl1012.patch
storage/innobase/row/row0sel.c:
Import patch wl1012.patch
storage/innobase/row/row0vers.c:
Import patch wl1012.patch
Diffstat (limited to 'sql/slave.h')
-rw-r--r-- | sql/slave.h | 291 |
1 files changed, 17 insertions, 274 deletions
diff --git a/sql/slave.h b/sql/slave.h index c994bfb2d34..6870aaca752 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -14,17 +14,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef HAVE_REPLICATION - #ifndef SLAVE_H #define SLAVE_H -#include "mysql.h" +#ifdef HAVE_REPLICATION + +#include "log.h" #include "my_list.h" #include "rpl_filter.h" +#include "rpl_tblmap.h" +#include "rpl_rli.h" #define SLAVE_NET_TIMEOUT 3600 -#define MAX_SLAVE_ERRMSG 1024 + #define MAX_SLAVE_ERROR 2000 /***************************************************************************** @@ -110,265 +112,7 @@ struct st_master_info; #define MYSQL_SLAVE_RUN_NOT_CONNECT 1 #define MYSQL_SLAVE_RUN_CONNECT 2 -/**************************************************************************** - - 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 - - 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() - -*****************************************************************************/ - -typedef struct st_relay_log_info -{ - /*** The following variables can only be read when protect by data lock ****/ - - /* - 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 - */ - File info_fd,cur_log_fd; - - /* - Protected with internal locks. - Must get data_lock when resetting the logs. - */ - MYSQL_LOG relay_log; - LOG_INFO linfo; - IO_CACHE cache_buf,*cur_log; - - /* The following variables are safe to read any time */ - - /* IO_CACHE of the info file - set only during init or end */ - IO_CACHE info_file; - - /* - 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. - */ - TABLE *save_temporary_tables; - - /* - standard lock acquistion order to avoid deadlocks: - run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index - */ - pthread_mutex_t data_lock,run_lock; - - /* - 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; - - /* parent master info structure */ - struct st_master_info *mi; - - /* - Needed to deal properly with cur_log getting closed and re-opened with - a different log under our feet - */ - uint32 cur_log_old_open_count; - - /* - 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; - ulonglong future_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. - */ - char group_master_log_name[FN_REFLEN]; - volatile my_off_t group_master_log_pos; - - /* - 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, the SQL thread sets it to unblock the I/O thread and make it - temporarily forget about the constraint. - */ - ulonglong log_space_limit,log_space_total; - bool ignore_log_space_limit; - - /* - When it commits, InnoDB internally stores the master log position it has - processed so far; the position to store is the one of the end of the - committing event (the COMMIT query event, or the event if in autocommit - mode). - */ -#if MYSQL_VERSION_ID < 40100 - ulonglong future_master_log_pos; -#else - ulonglong future_group_master_log_pos; -#endif - - time_t last_master_timestamp; - - /* - 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. - */ - volatile uint32 slave_skip_counter; - volatile ulong abort_pos_wait; /* Incremented on change master */ - volatile ulong slave_run_id; /* Incremented on slave start */ - pthread_mutex_t log_space_lock; - pthread_cond_t log_space_cond; - THD * sql_thd; - int last_slave_errno; -#ifndef DBUG_OFF - int events_till_abort; -#endif - char last_slave_error[MAX_SLAVE_ERRMSG]; - - /* if not set, the value of other members of the structure are undefined */ - bool inited; - volatile bool abort_slave; - volatile uint slave_running; - - /* - Condition and its parameters from START SLAVE UNTIL clause. - - UNTIL condition is tested with is_until_satisfied() method that is - called by exec_relay_log_event(). is_until_satisfied() caches the result - of the comparison of log names because log names don't change very often; - this cache is invalidated by parts of code which change log names with - notify_*_log_name_updated() methods. (They need to be called only if SQL - thread is running). - */ - - enum {UNTIL_NONE= 0, UNTIL_MASTER_POS, UNTIL_RELAY_POS} until_condition; - char until_log_name[FN_REFLEN]; - ulonglong until_log_pos; - /* extension extracted from log_name and converted to int */ - ulong until_log_name_extension; - /* - Cached result of comparison of until_log_name and current log name - -2 means unitialised, -1,0,1 are comarison results - */ - enum - { - UNTIL_LOG_NAMES_CMP_UNKNOWN= -2, UNTIL_LOG_NAMES_CMP_LESS= -1, - UNTIL_LOG_NAMES_CMP_EQUAL= 0, UNTIL_LOG_NAMES_CMP_GREATER= 1 - } until_log_names_cmp_result; - - char cached_charset[6]; - /* - trans_retries varies between 0 to slave_transaction_retries and counts how - many times the slave has retried the present transaction; gets reset to 0 - when the transaction finally succeeds. retried_trans is a cumulative - counter: how many times the slave has retried a transaction (any) since - slave started. - */ - ulong trans_retries, retried_trans; - - /* - If the end of the hot relay log is made of master's events ignored by the - slave I/O thread, these two keep track of the coords (in the master's - binlog) of the last of these events seen by the slave I/O thread. If not, - ign_master_log_name_end[0] == 0. - As they are like a Rotate event read/written from/to the relay log, they - are both protected by rli->relay_log.LOCK_log. - */ - char ign_master_log_name_end[FN_REFLEN]; - ulonglong ign_master_log_pos_end; - - st_relay_log_info(); - ~st_relay_log_info(); - - /* - Invalidate cached until_log_name and group_relay_log_name comparison - result. Should be called after any update of group_realy_log_name if - there chances that sql_thread is running. - */ - inline void notify_group_relay_log_name_update() - { - if (until_condition==UNTIL_RELAY_POS) - until_log_names_cmp_result= UNTIL_LOG_NAMES_CMP_UNKNOWN; - } - - /* - The same as previous but for group_master_log_name. - */ - inline void notify_group_master_log_name_update() - { - if (until_condition==UNTIL_MASTER_POS) - until_log_names_cmp_result= UNTIL_LOG_NAMES_CMP_UNKNOWN; - } - - inline void inc_event_relay_log_pos() - { - event_relay_log_pos= future_event_relay_log_pos; - } - - void inc_group_relay_log_pos(ulonglong log_pos, - bool skip_lock=0); - - int wait_for_pos(THD* thd, String* log_name, longlong log_pos, - longlong timeout); - void close_temporary_tables(); - - /* Check if UNTIL condition is satisfied. See slave.cc for more. */ - bool is_until_satisfied(); - inline ulonglong until_pos() - { - return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos : - group_relay_log_pos); - } - /* - Last charset (6 bytes) seen by slave SQL thread is cached here; it helps - the thread save 3 get_charset() per Query_log_event if the charset is not - changing from event to event (common situation). - When the 6 bytes are equal to 0 is used to mean "cache is invalidated". - */ - void cached_charset_invalidate(); - bool cached_charset_compare(char *charset); -} RELAY_LOG_INFO; - - -Log_event* next_event(RELAY_LOG_INFO* rli); +static Log_event* next_event(RELAY_LOG_INFO* rli); /***************************************************************************** @@ -427,7 +171,7 @@ typedef struct st_master_info uint port; uint connect_retry; #ifndef DBUG_OFF - int events_till_abort; + int events_till_disconnect; #endif bool inited; volatile bool abort_slave; @@ -474,17 +218,11 @@ typedef struct st_master_info int queue_event(MASTER_INFO* mi,const char* buf,ulong event_len); -#define MAX_SLAVE_ERRMSG 1024 - #define RPL_LOG_NAME (rli->group_master_log_name[0] ? rli->group_master_log_name :\ "FIRST") #define IO_RPL_LOG_NAME (mi->master_log_name[0] ? mi->master_log_name :\ "FIRST") -/* masks for start/stop operations on io and sql slave threads */ -#define SLAVE_IO 1 -#define SLAVE_SQL 2 - /* If the following is set, if first gives an error, second will be tried. Otherwise, if first fails, we fail. @@ -533,7 +271,8 @@ bool show_binlog_info(THD* thd); const char *print_slave_db_safe(const char *db); int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code); void skip_load_data_infile(NET* net); -void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...); +void slave_print_msg(enum loglevel level, RELAY_LOG_INFO* rli, + int err_code, const char* msg, ...); void end_slave(); /* clean up */ void init_master_info_with_options(MASTER_INFO* mi); @@ -579,8 +318,12 @@ extern my_string master_ssl_ca, master_ssl_capath, master_ssl_cert, extern I_List<THD> threads; -#endif -#else +#endif /* HAVE_REPLICATION */ + +/* masks for start/stop operations on io and sql slave threads */ #define SLAVE_IO 1 #define SLAVE_SQL 2 -#endif /* HAVE_REPLICATION */ + +#endif + + |