Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18530

Document that DecimalType violates property serialize(deserialize(bb)) != bb when used as a clustering column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • 5.x
    • CQL/Semantics
    • None
    • Correctness - Unrecoverable Corruption / Loss
    • Critical
    • Normal
    • Fuzz Test
    • All
    • None

    Description

      Found by CASSANDRA-18504

      When converting the BB to comparable bytes, converting back returns a different set of bytes for OSS42

      java.lang.AssertionError: Property falsified after 18 example(s) 
      Smallest found falsifying value(s) :-
      Type:
      decimal
      Values: [-9.05674E-92]
      Cause was :-
      org.junit.ComparisonFailure: [fromComparableBytes(asComparableBytes(bb)) != bb; version OSS42] expected:<"0000006[1f22e36]"> but was:<"0000006[2ff75ce1c]">
      

      EDIT:

      After more testing and talking with blambov, this is expected behavior and been this way since at least 3.0 (didn't test further back). The new compare as bytes methods are only matching existing semantics, and the issue itself is that when we try to compare this type, we "normalize" it, which mutates the value; this normalization is not well documented and should be more explicit to users

      Attachments

        Activity

          People

            Unassigned Unassigned
            dcapwell David Capwell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: