cvs: php-src /ext/mysqlnd mysqlnd.c
| From: | Andrey Hristov | Date: | Wed, 19 Nov 2008 17:41:25 +0000 |
| Subject: | cvs: php-src /ext/mysqlnd mysqlnd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-54327@lists.php.net to get a copy of this message | ||
andrey Wed Nov 19 17:41:25 2008 UTC
Modified files:
/php-src/ext/mysqlnd mysqlnd.c
Log:
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.34&r2=1.35&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.c
diff -u php-src/ext/mysqlnd/mysqlnd.c:1.34 php-src/ext/mysqlnd/mysqlnd.c:1.35
--- php-src/ext/mysqlnd/mysqlnd.c:1.34 Tue Nov 18 18:02:06 2008
+++ php-src/ext/mysqlnd/mysqlnd.c Wed Nov 19 17:41:25 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd.c,v 1.34 2008/11/18 18:02:06 andrey Exp $ */
+/* $Id: mysqlnd.c,v 1.35 2008/11/19 17:41:25 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);