[ https://issues.apache.org/jira/browse/CASSANDRA-7722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14090788#comment-14090788 ]
Sylvain Lebresne commented on CASSANDRA-7722: --------------------------------------------- The query {{select * from test.cf where token(pk) < 0 and pk > 0}} should be rejected because we don't support unequality conditions for partition keys (unless you use the token function that is) and so {{pk > 0}} should result in rejecting the query. [~blerer] can you check why this is not the case? > IndexOutOfBoundsException when combining token() with PK inequality in where > clause > ----------------------------------------------------------------------------------- > > Key: CASSANDRA-7722 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7722 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Mike Adamson > Assignee: Benjamin Lerer > Priority: Minor > Fix For: 2.0.10 > > > The following reproduces the problem: > {noformat} > cqlsh> create keyspace if not exists test WITH replication = {'class': > 'SimpleStrategy' , 'replication_factor': '1'}; > cqlsh> create table test.cf (pk int, value text, primary key(pk)); > cqlsh> select * from test.cf where token(pk) < 0 and pk > 0; > {noformat} > This causes: > {noformat} > ERROR 14:39:09,395 Error occurred during processing of message. > java.lang.IndexOutOfBoundsException > at java.nio.Buffer.checkIndex(Buffer.java:538) > at java.nio.HeapByteBuffer.getLong(HeapByteBuffer.java:410) > at > org.apache.cassandra.utils.ByteBufferUtil.toLong(ByteBufferUtil.java:421) > at > org.apache.cassandra.dht.Murmur3Partitioner$1.fromByteArray(Murmur3Partitioner.java:162) > at > org.apache.cassandra.cql3.statements.SelectStatement.getTokenBound(SelectStatement.java:663) > at > org.apache.cassandra.cql3.statements.SelectStatement.getKeyBounds(SelectStatement.java:379) > at > org.apache.cassandra.cql3.statements.SelectStatement.getRangeCommand(SelectStatement.java:367) > at > org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:206) > at > org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:61) > at > org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:158) > at > org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:175) > at > org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1958) > at > org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4486) > at > org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4470) > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) > at > org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:201) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:744) > {noformat} > on the node and: > {noformat} > TSocket read 0 bytes > {noformat} > on the client -- This message was sent by Atlassian JIRA (v6.2#6252)