johannes                Mon Dec  1 21:20:47 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /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:
  MFH: Fix mysql_fetch_* and tests after param parsing changes
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.16.2.32&r2=1.213.2.6.2.16.2.33&diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.16.2.32 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.16.2.33
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.16.2.32   Fri Nov 28 20:23:49 2008
+++ php-src/ext/mysql/php_mysql.c       Mon Dec  1 21:20:47 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.16.2.32 2008/11/28 20:23:49 johannes Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.16.2.33 2008/12/01 21:20:47 johannes Exp $ */
 
 /* TODO:
  *
@@ -1963,8 +1963,6 @@
        } else
 #endif
        {
-               result_type = MYSQL_BOTH;
-
                if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", 
&res, &result_type) == FAILURE) {
                        return;
                }
@@ -2109,7 +2107,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);
@@ -2146,7 +2144,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);
@@ -2167,7 +2165,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.3.2.3&r2=1.3.2.4&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.3.2.3 
php-src/ext/mysql/tests/mysql_fetch_array.phpt:1.3.2.4
--- php-src/ext/mysql/tests/mysql_fetch_array.phpt:1.3.2.3      Thu Apr 24 
14:22:19 2008
+++ php-src/ext/mysql/tests/mysql_fetch_array.phpt      Mon Dec  1 21:20:47 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.3.2.2&r2=1.3.2.3&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.3.2.2 
php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.3.2.3
--- php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.3.2.2      Wed Oct 10 
09:51:45 2007
+++ php-src/ext/mysql/tests/mysql_fetch_assoc.phpt      Mon Dec  1 21:20:47 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.3.2.3&r2=1.3.2.4&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.3.2.3 
php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.3.2.4
--- php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.3.2.3        Mon Mar 17 
17:19:48 2008
+++ php-src/ext/mysql/tests/mysql_fetch_row.phpt        Mon Dec  1 21:20:47 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