Avro
  1. Avro
  2. AVRO-1053

PHP long is treated inconsistently between decoding and encoding when using gmp

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.3
    • Fix Version/s: None
    • Component/s: php
    • Labels:
      None
    • Environment:

      32-bit apache using gmp

      Description

      A record containing a long value decoded by avro using gmp cannot be re-encoded. It fails validation because read_long returns a string value when using gmp and on encode is_valid_datum() for long requires an int value.

      1. patch.txt
        1 kB
        Eric
      2. AVRO-1053.patch
        2 kB
        Doug Cutting

        Activity

        Hide
        Doug Cutting added a comment -

        Here's a version of the patch that memoizes the max and min values, as is done in other cases with gmp constants.

        This works for me and existing tests pass.

        Eric, can you add a test that fails without this change?

        Show
        Doug Cutting added a comment - Here's a version of the patch that memoizes the max and min values, as is done in other cases with gmp constants. This works for me and existing tests pass. Eric, can you add a test that fails without this change?

          People

          • Assignee:
            Unassigned
            Reporter:
            Eric
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development