summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-06-11 13:12:29 +0400
committerunknown <konstantin@mysql.com>2004-06-11 13:12:29 +0400
commit82a4ba40609eaab1cb8f6877c984e13f091c5927 (patch)
tree3148a37c9c64fa96c93dcacc668076c318971be8 /libmysql/libmysql.c
parent799865eeeeec3db4ab13c972219a3ebd75a087a5 (diff)
downloadmariadb-git-82a4ba40609eaab1cb8f6877c984e13f091c5927.tar.gz
Fix for Bug#4079 "error checking in prepared statements":
reset mysql->status if there was an error in row reading. libmysql/libmysql.c: Fix for bug#4079 tests/client_test.c: Test for bug #4079
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)