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

Perl API boolean type misencoded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.7
    • perl
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: