georg           Wed Apr  5 12:17:08 2006 UTC

  Modified files:              (Branch: PHP_5_1)
    /php-src/ext/mysqli mysqli_api.c mysqli_prop.c php_mysqli.h 
  Log:
  fixed bigint conversion on windows platforms
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.21&r2=1.118.2.22&diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.21 
php-src/ext/mysqli/mysqli_api.c:1.118.2.22
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.21  Sun Mar 26 21:10:13 2006
+++ php-src/ext/mysqli/mysqli_api.c     Wed Apr  5 12:17:08 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_api.c,v 1.118.2.21 2006/03/26 21:10:13 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.22 2006/04/05 12:17:08 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -705,10 +705,10 @@
 #endif
                                                                char tmp[22];
                                                                /* even though 
lval is declared as unsigned, the value
-                                                                * may be 
negative. Therefor we cannot use %llu and must
-                                                                * use %lld.
+                                                                * may be 
negative. Therefor we cannot use MYSQLI_LLU_SPEC and must
+                                                                * use 
MYSQLI_LL_SPEC.
                                                                 */
-                                                               sprintf((char 
*)&tmp, (stmt->stmt->fields[i].flags & UNSIGNED_FLAG)? "%llu":"%lld", llval);
+                                                               sprintf((char 
*)&tmp, (stmt->stmt->fields[i].flags & UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : 
MYSQLI_LL_SPEC, llval);
                                                                
ZVAL_STRING(stmt->result.vars[i], tmp, 1);
                                                        } else {
                                                                
ZVAL_LONG(stmt->result.vars[i], llval);
@@ -1859,7 +1859,7 @@
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
                return;
        }
-       MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", 
MYSQLI_STATUS_VALID);
+       MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", 
MYSQLI_STATUS_INITIALIZED);
 
        RETURN_LONG(mysql_stmt_errno(stmt->stmt));
 }
@@ -1875,7 +1875,7 @@
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
                return;
        }
-       MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", 
MYSQLI_STATUS_VALID);
+       MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", 
MYSQLI_STATUS_INITIALIZED);
        
        RETURN_STRING((char *)mysql_stmt_error(stmt->stmt),1);
 }
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_prop.c?r1=1.23.2.4&r2=1.23.2.5&diff_format=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.23.2.4 
php-src/ext/mysqli/mysqli_prop.c:1.23.2.5
--- php-src/ext/mysqli/mysqli_prop.c:1.23.2.4   Mon Apr  3 05:48:50 2006
+++ php-src/ext/mysqli/mysqli_prop.c    Wed Apr  5 12:17:08 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_prop.c,v 1.23.2.4 2006/04/03 05:48:50 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.23.2.5 2006/04/05 12:17:08 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -86,7 +86,7 @@
                        ZVAL_LONG(*retval, l);\
                } else { \
                        char ret[40]; \
-                       sprintf(ret, "%llu", (my_ulonglong)l); \
+                       sprintf(ret, MYSQLI_LLU_SPEC, (my_ulonglong)l); \
                        ZVAL_STRING(*retval, ret, 1); \
                } \
        }\
@@ -176,7 +176,7 @@
                        ZVAL_LONG(*retval, rc);
                } else {
                        char ret[40];
-                       sprintf(ret, "%llu", (my_ulonglong) rc);
+                       sprintf(ret, MYSQLI_LLU_SPEC, (my_ulonglong) rc);
                        ZVAL_STRING(*retval, ret, 1);
                }
        }
@@ -295,7 +295,7 @@
                        ZVAL_LONG(*retval, rc);
                } else {
                        char ret[40];
-                       sprintf(ret, "%llu", (my_ulonglong) rc);
+                       sprintf(ret, MYSQLI_LLU_SPEC, (my_ulonglong) rc);
                        ZVAL_STRING(*retval, ret, 1);
                }
        }
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/php_mysqli.h?r1=1.54.2.6&r2=1.54.2.7&diff_format=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.54.2.6 
php-src/ext/mysqli/php_mysqli.h:1.54.2.7
--- php-src/ext/mysqli/php_mysqli.h:1.54.2.6    Fri Mar 24 09:32:24 2006
+++ php-src/ext/mysqli/php_mysqli.h     Wed Apr  5 12:17:08 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: php_mysqli.h,v 1.54.2.6 2006/03/24 09:32:24 georg Exp $ 
+  $Id: php_mysqli.h,v 1.54.2.7 2006/04/05 12:17:08 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -118,8 +118,12 @@
 
 #ifdef PHP_WIN32
 #define PHP_MYSQLI_API __declspec(dllexport)
+#define MYSQLI_LLU_SPEC "%I64u"
+#define MYSQLI_LL_SPEC "%I64d"
 #else
 #define PHP_MYSQLI_API
+#define MYSQLI_LLU_SPEC "%llu"
+#define MYSQLI_LL_SPEC "%lld"
 #endif
 
 #ifdef ZTS

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

Reply via email to