cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "T Jake Luciani (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-4759) CQL3 Predicate logic bug when using composite columns
Date Wed, 03 Oct 2012 21:25:07 GMT
T Jake Luciani created CASSANDRA-4759:
-----------------------------------------

             Summary: 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

Mime
View raw message