PHP mysqlnd svn commit: r753 - in trunk: mysqlnd php5/ext/mysqli php6/ext/mysqli
Author: ahristov
Date: 2007-07-13 17:50:37 +0200 (Fri, 13 Jul 2007)
New Revision: 753
Modified:
trunk/mysqlnd/mysqlnd_ps.c
trunk/php5/ext/mysqli/mysqli_api.c
trunk/php6/ext/mysqli/mysqli_api.c
Log:
Fix a bug in PS, is_ref should not be touched by us:
we don't separate zvals.
Modified: trunk/mysqlnd/mysqlnd_ps.c
- trunk/mysqlnd/mysqlnd_ps.c 2007-07-13 13:46:59 UTC (rev 752)
+++ trunk/mysqlnd/mysqlnd_ps.c 2007-07-13 15:50:37 UTC (rev 753)
@@ -1081,8 +1081,11 @@
for (i = 0; i < stmt->field_count; i++) {
/* Prevent from freeing */
ZVAL_ADDREF(stmt->result_bind[i].zv);
- /* Update as ZVAL_ADDREF does not do it */
- stmt->result_bind[i].zv->is_ref = 0;/* Definitely should be 0, or 009.phpt will fail */
+ /*
+ Don't update is_ref !!! it's not our job
+ Otherwise either 009.phpt or mysqli_stmt_bind_result.phpt
+ will fail.
+ */
stmt->result_bind[i].bound = TRUE;
}
} else if (result_bind) {
Modified: trunk/php5/ext/mysqli/mysqli_api.c
- trunk/php5/ext/mysqli/mysqli_api.c 2007-07-13 13:46:59 UTC (rev 752)
+++ trunk/php5/ext/mysqli/mysqli_api.c 2007-07-13 15:50:37 UTC (rev 753)
@@ -472,6 +472,11 @@ WRONG_PARAM_COUNT;
}
+ if ((argc - start) != mysql_stmt_field_count(stmt->stmt)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
+ RETURN_FALSE;
+ }
+
args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
@@ -479,13 +484,6 @@
WRONG_PARAM_COUNT;
}
-
- if ((argc - start) != mysql_stmt_field_count(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
- efree(args);
- RETURN_FALSE;
- }
-
rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc, start TSRMLS_CC);
efree(args);
Modified: trunk/php6/ext/mysqli/mysqli_api.c
- trunk/php6/ext/mysqli/mysqli_api.c 2007-07-13 13:46:59 UTC (rev 752)
+++ trunk/php6/ext/mysqli/mysqli_api.c 2007-07-13 15:50:37 UTC (rev 753)
@@ -474,6 +474,11 @@ WRONG_PARAM_COUNT;
}
+ if ((argc - start) != mysql_stmt_field_count(stmt->stmt)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
+ RETURN_FALSE;
+ }
+
args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
@@ -481,13 +486,6 @@
WRONG_PARAM_COUNT;
}
-
- if ((argc - start) != mysql_stmt_field_count(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
- efree(args);
- RETURN_FALSE;
- }
-
rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc, start TSRMLS_CC);
efree(args);
--
MySQL Code Commits Mailing List
For list archives:
http://lists.mysql.com/commits
To unsubscribe:
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Fri Jul 13 11:50:41 2007
This archive was generated by hypermail 2.1.8
: Thu Aug 02 2007 - 01:56:02 EDT
|