andrey                                   Wed, 17 Mar 2010 18:00:47 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=296331

Log:
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.

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c       2010-03-17 
17:33:15 UTC (rev 296330)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c       2010-03-17 
18:00:47 UTC (rev 296331)
@@ -1120,16 +1120,18 @@
                  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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to