You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "T Jake Luciani (JIRA)" <ji...@apache.org> on 2012/10/03 23:27:09 UTC

[jira] [Commented] (CASSANDRA-4759) CQL3 Predicate logic bug when using composite columns

    [ https://issues.apache.org/jira/browse/CASSANDRA-4759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13468848#comment-13468848 ] 

T Jake Luciani commented on CASSANDRA-4759:
-------------------------------------------

Also the first query in the second example is wrong, it should return nothing.
                
> CQL3 Predicate logic bug when using composite columns
> -----------------------------------------------------
>
>                 Key: CASSANDRA-4759
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4759
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: T Jake Luciani
>
> Looks like a predicate logic bug that only happens when you have > 2 primary keys and use COMPACT STORAGE (meaning its using composite columns under the hood)
> First I'll show it works with just 2 
> {code}
> cqlsh:dev> CREATE TABLE testrev (
>        ...          key text,
>        ...          rdate timestamp,
>        ...          num double,
>        ...          PRIMARY KEY(key,rdate)
>        ...          ) WITH COMPACT STORAGE
>        ...            AND CLUSTERING ORDER BY(rdate DESC);
> cqlsh:dev> INSERT INTO testrev(key,rdate,num) VALUES ('foo','2012-01-01',10.5);
> cqlsh:dev> select * from testrev where key='foo' and rdate > '2012-01-01';
> cqlsh:dev> select * from testrev where key='foo' and rdate >= '2012-01-01';
>  key | rdate                    | num
> -----+--------------------------+------
>  foo | 2012-01-01 00:00:00-0500 | 10.5
> {code}
> Now we create with 3 parts to the PRIMARY KEY
> {code}
> cqlsh:dev> drop TABLE testrev ;
> cqlsh:dev> CREATE TABLE testrev (
>        ...          key text,
>        ...          rdate timestamp,
>        ...          rdate2 timestamp,
>        ...          num double,
>        ...          PRIMARY KEY(key,rdate,rdate2)
>        ...          ) WITH COMPACT STORAGE
>        ...          AND CLUSTERING ORDER BY(rdate DESC);
> cqlsh:dev> INSERT INTO testrev(key,rdate,rdate2,num) VALUES ('foo','2012-01-01','2012-01-01',10.5);
> cqlsh:dev> select * from testrev where key='foo' and rdate > '2012-01-01';
>  key | rdate                    | rdate2                   | num
> -----+--------------------------+--------------------------+------
>  foo | 2012-01-01 00:00:00-0500 | 2012-01-01 00:00:00-0500 | 10.5
> cqlsh:dev> select * from testrev where key='foo' and rdate >= '2012-01-01';
> {code}
> The last query should return the row...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira