summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2001-05-03 17:27:35 -0600
committersasha@mysql.sashanet.com <>2001-05-03 17:27:35 -0600
commitfe54369179738cd2e45f6ec6ea97eb82ed283598 (patch)
treeecd7ff078d860ffde8c328564a21fdb482219457
parentc6ceb04bd82c5e9958d213b54843b8635741381a (diff)
downloadmariadb-git-fe54369179738cd2e45f6ec6ea97eb82ed283598.tar.gz
better error message in replication when packet is too large
-rw-r--r--sql/mini_client.cc10
-rw-r--r--sql/slave.cc12
2 files changed, 19 insertions, 3 deletions
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index fa1b9da38a8..38180c0c6c8 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -330,8 +330,14 @@ mc_net_safe_read(MYSQL *mysql)
if(errno != EINTR)
{
mc_end_server(mysql);
- net->last_errno=CR_SERVER_LOST;
- strmov(net->last_error,ER(net->last_errno));
+ if(net->last_errno != ER_NET_PACKET_TOO_LARGE)
+ {
+ net->last_errno=CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
+ }
+ else
+ strmov(net->last_error, "Packet too large - increase \
+max_allowed_packet on this server");
}
return(packet_error);
}
diff --git a/sql/slave.cc b/sql/slave.cc
index aded6d558fc..6b9c376a625 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1293,9 +1293,19 @@ try again, log '%s' at postion %s", RPL_LOG_NAME,
sql_print_error("Slave thread killed while reading event");
goto err;
}
-
+
+
if (event_len == packet_error)
{
+ if(mc_mysql_errno(mysql) == ER_NET_PACKET_TOO_LARGE)
+ {
+ sql_print_error("Log entry on master is longer than \
+max_allowed_packet on slave. Slave thread will be aborted. If the entry is \
+really supposed to be that long, restart the server with a higher value of \
+max_allowed_packet. The current value is %ld", max_allowed_packet);
+ goto err;
+ }
+
thd->proc_info = "Waiting to reconnect after a failed read";
if(mysql->net.vio)
vio_close(mysql->net.vio);