iliaa Fri Aug 4 22:14:10 2006 UTC
Modified files:
/php-src/ext/mysqli mysqli_api.c
Log:
MFB: Improved fix for bug #37671
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.129&r2=1.130&diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.129
php-src/ext/mysqli/mysqli_api.c:1.130
--- php-src/ext/mysqli/mysqli_api.c:1.129 Wed Jul 12 10:15:30 2006
+++ php-src/ext/mysqli/mysqli_api.c Fri Aug 4 22:14:10 2006
@@ -15,7 +15,7 @@
| Author: Georg Richter <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: mysqli_api.c,v 1.129 2006/07/12 10:15:30 tony2001 Exp $
+ $Id: mysqli_api.c,v 1.130 2006/08/04 22:14:10 iliaa Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -294,9 +294,6 @@
case MYSQL_TYPE_LONG:
case MYSQL_TYPE_INT24:
case MYSQL_TYPE_YEAR:
-#if MYSQL_VERSION_ID > 50002
- case MYSQL_TYPE_BIT:
-#endif
convert_to_long_ex(args[i]);
stmt->result.buf[ofs].type = IS_LONG;
/* don't set stmt->result.buf[ofs].buflen to 0,
we used ecalloc */
@@ -308,10 +305,13 @@
break;
case MYSQL_TYPE_LONGLONG:
+#if MYSQL_VERSION_ID > 50002
+ case MYSQL_TYPE_BIT:
+#endif
stmt->result.buf[ofs].type = IS_STRING;
stmt->result.buf[ofs].buflen =
sizeof(my_ulonglong);
stmt->result.buf[ofs].val = (char
*)emalloc(stmt->result.buf[ofs].buflen);
- bind[ofs].buffer_type = MYSQL_TYPE_LONGLONG;
+ bind[ofs].buffer_type = col_type;
bind[ofs].buffer = stmt->result.buf[ofs].val;
bind[ofs].is_null = &stmt->result.is_null[ofs];
bind[ofs].buffer_length =
stmt->result.buf[ofs].buflen;
@@ -715,7 +715,14 @@
} else {
ZVAL_LONG(stmt->result.vars[i], llval);
}
- } else {
+ }
+#if MYSQL_VERSION_ID > 50002
+ else if
(stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_BIT) {
+ llval = *(my_ulonglong
*)stmt->result.buf[i].val;
+
ZVAL_LONG(stmt->result.vars[i], llval);
+ }
+#endif
+ else {
ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val,
stmt->result.buf[i].buflen, 1);
}
break;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php