cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c
| From: | Andrey Hristov | Date: | Mon, 09 May 2005 21:47:40 +0000 |
| Subject: | cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31806@lists.php.net to get a copy of this message | ||
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 <georg@php.net> |
+----------------------------------------------------------------------+
- $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))) {