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

Paging is broken for IN queries

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: None
    • Component/s: Legacy/CQL
    • Labels:
      None
    • Severity:
      Normal
    • Since Version:

      Description

      If the number of selected row is greater than the page size, C* will return some duplicates.

      The problem can be reproduced with the java driver using the following code:

             session = cluster.connect();
             session.execute("CREATE KEYSPACE IF NOT EXISTS test WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : '1'}");
             session.execute("USE test");
             session.execute("DROP TABLE IF EXISTS test");
             session.execute("CREATE TABLE test (rc int, pk int, PRIMARY KEY (pk))");
      
             for (int i = 0; i < 5; i++)
                 session.execute("INSERT INTO test (pk, rc) VALUES (?, ?);", i, i);
      
             ResultSet rs = session.execute(session.newSimpleStatement("SELECT * FROM test WHERE  pk IN (1, 2, 3)").setFetchSize(2));
      

        Attachments

        1. 11208-3.0.txt
          2 kB
          Benjamin Lerer

          Issue Links

            Activity

              People

              • Assignee:
                blerer Benjamin Lerer
                Reporter:
                blerer Benjamin Lerer
                Authors:
                Benjamin Lerer
                Reviewers:
                Sylvain Lebresne
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: