summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-03 14:43:34 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-03 14:43:34 +0200
commit8e797ae26753b9bd3f8fd107175d4751953d875b (patch)
treee7a1d1b8684ae18fbc562eb4a75d976bfed50ade /sql
parentaa5095627e2619bdad7916d33d1016802a84a9e1 (diff)
downloadmariadb-git-8e797ae26753b9bd3f8fd107175d4751953d875b.tar.gz
MDEV-8014 MariaDB client can hang in an infinite loop
On EOF vio_read returns 0, it's not an error so the errno is not reset. If the previous error was EINTR the client will loop forever. See also man recv.
Diffstat (limited to 'sql')
-rw-r--r--sql/net_serv.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 29b8417c698..0ce0fa93f99 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -917,7 +917,7 @@ my_real_read(NET *net, size_t *complen,
my_progname,vio_errno(net->vio));
}
#ifndef MYSQL_SERVER
- if (vio_errno(net->vio) == SOCKET_EINTR)
+ if (length != 0 && vio_errno(net->vio) == SOCKET_EINTR)
{
DBUG_PRINT("warning",("Interrupted read. Retrying..."));
continue;