[jira] [Updated] (CASSANDRA-7105) SELECT with IN on final column of composite and compound primary key fails

2014-05-23 Thread Tyler Hobbs (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tyler Hobbs updated CASSANDRA-7105:
---

Reviewer: Tyler Hobbs

> SELECT with IN on final column of composite and compound primary key fails
> --
>
> Key: CASSANDRA-7105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7105
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: DataStax Cassandra 2.0.7
> Windows dual-core laptop
>Reporter: Bill Mitchell
>Assignee: Sylvain Lebresne
> Fix For: 1.2.17
>
> Attachments: 7105-v2.txt, 7105.txt
>
>
> I have a failing sequence where I specify an IN constraint on the final int 
> column of the composite primary key and an IN constraint on the final String 
> column of the compound primary key and no rows are returned, when rows should 
> be returned.  
> {noformat}
> CREATE TABLE IF NOT EXISTS sr2 (siteID TEXT, partition INT, listID BIGINT, 
> emailAddr TEXT, emailCrypt TEXT, createDate TIMESTAMP, removeDate TIMESTAMP, 
> removeImportID BIGINT, properties TEXT, PRIMARY KEY ((siteID, listID, 
> partition), createDate, emailCrypt) ) WITH CLUSTERING ORDER BY (createDate 
> DESC, emailCrypt DESC)  AND compression = {'sstable_compression' : 
> 'SnappyCompressor'} AND compaction = {'class' : 
> 'SizeTieredCompactionStrategy'};
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 1, 'xyzzy', 
> '5fe7719229092cdde4526afbc65c900c', '2014-04-28T14:05:59.236-0500');
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 2, 'noname', 
> '97bf28af2ca9c498d6e47237bb8680bf', '2014-04-28T14:05:59.236-0500');
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '97bf28af2ca9c498d6e47237bb8680bf';
>  emailcrypt   | emailaddr
> --+---
>  97bf28af2ca9c498d6e47237bb8680bf |noname
> (1 rows)
> select emailCrypt, emailAddr  from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '5fe7719229092cdde4526afbc65c900c';
>  emailcrypt   | emailaddr
> --+---
>  5fe7719229092cdde4526afbc65c900c | xyzzy
> (1 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> cqlsh:test_multiple_in> select * from sr2;
>  siteid   | listid | partition | createdate   
> | emailcrypt | emailaddr| 
> properties | removedate | re
> moveimportid
> --++---+--++--+++---
> -
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 2 | 2014-04-28 
> 14:05:59Central Daylight Time | noname | 97bf28af2ca9c498d6e47237bb8680bf 
> |   null |   null |
> null
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 1 | 2014-04-28 
> 14:05:59Central Daylight Time |  xyzzy | 5fe7719229092cdde4526afbc65c900c 
> |   null |   null |
> null
> (2 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and e

[jira] [Updated] (CASSANDRA-7105) SELECT with IN on final column of composite and compound primary key fails

2014-05-23 Thread Sylvain Lebresne (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylvain Lebresne updated CASSANDRA-7105:


Fix Version/s: 1.2.17

> SELECT with IN on final column of composite and compound primary key fails
> --
>
> Key: CASSANDRA-7105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7105
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: DataStax Cassandra 2.0.7
> Windows dual-core laptop
>Reporter: Bill Mitchell
> Fix For: 1.2.17
>
> Attachments: 7105-v2.txt, 7105.txt
>
>
> I have a failing sequence where I specify an IN constraint on the final int 
> column of the composite primary key and an IN constraint on the final String 
> column of the compound primary key and no rows are returned, when rows should 
> be returned.  
> {noformat}
> CREATE TABLE IF NOT EXISTS sr2 (siteID TEXT, partition INT, listID BIGINT, 
> emailAddr TEXT, emailCrypt TEXT, createDate TIMESTAMP, removeDate TIMESTAMP, 
> removeImportID BIGINT, properties TEXT, PRIMARY KEY ((siteID, listID, 
> partition), createDate, emailCrypt) ) WITH CLUSTERING ORDER BY (createDate 
> DESC, emailCrypt DESC)  AND compression = {'sstable_compression' : 
> 'SnappyCompressor'} AND compaction = {'class' : 
> 'SizeTieredCompactionStrategy'};
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 1, 'xyzzy', 
> '5fe7719229092cdde4526afbc65c900c', '2014-04-28T14:05:59.236-0500');
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 2, 'noname', 
> '97bf28af2ca9c498d6e47237bb8680bf', '2014-04-28T14:05:59.236-0500');
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '97bf28af2ca9c498d6e47237bb8680bf';
>  emailcrypt   | emailaddr
> --+---
>  97bf28af2ca9c498d6e47237bb8680bf |noname
> (1 rows)
> select emailCrypt, emailAddr  from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '5fe7719229092cdde4526afbc65c900c';
>  emailcrypt   | emailaddr
> --+---
>  5fe7719229092cdde4526afbc65c900c | xyzzy
> (1 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> cqlsh:test_multiple_in> select * from sr2;
>  siteid   | listid | partition | createdate   
> | emailcrypt | emailaddr| 
> properties | removedate | re
> moveimportid
> --++---+--++--+++---
> -
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 2 | 2014-04-28 
> 14:05:59Central Daylight Time | noname | 97bf28af2ca9c498d6e47237bb8680bf 
> |   null |   null |
> null
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 1 | 2014-04-28 
> 14:05:59Central Daylight Time |  xyzzy | 5fe7719229092cdde4526afbc65c900c 
> |   null |   null |
> null
> (2 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9

[jira] [Updated] (CASSANDRA-7105) SELECT with IN on final column of composite and compound primary key fails

2014-05-23 Thread Sylvain Lebresne (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylvain Lebresne updated CASSANDRA-7105:


Reviewer:   (was: Sylvain Lebresne)

> SELECT with IN on final column of composite and compound primary key fails
> --
>
> Key: CASSANDRA-7105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7105
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: DataStax Cassandra 2.0.7
> Windows dual-core laptop
>Reporter: Bill Mitchell
>Assignee: Sylvain Lebresne
> Fix For: 1.2.17
>
> Attachments: 7105-v2.txt, 7105.txt
>
>
> I have a failing sequence where I specify an IN constraint on the final int 
> column of the composite primary key and an IN constraint on the final String 
> column of the compound primary key and no rows are returned, when rows should 
> be returned.  
> {noformat}
> CREATE TABLE IF NOT EXISTS sr2 (siteID TEXT, partition INT, listID BIGINT, 
> emailAddr TEXT, emailCrypt TEXT, createDate TIMESTAMP, removeDate TIMESTAMP, 
> removeImportID BIGINT, properties TEXT, PRIMARY KEY ((siteID, listID, 
> partition), createDate, emailCrypt) ) WITH CLUSTERING ORDER BY (createDate 
> DESC, emailCrypt DESC)  AND compression = {'sstable_compression' : 
> 'SnappyCompressor'} AND compaction = {'class' : 
> 'SizeTieredCompactionStrategy'};
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 1, 'xyzzy', 
> '5fe7719229092cdde4526afbc65c900c', '2014-04-28T14:05:59.236-0500');
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 2, 'noname', 
> '97bf28af2ca9c498d6e47237bb8680bf', '2014-04-28T14:05:59.236-0500');
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '97bf28af2ca9c498d6e47237bb8680bf';
>  emailcrypt   | emailaddr
> --+---
>  97bf28af2ca9c498d6e47237bb8680bf |noname
> (1 rows)
> select emailCrypt, emailAddr  from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '5fe7719229092cdde4526afbc65c900c';
>  emailcrypt   | emailaddr
> --+---
>  5fe7719229092cdde4526afbc65c900c | xyzzy
> (1 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> cqlsh:test_multiple_in> select * from sr2;
>  siteid   | listid | partition | createdate   
> | emailcrypt | emailaddr| 
> properties | removedate | re
> moveimportid
> --++---+--++--+++---
> -
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 2 | 2014-04-28 
> 14:05:59Central Daylight Time | noname | 97bf28af2ca9c498d6e47237bb8680bf 
> |   null |   null |
> null
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 1 | 2014-04-28 
> 14:05:59Central Daylight Time |  xyzzy | 5fe7719229092cdde4526afbc65c900c 
> |   null |   null |
> null
> (2 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T

[jira] [Updated] (CASSANDRA-7105) SELECT with IN on final column of composite and compound primary key fails

2014-05-23 Thread Sylvain Lebresne (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylvain Lebresne updated CASSANDRA-7105:


Attachment: 7105-v2.txt

The problem is indeed in SelectStatement.buildBound, but we shouldn't be 
changing {{this.isReversed}} in that method. The problem is in fact explains in 
that method by
{noformat}
// The end-of-component of composite doesn't depend on whether the
// component type is reversed or not (i.e. the ReversedType is applied
// to the component comparator but not to the end-of-component itself),
// it only depends on whether the slice is reversed
Bound eocBound = isReversed ? Bound.reverse(bound) : bound;
{noformat}
but somehow that {{eocBound}} is not always used when deciding which 
end-of-component to set. So attaching simple patch to fix that. The attentive 
reader will notice that there is 2 places fixed, and there is indeed 2 separate 
situation where this arise. The first one is the example above, and the 2nd one 
is the case exercised by the test 
[here|https://github.com/riptano/cassandra-dtest/blob/master/cql_tests.py#L4117-L4134]
 (which is useless per-se since we order by even though we only select one row, 
but still).

The patch is against 1.2 since it's affected from there.


> SELECT with IN on final column of composite and compound primary key fails
> --
>
> Key: CASSANDRA-7105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7105
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: DataStax Cassandra 2.0.7
> Windows dual-core laptop
>Reporter: Bill Mitchell
> Attachments: 7105-v2.txt, 7105.txt
>
>
> I have a failing sequence where I specify an IN constraint on the final int 
> column of the composite primary key and an IN constraint on the final String 
> column of the compound primary key and no rows are returned, when rows should 
> be returned.  
> {noformat}
> CREATE TABLE IF NOT EXISTS sr2 (siteID TEXT, partition INT, listID BIGINT, 
> emailAddr TEXT, emailCrypt TEXT, createDate TIMESTAMP, removeDate TIMESTAMP, 
> removeImportID BIGINT, properties TEXT, PRIMARY KEY ((siteID, listID, 
> partition), createDate, emailCrypt) ) WITH CLUSTERING ORDER BY (createDate 
> DESC, emailCrypt DESC)  AND compression = {'sstable_compression' : 
> 'SnappyCompressor'} AND compaction = {'class' : 
> 'SizeTieredCompactionStrategy'};
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 1, 'xyzzy', 
> '5fe7719229092cdde4526afbc65c900c', '2014-04-28T14:05:59.236-0500');
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 2, 'noname', 
> '97bf28af2ca9c498d6e47237bb8680bf', '2014-04-28T14:05:59.236-0500');
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '97bf28af2ca9c498d6e47237bb8680bf';
>  emailcrypt   | emailaddr
> --+---
>  97bf28af2ca9c498d6e47237bb8680bf |noname
> (1 rows)
> select emailCrypt, emailAddr  from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '5fe7719229092cdde4526afbc65c900c';
>  emailcrypt   | emailaddr
> --+---
>  5fe7719229092cdde4526afbc65c900c | xyzzy
> (1 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> cqlsh:test_multiple_in> select * from sr2;
>  siteid   | listid | partition | createdate   
> | emailcrypt | emailaddr| 
> properties | removedate | re
> moveimportid
> --++---+--++--+++---
> -
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 2 | 2014-04-28 
> 14:05:59Central Daylight Time | noname | 97bf28af2ca9c498d6e47237bb8680bf 
> |   null |   null |
> null
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 1 | 2014-04-28 
> 14:05:59Central Daylight Time |  xyzzy | 5fe7719229092cdde4526afbc65c900c 
> |   null |   null |
> null
> (2 rows)
> select emailCryp

[jira] [Updated] (CASSANDRA-7105) SELECT with IN on final column of composite and compound primary key fails

2014-05-14 Thread Dave Brosius (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dave Brosius updated CASSANDRA-7105:


Attachment: 7105.txt

this fixes this exact issue, altho i'm not at all sure it's the correct fix.

> SELECT with IN on final column of composite and compound primary key fails
> --
>
> Key: CASSANDRA-7105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7105
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: DataStax Cassandra 2.0.7
> Windows dual-core laptop
>Reporter: Bill Mitchell
> Attachments: 7105.txt
>
>
> I have a failing sequence where I specify an IN constraint on the final int 
> column of the composite primary key and an IN constraint on the final String 
> column of the compound primary key and no rows are returned, when rows should 
> be returned.  
> {noformat}
> CREATE TABLE IF NOT EXISTS sr2 (siteID TEXT, partition INT, listID BIGINT, 
> emailAddr TEXT, emailCrypt TEXT, createDate TIMESTAMP, removeDate TIMESTAMP, 
> removeImportID BIGINT, properties TEXT, PRIMARY KEY ((siteID, listID, 
> partition), createDate, emailCrypt) ) WITH CLUSTERING ORDER BY (createDate 
> DESC, emailCrypt DESC)  AND compression = {'sstable_compression' : 
> 'SnappyCompressor'} AND compaction = {'class' : 
> 'SizeTieredCompactionStrategy'};
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 1, 'xyzzy', 
> '5fe7719229092cdde4526afbc65c900c', '2014-04-28T14:05:59.236-0500');
> insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, 
> createDate) values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 2, 'noname', 
> '97bf28af2ca9c498d6e47237bb8680bf', '2014-04-28T14:05:59.236-0500');
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '97bf28af2ca9c498d6e47237bb8680bf';
>  emailcrypt   | emailaddr
> --+---
>  97bf28af2ca9c498d6e47237bb8680bf |noname
> (1 rows)
> select emailCrypt, emailAddr  from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
> '5fe7719229092cdde4526afbc65c900c';
>  emailcrypt   | emailaddr
> --+---
>  5fe7719229092cdde4526afbc65c900c | xyzzy
> (1 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> cqlsh:test_multiple_in> select * from sr2;
>  siteid   | listid | partition | createdate   
> | emailcrypt | emailaddr| 
> properties | removedate | re
> moveimportid
> --++---+--++--+++---
> -
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 2 | 2014-04-28 
> 14:05:59Central Daylight Time | noname | 97bf28af2ca9c498d6e47237bb8680bf 
> |   null |   null |
> null
>  4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 1 | 2014-04-28 
> 14:05:59Central Daylight Time |  xyzzy | 5fe7719229092cdde4526afbc65c900c 
> |   null |   null |
> null
> (2 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
> createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
> ('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');
> (0 rows)
> select emailCrypt, emailAddr from sr2 where siteID = 
> '4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
> and createDate = '2014-04-28T14:05:59.236-0500' and emailCr

[jira] [Updated] (CASSANDRA-7105) SELECT with IN on final column of composite and compound primary key fails

2014-04-28 Thread Bill Mitchell (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bill Mitchell updated CASSANDRA-7105:
-

Description: 
I have a failing sequence where I specify an IN constraint on the final int 
column of the composite primary key and an IN constraint on the final String 
column of the compound primary key and no rows are returned, when rows should 
be returned.  
{noformat}
CREATE TABLE IF NOT EXISTS sr2 (siteID TEXT, partition INT, listID BIGINT, 
emailAddr TEXT, emailCrypt TEXT, createDate TIMESTAMP, removeDate TIMESTAMP, 
removeImportID BIGINT, properties TEXT, PRIMARY KEY ((siteID, listID, 
partition), createDate, emailCrypt) ) WITH CLUSTERING ORDER BY (createDate 
DESC, emailCrypt DESC)  AND compression = {'sstable_compression' : 
'SnappyCompressor'} AND compaction = {'class' : 'SizeTieredCompactionStrategy'};
insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, createDate) 
values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 1, 'xyzzy', 
'5fe7719229092cdde4526afbc65c900c', '2014-04-28T14:05:59.236-0500');
insert into sr2 (siteID, listID, partition, emailAddr, emailCrypt, createDate) 
values ('4ca4f79e-3ab2-41c5-ae42-c7009736f1d5', 34, 2, 'noname', 
'97bf28af2ca9c498d6e47237bb8680bf', '2014-04-28T14:05:59.236-0500');
select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
'97bf28af2ca9c498d6e47237bb8680bf';

 emailcrypt   | emailaddr
--+---
 97bf28af2ca9c498d6e47237bb8680bf |noname

(1 rows)

select emailCrypt, emailAddr  from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt = 
'5fe7719229092cdde4526afbc65c900c';


 emailcrypt   | emailaddr
--+---
 5fe7719229092cdde4526afbc65c900c | xyzzy

(1 rows)

select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');

(0 rows)

cqlsh:test_multiple_in> select * from sr2;

 siteid   | listid | partition | createdate 
  | emailcrypt | emailaddr| 
properties | removedate | re
moveimportid
--++---+--++--+++---
-
 4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 2 | 2014-04-28 
14:05:59Central Daylight Time | noname | 97bf28af2ca9c498d6e47237bb8680bf | 
  null |   null |
null
 4ca4f79e-3ab2-41c5-ae42-c7009736f1d5 | 34 | 1 | 2014-04-28 
14:05:59Central Daylight Time |  xyzzy | 5fe7719229092cdde4526afbc65c900c | 
  null |   null |
null

(2 rows)

select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');

(0 rows)

select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 1 and 
createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');

(0 rows)

select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition = 2 and 
createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');

(0 rows)

select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
('97bf28af2ca9c498d6e47237bb8680bf','5fe7719229092cdde4526afbc65c900c');

(0 rows)

cqlsh:test_multiple_in> select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
and createDate = '2014-04-28T14:05:59.236-0500' and emailCrypt IN 
('97bf28af2ca9c498d6e47237bb8680bf');

 emailcrypt   | emailaddr
--+---
 97bf28af2ca9c498d6e47237bb8680bf |noname

(1 rows)

cqlsh:test_multiple_in> select emailCrypt, emailAddr from sr2 where siteID = 
'4ca4f79e-3ab2-41c5-ae42-c7009736f1d5' and listID = 34 and partition IN (1,2) 
and createDate = '2014-04-28T14:05:59.236-0500' and email