com php-src: fix mysqlnd for bigint: ext/mysqlnd/mysqlnd_ps _codec.c ext/mysqlnd/mysqlnd_wireprotocol.c
| From: | Anatol Belski | Date: | Sat, 30 Nov 2013 20:49:41 +0000 |
| Subject: | com php-src: fix mysqlnd for bigint: ext/mysqlnd/mysqlnd_ps _codec.c ext/mysqlnd/mysqlnd_wireprotocol.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74182@lists.php.net to get a copy of this message | ||
Commit: d76d415f555dfea436c0cec72f3cdf3f01be691e
Author: Anatol Belski <ab@php.net> Sat, 30 Nov 2013 21:49:41 +0100
Parents: f3703d86f74da1904011d9e5f99632ba0dceeb46
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d76d415f555dfea436c0cec72f3cdf3f01be691e
Log:
fix mysqlnd for bigint
Changed paths:
M ext/mysqlnd/mysqlnd_ps_codec.c
M ext/mysqlnd/mysqlnd_wireprotocol.c
Diff:
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c
index f267e72..74c0331 100644
--- a/ext/mysqlnd/mysqlnd_ps_codec.c
+++ b/ext/mysqlnd/mysqlnd_ps_codec.c
@@ -84,7 +84,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigne
#endif /* #if SIZEOF_LONG==4 */
{
if (byte_count < 8 || uval <= L64(9223372036854775807)) {
- ZVAL_LONG(zv, (long) uval); /* the cast is safe, we are in the range */
+ ZVAL_LONG(zv, (php_int_t) uval); /* the cast is safe, we are in the range */
} else {
DBG_INF("stringify");
tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
@@ -112,7 +112,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigne
} else
#endif /* SIZEOF */
{
- ZVAL_LONG(zv, (long) lval); /* the cast is safe, we are in the range */
+ ZVAL_LONG(zv, (php_int_t) lval); /* the cast is safe, we are in the range */
}
}
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 4bc68d6..ebfd03b 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1679,7 +1679,7 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
zval
#else
_atoi64((char *) p);
#endif
- ZVAL_LONG(*current_field, (long) v); /* the cast is safe */
+ ZVAL_LONG(*current_field, (php_int_t) v); /* the cast is safe */
} else {
uint64_t v =
#ifndef PHP_WIN32
@@ -1701,7 +1701,7 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
zval
{
ZVAL_STRINGL(*current_field, (char *)p, len, 0);
} else {
- ZVAL_LONG(*current_field, (long) v); /* the cast is safe */
+ ZVAL_LONG(*current_field, (php_int_t) v); /* the cast is safe */
}
}
*(p + len) = save;
@@ -1731,7 +1731,7 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
zval
*/
p -= len;
if (Z_TYPE_PP(current_field) == IS_LONG) {
- bit_area += 1 + sprintf((char *)start, "%ld", Z_LVAL_PP(current_field));
+ bit_area += 1 + sprintf((char *)start, ZEND_INT_FMT, Z_LVAL_PP(current_field));
ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, 0);
} else if (Z_TYPE_PP(current_field) == IS_STRING){
memcpy(bit_area, Z_STRVAL_PP(current_field), Z_STRSIZE_PP(current_field));