Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1470

Perl API boolean type misencoded

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.7
    • Component/s: perl
    • Labels:
      None
    • Release Note:
      Hide
      Perl API: Fix encoding of boolean type
      Perl API: Fix boolean compatibility test in unions
      Show
      Perl API: Fix encoding of boolean type Perl API: Fix boolean compatibility test in unions

      Description

      The boolean serialization is incorrect, as these new unit tests would indicate:

      primitive_ok boolean => 0, "\x0";
      primitive_ok boolean => 1, "\x1";
      

      When run they print:

      #   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'
      

      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.

        Attachments

        1. AVRO-1470.patch
          6 kB
          John Karp
        2. AVRO-1470.patch
          2 kB
          John Karp

          Issue Links

            Activity

              People

              • Assignee:
                jkarp John Karp
                Reporter:
                jkarp John Karp
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: