andrey          Tue Apr 19 08:59:16 2005 EDT

  Modified files:              
    /php-src/ext/mysqli mysqli_api.c 
    /php-src/ext/mysqli/tests   014.phpt 
  Log:
  - fixing all "long" into "int" fetching problems (cause memory corruption
    on 64 bit)
  - nail down a problem because of the new MYSQL_TYPE_NEWDECIMAL introduced
    in MySQL 5.0+
  - Add more info to the autocommit test
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.102&r2=1.103&ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.102 
php-src/ext/mysqli/mysqli_api.c:1.103
--- php-src/ext/mysqli/mysqli_api.c:1.102       Thu Mar 17 13:12:06 2005
+++ php-src/ext/mysqli/mysqli_api.c     Tue Apr 19 08:59:15 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_api.c,v 1.102 2005/03/17 18:12:06 tony2001 Exp $ 
+  $Id: mysqli_api.c,v 1.103 2005/04/19 12:59:15 andrey Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -310,6 +310,9 @@
                        case MYSQL_TYPE_BLOB:
                        case MYSQL_TYPE_TIMESTAMP:
                        case MYSQL_TYPE_DECIMAL:
+#ifdef FIELD_TYPE_NEWDECIMAL
+                       case MYSQL_TYPE_NEWDECIMAL:
+#endif
                                stmt->result.buf[ofs].type = IS_STRING; 
                                stmt->result.buf[ofs].buflen =
                                        (stmt->stmt->fields) ? 
(stmt->stmt->fields[ofs].length) ? stmt->stmt->fields[ofs].length + 1: 256: 256;
@@ -749,7 +752,7 @@
        MYSQL_RES       *result;
        zval            *mysql_result;
        MYSQL_FIELD *field;
-       int             offset;
+       long            offset;
 
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
                return;
@@ -839,7 +842,7 @@
 {
        MYSQL_RES               *result;
        zval                    *mysql_result;
-       unsigned int    fieldnr;
+       unsigned long   fieldnr;
 
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"Ol", &mysql_result, mysqli_result_class_entry, &fieldnr) == FAILURE) {
                return;
@@ -1029,7 +1032,7 @@
 {
        MY_MYSQL        *mysql;
        zval            *mysql_link;
-       int             processid;
+       long            processid;
 
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"Ol", &mysql_link, mysqli_link_class_entry, &processid) == FAILURE) {
                return;
@@ -1097,7 +1100,8 @@
 
 /* {{{ proto bool mysqli_more_results(object link)
    check if there any more query results from a multi query */
-PHP_FUNCTION(mysqli_more_results) {
+PHP_FUNCTION(mysqli_more_results)
+{
        MY_MYSQL                *mysql;
        zval                    *mysql_link;
 
@@ -1277,7 +1281,7 @@
        MY_MYSQL                *mysql;
        char                    *hostname = NULL, *username=NULL, *passwd=NULL, 
*dbname=NULL, *socket=NULL;
        unsigned int    hostname_len, username_len, passwd_len, dbname_len, 
socket_len;
-       unsigned int    port=0, flags=0;
+       unsigned long   port=0, flags=0;
        zval                    *mysql_link;
        zval                    *object = getThis();
 
@@ -1414,7 +1418,8 @@
        MY_STMT *stmt;
        zval    *mysql_stmt;
        char    *data;
-       long    param_nr, data_len;
+       long    param_nr;
+       int             data_len;
 
 
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"Ols", &mysql_stmt, mysqli_stmt_class_entry, &param_nr, &data, &data_len) == 
FAILURE) {
@@ -1693,7 +1698,7 @@
 {
        MY_STMT *stmt;
        zval    *mysql_stmt;
-       ulong   mode;
+       zend_bool mode;
        ulong   attr;
        int             rc;
 
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/014.phpt?r1=1.7&r2=1.8&ty=u
Index: php-src/ext/mysqli/tests/014.phpt
diff -u php-src/ext/mysqli/tests/014.phpt:1.7 
php-src/ext/mysqli/tests/014.phpt:1.8
--- php-src/ext/mysqli/tests/014.phpt:1.7       Fri Jan  7 09:59:59 2005
+++ php-src/ext/mysqli/tests/014.phpt   Tue Apr 19 08:59:16 2005
@@ -36,6 +36,7 @@
        mysqli_rollback($link);
 
        $result = mysqli_query($link, "SELECT * FROM ac_01");
+       printf("Num_of_rows=%d\n", mysqli_num_rows($result));
        $row = mysqli_fetch_row($result);
        mysqli_free_result($result);
 
@@ -54,6 +55,7 @@
        mysqli_close($link);
 ?>
 --EXPECT--
+Num_of_rows=1
 array(2) {
   [0]=>
   string(1) "1"

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

Reply via email to