Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDC7CCBB9 for ; Sat, 19 May 2012 16:37:42 +0000 (UTC) Received: (qmail 15208 invoked by uid 500); 19 May 2012 16:37:41 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 15180 invoked by uid 500); 19 May 2012 16:37:41 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 15168 invoked by uid 99); 19 May 2012 16:37:41 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2012 16:37:41 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 4848F14281E for ; Sat, 19 May 2012 16:37:41 +0000 (UTC) Date: Sat, 19 May 2012 16:37:41 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: <221556177.7.1337445461303.JavaMail.jiratomcat@issues-vm> In-Reply-To: <802654031.10214.1337281690741.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CASSANDRA-4257) CQL3 range query with secondary index fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylvain Lebresne updated CASSANDRA-4257: ---------------------------------------- Attachment: 4257.txt That was kind of a typo. When 2ndary indexes was used, the code was expecting that a column that had a lesser-than clause on it, also had a greater-than one. Simple patch attached to fix. I've pushed a regression test to the dtests too. > CQL3 range query with secondary index fails > ------------------------------------------- > > Key: CASSANDRA-4257 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4257 > Project: Cassandra > Issue Type: Bug > Components: API > Affects Versions: 1.1.0 > Environment: Cassandra 1.1.0 and git cassandra-1.1 branch, as of commit fd92c09d95a53d582cb8c4b0e77ac47fdd884935 > Reporter: Sean Billig > Assignee: Sylvain Lebresne > Priority: Minor > Labels: cql3, index > Attachments: 4257.txt > > > This query fails: > select * from indextest where setid = 0 and row < 1; > when there's a secondary index on 'setid'; row isn't the primary key. > {code:title=CQL3} > bin$ ./cqlsh --cql3 > Connected to Git at localhost:9160. > [cqlsh 2.2.0 | Cassandra 1.1.0-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol 19.31.0] > Use HELP for help. > cqlsh> use warehouse1; > cqlsh:warehouse1> create table indextest (id int primary key, row int, setid int); > cqlsh:warehouse1> create index indextest_setid_idx on indextest (setid); > cqlsh:warehouse1> insert into indextest (id, row, setid) values (0, 0, 0); > cqlsh:warehouse1> insert into indextest (id, row, setid) values (1, 1, 0); > cqlsh:warehouse1> insert into indextest (id, row, setid) values (2, 2, 0); > cqlsh:warehouse1> select * from indextest where setid = 0; > id | row | setid > ----+-----+------- > 0 | 0 | 0 > 1 | 1 | 0 > 2 | 2 | 0 > cqlsh:warehouse1> select * from indextest where setid = 0 and row = 1; > id | row | setid > ----+-----+------- > 1 | 1 | 0 > cqlsh:warehouse1> select * from indextest where setid = 0 and row < 1; > TSocket read 0 bytes > {code} > {code:title=Error message} > ERROR 13:36:23,544 Error occurred during processing of message. > java.lang.NullPointerException > at org.apache.cassandra.cql3.statements.SelectStatement.getIndexExpressions(SelectStatement.java:546) > at org.apache.cassandra.cql3.statements.SelectStatement.multiRangeSlice(SelectStatement.java:253) > at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:132) > at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:108) > at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:121) > at org.apache.cassandra.thrift.CassandraServer.execute_cql_query(CassandraServer.java:1237) > at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3542) > at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3530) > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32) > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34) > at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:186) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:680) > {code} > Works fine in CQL2: > {code:title=CQL2} > bin$ ./cqlsh_uuid --cql2 > Connected to Git at localhost:9160. > [cqlsh 2.2.0 | Cassandra 1.1.0-SNAPSHOT | CQL spec 2.0.0 | Thrift protocol 19.31.0] > Use HELP for help. > cqlsh> use warehouse1; > cqlsh:warehouse1> select * from indextest where setid = 0 and row < 1; > id | row | setid > ----+-----+------- > 0 | 0 | 0 > cqlsh:warehouse1> select * from indextest where setid = 0 and row < 2; > id | row | setid > ----+-----+------- > 0 | 0 | 0 > 1 | 1 | 0 > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira