From d2d4fdb23f6b38ff6718a35120043627582ee836 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Tue, 7 Sep 2010 14:18:01 +0700 Subject: Fixed bug #47485 - mysql_store_result returns a not NULL result set for a prepared statement. include/mysql.h: enumerator MYSQL_STATUS_STATEMENT_GET_RESULT was added into mysql_status enum. include/mysql.h.pp: enumerator MYSQL_STATUS_STATEMENT_GET_RESULT was added into mysql_status enum. libmysql/libmysql.c: Introduce a separate mysql state to distinguish the situation when we have a binary result set pending on the server from the situation when the result set is in text protocol. execute() modified: if mysql->status == MYSQL_STATUS_GET_RESULT before return then set it to value MYSQL_STATUS_STATEMENT_GET_RESULT. stmt_read_row_unbuffered() and mysql_stmt_store_result() were modified: added checking for mysql->status against MYSQL_STATUS_STATEMENT_GET_RESULT value instead of MYSQL_STATUS_GET_RESULT. tests/mysql_client_test.c: added test_bug47485() --- include/mysql.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/mysql.h') diff --git a/include/mysql.h b/include/mysql.h index dcf3e167e6a..699bd1f1b7f 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -224,7 +224,8 @@ struct st_mysql_options { enum mysql_status { - MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT + MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT, + MYSQL_STATUS_STATEMENT_GET_RESULT }; enum mysql_protocol_type -- cgit v1.2.1