avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Karp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1470) Perl API boolean type misencoded
Date Tue, 10 Jun 2014 19:53:02 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14026902#comment-14026902
] 

John Karp commented on AVRO-1470:
---------------------------------

Both are issues are closely related, but its possible to address one without addressing the
other.

I imagine AVRO-1470 will get applied to trunk relatively quickly because its a straightforward
backwards compatible bugfix, whereas technically AVRO-1521 should wait for 1.8.0 because its
more of a design change. So likely AVRO-1470 will already be a part of the trunk that the
AVRO-1521 patch will get written against.

> Perl API boolean type misencoded
> --------------------------------
>
>                 Key: AVRO-1470
>                 URL: https://issues.apache.org/jira/browse/AVRO-1470
>             Project: Avro
>          Issue Type: Bug
>          Components: perl
>            Reporter: John Karp
>            Assignee: John Karp
>             Fix For: 1.7.7
>
>         Attachments: AVRO-1470.patch, AVRO-1470.patch
>
>
> The boolean serialization is incorrect, as these new unit tests would indicate:
> {noformat}
> primitive_ok boolean => 0, "\x0";
> primitive_ok boolean => 1, "\x1";
> {noformat}
> When run they print:
> {noformat}
> #   Failed test 'primitive boolean encoded correctly'
> #   at t/02_bin_encode.t line 40.
> #          got: '30'
> #     expected: '00'
> #   Failed test 'primitive boolean encoded correctly'
> #   at t/02_bin_encode.t line 40.
> #          got: '31'
> #     expected: '01'
> {noformat}
> Secondly, when evaluating whether a 'boolean' branch should be taken in a union, the
check for boolean-ness of the data is being done incorrectly, matching a regular expression
against the wrong variable.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message