From fe54369179738cd2e45f6ec6ea97eb82ed283598 Mon Sep 17 00:00:00 2001 From: "sasha@mysql.sashanet.com" <> Date: Thu, 3 May 2001 17:27:35 -0600 Subject: better error message in replication when packet is too large --- sql/mini_client.cc | 10 ++++++++-- sql/slave.cc | 12 +++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'sql') 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); -- cgit v1.2.1