georg Tue Mar 14 15:53:17 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src/ext/mysqli mysqli_api.c
Log:
fixed a 64-bit problem reported by Pierre
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.17&r2=1.118.2.18&diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.17
php-src/ext/mysqli/mysqli_api.c:1.118.2.18
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.17 Sat Mar 11 11:16:03 2006
+++ php-src/ext/mysqli/mysqli_api.c Tue Mar 14 15:53:16 2006
@@ -15,7 +15,7 @@
| Author: Georg Richter <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: mysqli_api.c,v 1.118.2.17 2006/03/11 11:16:03 georg Exp $
+ $Id: mysqli_api.c,v 1.118.2.18 2006/03/14 15:53:16 georg Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -295,7 +295,7 @@
convert_to_long_ex(args[i]);
stmt->result.buf[ofs].type = IS_LONG;
stmt->result.buf[ofs].buflen = 0;
- stmt->result.buf[ofs].val = (char
*)emalloc(sizeof(long));
+ stmt->result.buf[ofs].val = (char
*)emalloc(sizeof(int));
bind[ofs].buffer_type = MYSQL_TYPE_LONG;
bind[ofs].buffer = stmt->result.buf[ofs].val;
bind[ofs].is_null = &stmt->result.is_null[ofs];
@@ -663,7 +663,7 @@
if (!stmt->result.is_null[i]) {
switch (stmt->result.buf[i].type) {
case IS_LONG:
- if ((sizeof(long) ==4) &&
(stmt->stmt->fields[i].type == MYSQL_TYPE_LONG)
+ if ((stmt->stmt->fields[i].type
== MYSQL_TYPE_LONG)
&&
(stmt->stmt->fields[i].flags & UNSIGNED_FLAG))
{
/* unsigned int (11) */
@@ -684,7 +684,11 @@
break;
}
}
- ZVAL_LONG(stmt->result.vars[i],
*(int *)stmt->result.buf[i].val);
+ if (stmt->stmt->fields[i].flags
& UNSIGNED_FLAG) {
+
ZVAL_LONG(stmt->result.vars[i], *(unsigned int *)stmt->result.buf[i].val);
+ } else {
+
ZVAL_LONG(stmt->result.vars[i], *(int *)stmt->result.buf[i].val);
+ };
break;
case IS_DOUBLE:
memcpy(&dval,
stmt->result.buf[i].val, sizeof(dval));
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php