helly Sun Nov 6 06:58:36 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/pgsql pgsql.c
Log:
- Fix parameter parsing
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.331.2.2&r2=1.331.2.3&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.331.2.2 php-src/ext/pgsql/pgsql.c:1.331.2.3
--- php-src/ext/pgsql/pgsql.c:1.331.2.2 Tue Oct 11 12:19:13 2005
+++ php-src/ext/pgsql/pgsql.c Sun Nov 6 06:58:34 2005
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.331.2.2 2005/10/11 16:19:13 iliaa Exp $ */
+/* $Id: pgsql.c,v 1.331.2.3 2005/11/06 11:58:34 helly Exp $ */
#include <stdlib.h>
@@ -1872,7 +1872,7 @@
/* {{{ void php_pgsql_fetch_hash */
static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long
result_type, int into_object)
{
- zval *result;
+ zval *result, *zrow = NULL;
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
int i, num_fields, pgsql_row, use_row;
@@ -1886,7 +1886,7 @@
char *class_name;
int class_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|lsz",
&result, &row, &class_name, &class_name_len, &ctor_params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!sz",
&result, &zrow, &class_name, &class_name_len, &ctor_params) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() < 3) {
@@ -1900,10 +1900,16 @@
}
result_type = PGSQL_ASSOC;
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll",
&result, &row, &result_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!l",
&result, &zrow, &result_type) == FAILURE) {
return;
}
}
+ if (zrow == NULL) {
+ row = -1;
+ } else {
+ convert_to_long(zrow);
+ row = Z_LVAL_P(zrow);
+ }
use_row = ZEND_NUM_ARGS() > 1 && row != -1;
if (!(result_type & PGSQL_BOTH)) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php