You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/11/17 18:52:59 UTC
[jira] [Commented] (THRIFT-3348) PHP TCompactProtocol bool&int64
readvalue bug
[ https://issues.apache.org/jira/browse/THRIFT-3348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15674508#comment-15674508 ]
ASF GitHub Bot commented on THRIFT-3348:
----------------------------------------
GitHub user zhaakhi opened a pull request:
https://github.com/apache/thrift/pull/1132
THRIFT-3348 PHP TCompactProtocol bool&int64 readvalue bug
TCompactProtocol 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-3348
Alternatively 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 <ha...@zedge.net>
Date: 2016-11-17T15:59:30Z
THRIFT-3348 PHP TCompactProtocol bool&int64 readvalue bug
TCompactProtocol 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.
----
> PHP TCompactProtocol bool&int64 readvalue bug
> ---------------------------------------------
>
> Key: THRIFT-3348
> URL: https://issues.apache.org/jira/browse/THRIFT-3348
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Library
> Affects Versions: 0.9.2
> Environment: osx 10.10.5, php 5.5.27, python 2.7.10 thrift 0.9.2 , install by brew. 64 bit machines
> Reporter: Dahao.Saerdna.Zhao
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> create a thrift file like
> {code}
> namespace php demo
> namesapce py demo
> struct obj{
> 1:required i64 int64,
> 2:required bool bol,
> }
> service Demo {
> obj trans(1:obj item),
> }
> {code}
> 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
> {code}
> object(demo\obj)#8 (2) {
> ["int64"]=>
> float(1.844674407371E+19)
> ["bol"]=>
> bool(false)
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)