summaryrefslogtreecommitdiff
path: root/sql-common/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sql-common/client.c')
-rw-r--r--sql-common/client.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index fc76fa976e0..24e6bcf92e9 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2017, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -589,7 +589,7 @@ restart:
if (len == packet_error || len == 0)
{
DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %lu",
- vio_description(net->vio),len));
+ net->vio ? vio_description(net->vio) : NULL, len));
#ifdef MYSQL_SERVER
if (net->vio && (net->last_errno == ER_NET_READ_INTERRUPTED))
return (packet_error);
@@ -3866,8 +3866,6 @@ static void mysql_close_free(MYSQL *mysql)
static void mysql_prune_stmt_list(MYSQL *mysql)
{
LIST *element= mysql->stmts;
- LIST *pruned_list= 0;
-
for (; element; element= element->next)
{
MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
@@ -3877,14 +3875,9 @@ static void mysql_prune_stmt_list(MYSQL *mysql)
stmt->last_errno= CR_SERVER_LOST;
strmov(stmt->last_error, ER(CR_SERVER_LOST));
strmov(stmt->sqlstate, unknown_sqlstate);
- }
- else
- {
- pruned_list= list_add(pruned_list, element);
+ mysql->stmts= list_delete(mysql->stmts, element);
}
}
-
- mysql->stmts= pruned_list;
}