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

(CQL3) Missing validation for IN queries on column not part of the PK

    XMLWordPrintableJSON

Details

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

    Description

      Copy-pasting from the original mail (http://mail-archives.apache.org/mod_mbox/cassandra-user/201209.mbox/%3C20120922185826.GO6205@pslp2%3E):

      [cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 3.0.0 | Thrift protocol 19.32.0]
      Use HELP for help.
      cqlsh> 
      cqlsh> create keyspace xpl1 WITH strategy_class ='SimpleStrategy' and strategy_options:replication_factor=1;
      cqlsh> use xpl1;
      cqlsh:xpl1> create table t1 (pk varchar primary key, col1 varchar, col2 varchar);
      cqlsh:xpl1> create index t1_c1 on t1(col1);
      cqlsh:xpl1> create index t1_c2 on t1(col2);
      cqlsh:xpl1> insert into t1  (pk, col1, col2) values ('pk1','foo1','bar1');
      cqlsh:xpl1> insert into t1  (pk, col1, col2) values ('pk1a','foo1','bar1');
      cqlsh:xpl1> insert into t1  (pk, col1, col2) values ('pk1b','foo1','bar1');
      cqlsh:xpl1> insert into t1  (pk, col1, col2) values ('pk1c','foo1','bar1');
      cqlsh:xpl1> insert into t1  (pk, col1, col2) values ('pk2','foo2','bar2');
      cqlsh:xpl1> insert into t1  (pk, col1, col2) values ('pk3','foo3','bar3');
      cqlsh:xpl1> select * from t1 where col2='bar1';
       pk   | col1 | col2
      ------+------+------
       pk1b | foo1 | bar1
        pk1 | foo1 | bar1
       pk1a | foo1 | bar1
       pk1c | foo1 | bar1
      
      cqlsh:xpl1> select * from t1 where col2 in ('bar1', 'bar2') ;
      cqlsh:xpl1> 
      

      We should either make that last query work or refuse the query but returning nothing is wrong.

      Attachments

        1. 4709.txt
          2 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: