1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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
This commit is contained in:
unknown
2001-06-28 19:48:49 -06:00
11 changed files with 120 additions and 13 deletions

View File

@ -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);