summaryrefslogtreecommitdiffstats
path: root/pq-upstream.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-10-18 15:22:36 +0200
committerRemi Collet <fedora@famillecollet.com>2014-10-18 15:22:36 +0200
commitb8c995f41dd2a4f07e923148206031e3583cc495 (patch)
tree70110d649015a8f6e9cae0c429db1d80e4c74d7e /pq-upstream.patch
parent74d3b9ccc13ab5f6666e63f9a50fd4cac2817be0 (diff)
php-pecl-pq: upstream patch for 32bits
Diffstat (limited to 'pq-upstream.patch')
-rw-r--r--pq-upstream.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/pq-upstream.patch b/pq-upstream.patch
index 03b2436..bdcc63a 100644
--- a/pq-upstream.patch
+++ b/pq-upstream.patch
@@ -122,3 +122,54 @@ index ae8774d..9dda107 100644
--
1.8.3.1
+From 5a5758352bbc42cbe57f32859de831de2ea08a86 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Sat, 18 Oct 2014 15:15:08 +0200
+Subject: [PATCH] allow INT8 / TID on 32 bits
+
+---
+ src/php_pqres.c | 19 ++++++++++++++++---
+ 1 file changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/src/php_pqres.c b/src/php_pqres.c
+index 9dda107..75a6081 100644
+--- a/src/php_pqres.c
++++ b/src/php_pqres.c
+@@ -126,10 +126,9 @@ zval *php_pqres_typed_zval(php_pqres_t *res, char *val, size_t len, Oid typ TSRM
+ }
+ ZVAL_BOOL(zv, *val == 't');
+ break;
+-#if SIZEOF_LONG >= 8
++
+ case PHP_PQ_OID_INT8:
+ case PHP_PQ_OID_TID:
+-#endif
+ case PHP_PQ_OID_INT4:
+ case PHP_PQ_OID_INT2:
+ case PHP_PQ_OID_XID:
+@@ -137,7 +136,21 @@ zval *php_pqres_typed_zval(php_pqres_t *res, char *val, size_t len, Oid typ TSRM
+ if (!(res->auto_convert & PHP_PQRES_CONV_INT)) {
+ goto noconversion;
+ }
+- ZVAL_LONG(zv, zend_atol(val, len));
++ {
++ long lval;
++ double dval;
++
++ switch (is_numeric_string(val, len, &lval, &dval, 0)) {
++ case IS_LONG:
++ ZVAL_LONG(zv, lval);
++ break;
++ case IS_DOUBLE:
++ ZVAL_DOUBLE(zv, dval);
++ break;
++ default:
++ goto noconversion;
++ }
++ }
+ break;
+
+ case PHP_PQ_OID_FLOAT4:
+--
+2.1.0
+