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

Queries with a clause involving tokens and Long.MIN_VALUE include rows incorrectly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Legacy/CQL
    • Labels:
      None
    • Severity:
      Normal

      Description

      [cqlsh 5.0.1 | Cassandra 2.2.9 | CQL spec 3.3.1 | Native protocol v4]

      When running a CQL query where we filter on a token compared to -9223372036854775808 (the minimum value for a long), the filter appears to have no effect.

      For example:

      SELECT token(user_id) FROM events WHERE token(user_id) = -9223372036854775808 LIMIT 3;
      system.token(user_id)
       -----------------------
        -9223371814601747988
        -9223371814601747988
        -9223371814601747988
      

      It doesn't matter whether `=`, `<`, `<=`, `>` or `>=` are used in the comparison, the results appear the same.

      In contrast, if using `Long.MIN_VALUE + 1`, it returns no results as expected:

      SELECT token(user_id) FROM events WHERE token(user_id) <= -9223372036854775807 LIMIT 3;
      system.token(user_id)
      -----------------------
      (0 rows)
      

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Dockheas23 George Boyle
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: