diff options
author | Johannes Schlüter <johannes@php.net> | 2008-12-01 21:20:27 +0000 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2008-12-01 21:20:27 +0000 |
commit | b79774409e953dfe829e098232d4ebf8d1ccbd77 (patch) | |
tree | ce1bd6a8dfaab845d4502125a483ef6104cc4441 | |
parent | f27f49cf96b5360748d0ef7b402d0d0c63b36cf4 (diff) | |
download | php-git-b79774409e953dfe829e098232d4ebf8d1ccbd77.tar.gz |
Fix mysql_fetch_* and tests after param parsing changes
-rw-r--r-- | ext/mysql/php_mysql.c | 8 | ||||
-rw-r--r-- | ext/mysql/tests/mysql_fetch_array.phpt | 4 | ||||
-rw-r--r-- | ext/mysql/tests/mysql_fetch_assoc.phpt | 6 | ||||
-rw-r--r-- | ext/mysql/tests/mysql_fetch_row.phpt | 4 |
4 files changed, 10 insertions, 12 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index c844ed0862..a827770705 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -2006,8 +2006,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, } result_type = MYSQL_ASSOC; } else { - result_type = MYSQL_BOTH; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &result_type) == FAILURE) { return; } @@ -2170,7 +2168,7 @@ PHP_FUNCTION(mysql_fetch_row) MYSQL_RES *result; zval *mysql_result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &mysql_result) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mysql_result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, -1, "MySQL result", le_result); @@ -2207,7 +2205,7 @@ PHP_FUNCTION(mysql_fetch_array) zval *mysql_result; long mode = MYSQLND_FETCH_BOTH; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &mysql_result, &mode) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mysql_result, &mode) == FAILURE) { return; } ZEND_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, -1, "MySQL result", le_result); @@ -2228,7 +2226,7 @@ PHP_FUNCTION(mysql_fetch_assoc) MYSQL_RES *result; zval *mysql_result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &mysql_result) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mysql_result) == FAILURE) { return; } ZEND_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, -1, "MySQL result", le_result); diff --git a/ext/mysql/tests/mysql_fetch_array.phpt b/ext/mysql/tests/mysql_fetch_array.phpt index c3a70ea55c..729523514a 100644 --- a/ext/mysql/tests/mysql_fetch_array.phpt +++ b/ext/mysql/tests/mysql_fetch_array.phpt @@ -15,8 +15,8 @@ $link = NULL; if (NULL !== ($tmp = @mysql_fetch_array())) printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); -if (false !== ($tmp = @mysql_fetch_array($link))) - printf("[002] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); +if (NULL != ($tmp = @mysql_fetch_array($link))) + printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); require('table.inc'); if (!$res = mysql_query("SELECT * FROM test ORDER BY id LIMIT 5", $link)) { diff --git a/ext/mysql/tests/mysql_fetch_assoc.phpt b/ext/mysql/tests/mysql_fetch_assoc.phpt index 172917b6fd..4479a2ab3e 100644 --- a/ext/mysql/tests/mysql_fetch_assoc.phpt +++ b/ext/mysql/tests/mysql_fetch_assoc.phpt @@ -17,8 +17,8 @@ $link = NULL; if (!is_null($tmp = @mysql_fetch_assoc())) printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); -if (false !== ($tmp = @mysql_fetch_assoc($link))) - printf("[002] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); +if (NULL !== ($tmp = @mysql_fetch_assoc($link))) + printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); require('table.inc'); if (!$res = mysql_query("SELECT id, label FROM test ORDER BY id LIMIT 1", $link)) { @@ -135,4 +135,4 @@ array(5) { [u"_foo"]=> NULL } -done!
\ No newline at end of file +done! diff --git a/ext/mysql/tests/mysql_fetch_row.phpt b/ext/mysql/tests/mysql_fetch_row.phpt index 797e7ba1c8..d9fff217ad 100644 --- a/ext/mysql/tests/mysql_fetch_row.phpt +++ b/ext/mysql/tests/mysql_fetch_row.phpt @@ -15,8 +15,8 @@ $link = NULL; if (!is_null($tmp = @mysql_fetch_row())) printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); -if (false !== ($tmp = @mysql_fetch_row($link))) - printf("[002] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); +if (NULL !== ($tmp = @mysql_fetch_row($link))) + printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); require('table.inc'); if (!$res = mysql_query("SELECT id, label FROM test ORDER BY id LIMIT 1", $link)) { |