andrey Mon May 9 17:47:40 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/mysqli mysqli_api.c
Log:
warn the user if he wants to prepare before fetching all previous data
(in case mysqli_stmt_store_result() wasn't called or not enough calls
to mysqli_stmt_fetch()).
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.17&r2=1.87.2.18&ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.17
php-src/ext/mysqli/mysqli_api.c:1.87.2.18
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.17 Sat May 7 03:47:24 2005
+++ php-src/ext/mysqli/mysqli_api.c Mon May 9 17:47:36 2005
@@ -15,7 +15,7 @@
| Author: Georg Richter <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: mysqli_api.c,v 1.87.2.17 2005/05/07 07:47:24 andrey Exp $
+ $Id: mysqli_api.c,v 1.87.2.18 2005/05/09 21:47:36 andrey Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -1271,6 +1271,10 @@
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
+ if (mysql->mysql->status == MYSQL_STATUS_GET_RESULT) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "All data must be
fetched before a new preparing of a statement takes place");
+ RETURN_FALSE;
+ }
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php