File php-5.1.2-mysqli-64bit.patch of Package php
--- ext/mysqli/mysqli_api.c 2006/03/11 11:16:03 1.118.2.17
+++ ext/mysqli/mysqli_api.c 2006/03/14 15:53:16 1.118.2.18
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $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));