diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-06-28 19:48:49 -0600 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-06-28 19:48:49 -0600 |
commit | 1ed2bcc8889f6b968c473044caaeefd603bb377b (patch) | |
tree | b4b1a65d3190201dcc5c9ad8a4a05f36ddcd759c /sql | |
parent | 09b6895facbfafb492d543e1ee801fd3075290c0 (diff) | |
parent | 62febccfec7e98d0c0a2f06c1662f787bd221dfc (diff) | |
download | mariadb-git-1ed2bcc8889f6b968c473044caaeefd603bb377b.tar.gz |
merged with 3.23 replication updates
mysql-test/r/type_float.result:
Auto merged
sql/sql_repl.h:
Auto merged
BitKeeper/triggers/post-commit:
merged with 3.23 updates
sql/mysqld.cc:
merged
sql/slave.cc:
merged
sql/sql_repl.cc:
merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innobase.cc | 4 | ||||
-rw-r--r-- | sql/mysqld.cc | 30 | ||||
-rw-r--r-- | sql/slave.cc | 14 | ||||
-rw-r--r-- | sql/sql_repl.cc | 36 | ||||
-rw-r--r-- | sql/sql_repl.h | 5 |
5 files changed, 78 insertions, 11 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 6bae31902c3..184c97837db 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -1523,6 +1523,10 @@ ha_innobase::update_row( DBUG_ENTER("ha_innobase::update_row"); + if (table->time_stamp) { + update_timestamp(new_row + table->time_stamp - 1); + } + if (last_query_id != user_thd->query_id) { prebuilt->sql_stat_start = TRUE; last_query_id = user_thd->query_id; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7c40b5f15ef..7c9cf11aca0 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2487,8 +2487,8 @@ enum options { OPT_GEMINI_UNBUFFERED_IO, OPT_SKIP_SAFEMALLOC, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINK, OPT_REPORT_HOST, OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT, - OPT_SHOW_SLAVE_AUTH_INFO -}; + OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP, + OPT_SHOW_SLAVE_AUTH_INFO}; static struct option long_options[] = { {"ansi", no_argument, 0, 'a'}, @@ -2573,6 +2573,10 @@ static struct option long_options[] = { (int) OPT_DISCONNECT_SLAVE_EVENT_COUNT}, {"abort-slave-event-count", required_argument, 0, (int) OPT_ABORT_SLAVE_EVENT_COUNT}, + {"max-binlog-dump-events", required_argument, 0, + (int) OPT_MAX_BINLOG_DUMP_EVENTS}, + {"sporadic-binlog-dump-fail", no_argument, 0, + (int) OPT_SPORADIC_BINLOG_DUMP_FAIL}, {"safemalloc-mem-limit", required_argument, 0, (int) OPT_SAFEMALLOC_MEM_LIMIT}, {"new", no_argument, 0, 'n'}, @@ -2634,6 +2638,9 @@ static struct option long_options[] = { {"temp-pool", no_argument, 0, (int) OPT_TEMP_POOL}, {"tmpdir", required_argument, 0, 't'}, {"use-locking", no_argument, 0, (int) OPT_USE_LOCKING}, +#ifdef USE_SYMDIR + {"use-symbolic-links", no_argument, 0, 's'}, +#endif {"user", required_argument, 0, 'u'}, {"version", no_argument, 0, 'V'}, {"warnings", no_argument, 0, 'W'}, @@ -3088,6 +3095,9 @@ static void usage(void) --remove Remove mysqld from the service list (NT)\n\ --standalone Dummy option to start as a standalone program (NT)\ "); +#ifdef USE_SYMDIR + puts("--use-symbolic-links Enable symbolic link support"); +#endif puts(""); #endif #ifdef HAVE_BERKELEY_DB @@ -3274,6 +3284,11 @@ static void get_options(int argc,char **argv) case 'r': mysqld_chroot=optarg; break; +#ifdef USE_SYMDIR + case 's': + my_use_symdir=1; /* Use internal symbolic links */ + break; +#endif case 't': mysql_tmpdir=optarg; break; @@ -3327,6 +3342,17 @@ static void get_options(int argc,char **argv) abort_slave_event_count = atoi(optarg); #endif break; + case (int)OPT_SPORADIC_BINLOG_DUMP_FAIL: +#ifndef DBUG_OFF + opt_sporadic_binlog_dump_fail = 1; +#endif + break; + case (int)OPT_MAX_BINLOG_DUMP_EVENTS: +#ifndef DBUG_OFF + max_binlog_dump_events = atoi(optarg); +#endif + break; + case (int) OPT_LOG_SLAVE_UPDATES: opt_log_slave_updates = 1; break; diff --git a/sql/slave.cc b/sql/slave.cc index 8ce6b59dd5b..e8ffb15110b 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1349,6 +1349,8 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused))) goto err; } +connected: + // register ourselves with the master // if fails, this is not fatal - we just print the error message and go // on with life @@ -1397,7 +1399,7 @@ try again, log '%s' at postion %s", RPL_LOG_NAME, goto err; } - continue; + goto connected; } @@ -1448,8 +1450,9 @@ reconnecting to retry, log '%s' position %s", RPL_LOG_NAME, reconnect done to recover from failed read"); goto err; } - break; - } + + goto connected; + } // if(event_len == packet_error) thd->proc_info = "Processing master log event"; if(exec_event(thd, &mysql->net, &glob_mi, event_len)) @@ -1492,9 +1495,8 @@ the slave thread with \"mysqladmin start-slave\". We stopped at log \ events_till_disconnect++; } #endif - - } - } + } // while(!slave_killed(thd)) - read/exec loop + } // while(!slave_killed(thd)) - slave loop // error = 0; err: diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 0c835ee4e57..95473888566 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -32,9 +32,11 @@ extern pthread_handler_decl(handle_slave,arg); HASH slave_list; -static uint32* slave_list_key(SLAVE_INFO* si, uint* len, - my_bool not_used __attribute__((unused))) -{ +#ifndef DBUG_OFF +int max_binlog_dump_events = 0; // unlimited +bool opt_sporadic_binlog_dump_fail = 0; +static int binlog_dump_count = 0; +#endif *len = 4; return &si->server_id; } @@ -349,8 +351,19 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags) int error; const char *errmsg = "Unknown error"; NET* net = &thd->net; +#ifndef DBUG_OFF + int left_events = max_binlog_dump_events; +#endif DBUG_ENTER("mysql_binlog_send"); +#ifndef DBUG_OFF + if (opt_sporadic_binlog_dump_fail && (binlog_dump_count++ % 2)) + { + errmsg = "Master failed COM_BINLOG_DUMP to test if slave can recover"; + goto err; + } +#endif + bzero((char*) &log,sizeof(log)); if(!mysql_bin_log.is_open()) @@ -410,6 +423,14 @@ impossible position"; while (!(error = Log_event::read_log_event(&log, packet, log_lock))) { +#ifndef DBUG_OFF + if(max_binlog_dump_events && !left_events--) + { + net_flush(net); + errmsg = "Debugging binlog dump abort"; + goto err; + } +#endif if (my_net_write(net, (char*)packet->ptr(), packet->length()) ) { errmsg = "Failed on my_net_write()"; @@ -484,6 +505,15 @@ impossible position"; bool read_packet = 0, fatal_error = 0; +#ifndef DBUG_OFF + if(max_binlog_dump_events && !left_events--) + { + net_flush(net); + errmsg = "Debugging binlog dump abort"; + goto err; + } +#endif + // no one will update the log while we are reading // now, but we'll be quick and just read one record pthread_mutex_lock(log_lock); diff --git a/sql/sql_repl.h b/sql/sql_repl.h index a3ba11bdfdb..a988658ed68 100644 --- a/sql/sql_repl.h +++ b/sql/sql_repl.h @@ -20,6 +20,11 @@ extern uint32 server_id; extern bool server_id_supplied; extern I_List<i_string> binlog_do_db, binlog_ignore_db; +#ifndef DBUG_OFF +extern int max_binlog_dump_events; +extern bool opt_sporadic_binlog_dump_fail; +#endif + File open_binlog(IO_CACHE *log, const char *log_file_name, const char **errmsg); |