Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9.2
-
None
-
osx 10.10.5, php 5.5.27, python 2.7.10 thrift 0.9.2 , install by brew. 64 bit machines
-
Patch Available
Description
create a thrift file like
namespace php demo namesapce py demo struct obj{ 1:required i64 int64, 2:required bool bol, } service Demo { obj trans(1:obj item), }
protocol use TCompactProtocol
server is python, client is php
client call trans func with
i64(-1)
bool(true)
and print the server response
the output is
object(demo\obj)#8 (2) { ["int64"]=> float(1.844674407371E+19) ["bol"]=> bool(false) }
Attachments
Issue Links
- is duplicated by
-
THRIFT-1548 PHP TCompactProtocol always reads bools as false
- Resolved
-
THRIFT-5538 TCompactProtocol always decode bool fields as false
- Resolved
-
THRIFT-3767 Read error value in TCompactProtocol when reading a compact Bool value
- Closed
- links to
GitHub user zhaakhi opened a pull request:
https://github.com/apache/thrift/pull/1132
THRIFT-3348PHP TCompactProtocol bool&int64 readvalue bugTCompactProtocol always serializes boolean struct values as false, due
to a confusion between the internal compact type field representation
and the normal Thrift types.
There is also a slight mishandling of i64 values where -2^63 will
overflow and be converted to a float, even though it is representable as
a 64-bit int.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zhaakhi/thrift
THRIFT-3348Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1132.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1132
commit f6a0fb0480aa3fc2d6b69dd676b219cdf7b3e9a0
Author: Håkon Hitland <hakon.hitland@zedge.net>
Date: 2016-11-17T15:59:30Z
THRIFT-3348PHP TCompactProtocol bool&int64 readvalue bugTCompactProtocol always serializes boolean struct values as false, due
to a confusion between the internal compact type field representation
and the normal Thrift types.
There is also a slight mishandling of i64 values where -2^63 will
overflow and be converted to a float, even though it is representable as
a 64-bit int.