diff options
author | Andrey Hristov <andrey@php.net> | 2010-03-17 18:00:47 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2010-03-17 18:00:47 +0000 |
commit | 4941b23bcd0f2dd56bb903dbd8d9da33a7d6b63f (patch) | |
tree | 084c36b604c237a2d67e2703c6613db19378bc46 | |
parent | 3ff193c05e0b0e093ec10c5d7ad2c83e0d5d7354 (diff) | |
download | php-git-4941b23bcd0f2dd56bb903dbd8d9da33a7d6b63f.tar.gz |
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.
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 101d8c4b89..563c018ad6 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 |