Avro
  1. Avro
  2. AVRO-675

Bytes and fixed setters don't update datum size

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.5.0
    • Component/s: c
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The setter methods for bytes and fixed datum instances don't update the size field. So, for instance, if you create a datum:

      avro_datum_t datum = avro_wrapbytes(NULL, 0);

      Then later you update that datum to point to a different buffer:

      avro_wrapbytes_set(datum, "hello", 5);

      If you write that datum out to a file, you'll get a zero-length value in the output, since the size pointer didn't get updated from 0 to 5.

      1. avro-675.patch
        3 kB
        Douglas Creager

        Activity

        Hide
        Douglas Creager added a comment -

        Here's a patch that fixes this, including test cases. Also visible on my github mirror:

        http://github.com/dcreager/avro/tree/avro-675

        Show
        Douglas Creager added a comment - Here's a patch that fixes this, including test cases. Also visible on my github mirror: http://github.com/dcreager/avro/tree/avro-675
        Hide
        Doug Cutting added a comment -

        Matt/Bruce: can one of you please review this? Thanks!

        Show
        Doug Cutting added a comment - Matt/Bruce: can one of you please review this? Thanks!
        Hide
        Matt Massie added a comment -

        Commit to trunk. Thanks for the patch!

        Show
        Matt Massie added a comment - Commit to trunk. Thanks for the patch!
        Hide
        Doug Cutting added a comment -

        FYI, this unfortunately did not make it into 1.4.0, since no one ever marked its "fix version" as 1.4.0 or merged it to that branch. I'll mark it for 1.5.0 now, but if we decide to make a 1.4.2 release we should include this there.

        Committers should always set the "fix-version" when they resolve an issue after committing a patch. If the fix version is anything but the next major version that will be branched from trunk then they also need to merge the change to the intended release branch.

        Show
        Doug Cutting added a comment - FYI, this unfortunately did not make it into 1.4.0, since no one ever marked its "fix version" as 1.4.0 or merged it to that branch. I'll mark it for 1.5.0 now, but if we decide to make a 1.4.2 release we should include this there. Committers should always set the "fix-version" when they resolve an issue after committing a patch. If the fix version is anything but the next major version that will be branched from trunk then they also need to merge the change to the intended release branch.
        Hide
        Doug Cutting added a comment -

        Oops. Actually set fix-version to 1.5.0!

        Show
        Doug Cutting added a comment - Oops. Actually set fix-version to 1.5.0!

          People

          • Assignee:
            Douglas Creager
            Reporter:
            Douglas Creager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.25h
              0.25h
              Remaining:
              Remaining Estimate - 0.25h
              0.25h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development