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

Select on composite partition keys are not validated correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 1.2.1
    • None
    • None
    • Low

    Description

      From Kais Ahmed on the mailing list:

      ----------------------------------------------------------------------------------------------------------------------
      [cqlsh 2.3.0 | Cassandra 1.2.0-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol
      19.35.0]
      
      cqlsh:test> CREATE TABLE foo (   a int,   b text,   c uuid,   PRIMARY KEY
      ((a, b)) );
      
      cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'aze',
      '4d481800-4c5f-11e1-82e0-3f484de45426');
      cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'ert',
      '693f5800-8acb-11e3-82e0-3f484de45426');
      cqlsh:test> INSERT INTO foo (a, b , c ) VALUES (  1 , 'opl',
      'd4815800-2d8d-11e0-82e0-3f484de45426');
      
      -----------------------------------------------------------------------------------------------------------------------------------------------------
      
      cqlsh:test> SELECT * FROM foo;
      
       a | b   | c
      ---+-----+--------------------------------------
       1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
       1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426
       1 | aze | 4d481800-4c5f-11e1-82e0-3f484de45426
      
      -----------------------------------------------------------------------------------------------------------------------------------------------------
      
      cqlsh:test> SELECT * FROM foo where a=1;
      
       a | b   | c
      ---+-----+--------------------------------------
       1 | ert | 693f5800-8acb-11e3-82e0-3f484de45426
       1 | opl | d4815800-2d8d-11e0-82e0-3f484de45426
      

      The last request should be invalid (since we don't have a good way to do it, at least not with a random partitioner).

      Attachments

        1. 5122.txt
          4 kB
          Sylvain Lebresne

        Activity

          People

            slebresne Sylvain Lebresne
            slebresne Sylvain Lebresne
            Sylvain Lebresne
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: