Description
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
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
Now we create with 3 parts to the PRIMARY KEY
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';
The last query should return the row...