cvs: php-src(PHP_5_1) /ext/pdo_mysql mysql_statement.c
| From: | Wez Furlong | Date: | Sun, 09 Apr 2006 06:49:07 +0000 |
| Subject: | cvs: php-src(PHP_5_1) /ext/pdo_mysql mysql_statement.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-37714@lists.php.net to get a copy of this message | ||
wez Sun Apr 9 06:49:07 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/ext/pdo_mysql mysql_statement.c
Log:
This completes the fix for PECL #5827; we need to gobble up result sets in the
stmt dtor too.
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_mysql/mysql_statement.c?r1=1.48.2.12&r2=1.48.2.13&diff_format=u
Index: php-src/ext/pdo_mysql/mysql_statement.c
diff -u php-src/ext/pdo_mysql/mysql_statement.c:1.48.2.12
php-src/ext/pdo_mysql/mysql_statement.c:1.48.2.13
--- php-src/ext/pdo_mysql/mysql_statement.c:1.48.2.12 Sun Apr 9 06:41:42 2006
+++ php-src/ext/pdo_mysql/mysql_statement.c Sun Apr 9 06:49:07 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql_statement.c,v 1.48.2.12 2006/04/09 06:41:42 wez Exp $ */
+/* $Id: mysql_statement.c,v 1.48.2.13 2006/04/09 06:49:07 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -67,6 +67,16 @@
efree(S->out_length);
}
#endif
+#if HAVE_MYSQL_NEXT_RESULT
+ while (mysql_more_results(S->H->server)) {
+ if (mysql_next_result(S->H->server) == 0) {
+ MYSQL_RES *res = mysql_store_result(S->H->server);
+ if (res) {
+ mysql_free_result(res);
+ }
+ }
+ }
+#endif
efree(S);
return 1;
}