From 4941b23bcd0f2dd56bb903dbd8d9da33a7d6b63f Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Wed, 17 Mar 2010 18:00:47 +0000 Subject: [PATCH] Fix a bug that a statement that is reset doesn't clean the wire properly (as it is done when the statement is closed). If there is more that one result sets returned from the PS (like a call to SP that returns at least one RSet next to the status rset) then the line was blocked. PS Multi-Res is not supported in any libmysql from a GA-ed MySQL. --- ext/mysqlnd/mysqlnd_ps.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 101d8c4b890..563c018ad6f 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1120,16 +1120,18 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC) We have to call the appropriate use_result() or store_result() and clean. */ - if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { - DBG_INF("fetching result set header"); - stmt->default_rset_handler(s TSRMLS_CC); - stmt->state = MYSQLND_STMT_USER_FETCHING; - } + do { + if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { + DBG_INF("fetching result set header"); + stmt->default_rset_handler(s TSRMLS_CC); + stmt->state = MYSQLND_STMT_USER_FETCHING; + } - if (stmt->result) { - DBG_INF("skipping result"); - stmt->result->m.skip_result(stmt->result TSRMLS_CC); - } + if (stmt->result) { + DBG_INF("skipping result"); + stmt->result->m.skip_result(stmt->result TSRMLS_CC); + } + } while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS); /* Don't free now, let the result be usable. When the stmt will again be