andrey Wed Nov 19 17:45:44 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/mysqlnd mysqlnd.c
Log:
MFH:
Fix a small bug that mysqlnd::next_result didn't care about an error in a
multi-statement. In an inner layer the error has been already set, thus it
needed better massage on the top level.
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5.2.33&r2=1.5.2.34&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.c
diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5.2.33
php-src/ext/mysqlnd/mysqlnd.c:1.5.2.34
--- php-src/ext/mysqlnd/mysqlnd.c:1.5.2.33 Tue Nov 18 18:02:44 2008
+++ php-src/ext/mysqlnd/mysqlnd.c Wed Nov 19 17:45:43 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd.c,v 1.5.2.33 2008/11/18 18:02:44 andrey Exp $ */
+/* $Id: mysqlnd.c,v 1.5.2.34 2008/11/19 17:45:43 andrey Exp $ */
#include "php.h"
#include "mysqlnd.h"
#include "mysqlnd_wireprotocol.h"
@@ -1733,9 +1733,17 @@
in mysqlnd_store_result() or mysqlnd_fetch_row_unbuffered()
*/
if (FAIL == (ret = mysqlnd_query_read_result_set_header(conn, NULL
TSRMLS_CC))) {
- DBG_ERR_FMT("Serious error. %s::%d", __FILE__, __LINE__);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serious error.
PID=%d", getpid());
- CONN_SET_STATE(conn, CONN_QUIT_SENT);
+ /*
+ There can be an error in the middle of a multi-statement,
which will cancel the multi-statement.
+ So there are no more results and we should just return FALSE,
error_no has been set
+ */
+ if (!conn->error_info.error_no) {
+ DBG_ERR_FMT("Serious error. %s::%d", __FILE__,
__LINE__);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serious
error. PID=%d", getpid());
+ CONN_SET_STATE(conn, CONN_QUIT_SENT);
+ } else {
+ DBG_INF_FMT("Error from the server : (%d) %s",
conn->error_info.error_no, conn->error_info.error);
+ }
}
DBG_RETURN(ret);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php