Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3595

Perl Bindings: Set serialization/deserialization differs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • 0.9.1, 0.9.2, 0.9.3
    • None
    • Perl - Compiler
    • None
    • Patch Available

    Description

      In the Perl bindings, a Thrift Set is dezerialized as a hashref, but the serialization code expects an arrayref. This causes the code to die when called if attempting to serialize a previously dezerialized Set.

      Additionally, it looks like there is a typo in the test that is testing this feature:

      https://github.com/apache/thrift/blob/49f4dc0cd8c87213a0f80ae1daba2d094a358ea7/test/perl/TestClient.pl#L262

      If you change that @$setout to @$setin, the test fails.

      It doesn't make much sense to implement a Set in Perl as array, because arrays allow duplicate entries and are ordered.

      I've written a change for the serialization that correctly expects a hashref: https://github.com/apache/thrift/pull/831

      Attachments

        Issue Links

          Activity

            People

              jking3 James E. King III
              amillerchip Adam Millerchip
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: