johannes                Mon Dec  1 21:20:27 2008 UTC

  Modified files:              
    /php-src/ext/mysql  php_mysql.c 
    /php-src/ext/mysql/tests    mysql_fetch_array.phpt 
                                mysql_fetch_assoc.phpt 
                                mysql_fetch_row.phpt 
  Log:
  Fix mysql_fetch_* and tests after param parsing changes
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.270&r2=1.271&diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.270 php-src/ext/mysql/php_mysql.c:1.271
--- php-src/ext/mysql/php_mysql.c:1.270 Fri Nov 28 20:21:35 2008
+++ php-src/ext/mysql/php_mysql.c       Mon Dec  1 21:20:27 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
  
-/* $Id: php_mysql.c,v 1.270 2008/11/28 20:21:35 johannes Exp $ */
+/* $Id: php_mysql.c,v 1.271 2008/12/01 21:20:27 johannes Exp $ */
 
 /* TODO:
  *
@@ -2006,8 +2006,6 @@
                }
                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 @@
        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 @@
        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 @@
        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);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_fetch_array.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysql/tests/mysql_fetch_array.phpt
diff -u php-src/ext/mysql/tests/mysql_fetch_array.phpt:1.4 
php-src/ext/mysql/tests/mysql_fetch_array.phpt:1.5
--- php-src/ext/mysql/tests/mysql_fetch_array.phpt:1.4  Thu Apr 24 14:04:57 2008
+++ php-src/ext/mysql/tests/mysql_fetch_array.phpt      Mon Dec  1 21:20:27 2008
@@ -15,8 +15,8 @@
 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)) {
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_fetch_assoc.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysql/tests/mysql_fetch_assoc.phpt
diff -u php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.4 
php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.5
--- php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.4  Wed Oct 10 10:56:33 2007
+++ php-src/ext/mysql/tests/mysql_fetch_assoc.phpt      Mon Dec  1 21:20:27 2008
@@ -17,8 +17,8 @@
 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 @@
   [u"_foo"]=>
   NULL
 }
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_fetch_row.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysql/tests/mysql_fetch_row.phpt
diff -u php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.4 
php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.5
--- php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.4    Tue Mar 18 06:38:13 2008
+++ php-src/ext/mysql/tests/mysql_fetch_row.phpt        Mon Dec  1 21:20:27 2008
@@ -15,8 +15,8 @@
 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)) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to