summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r--libmysql/libmysql.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 522b0869a60..eb8368977e9 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -2501,6 +2501,13 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row)
{
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
mysql->net.sqlstate);
+ /*
+ If there was an error, there are no more pending rows:
+ reset statement status to not hang up in following
+ mysql_stmt_close (it will try to flush result set before
+ closing the statement).
+ */
+ mysql->status= MYSQL_STATUS_READY;
goto error;
}
if (!*row)