summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-12-18 17:38:59 +0400
committerunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-12-18 17:38:59 +0400
commit045158fc287bb3c2af84c2219a0fa78394c6abde (patch)
tree23d1e1dbbf760af651069fd44fd84259410a58df /sql/slave.cc
parent3c04f839b9326a9eb3090a74128d7466af9827dd (diff)
downloadmariadb-git-045158fc287bb3c2af84c2219a0fa78394c6abde.tar.gz
Fix for bug #10798: If relay log fails to rotate, slave will crash after
The relay log may not be open for some reason (e.g. disk error) after rotation, and using it causes the slave crash. Fix: check we have it open before access, return error otherwise. sql/slave.cc: Fix for bug #10798: If relay log fails to rotate, slave will crash after - check if the relay log is open before any access.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 6785e92b9f9..9c8d4d86c60 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -4284,6 +4284,13 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
hot_log=0; // Using old binary log
}
}
+ /*
+ As there is no guarantee that the relay is open (for example, an I/O
+ error during a write by the slave I/O thread may have closed it), we
+ have to test it.
+ */
+ if (!my_b_inited(cur_log))
+ goto err;
#ifndef DBUG_OFF
{
char llbuf1[22], llbuf2[22];