title: Cassandra CQL3 slice query issue - How to slice
body: <p>I have a table created using <code>CQL3</code> with:</p>
  
  <pre><code>create table compositetest(m_id ascii,i_id int,l_id ascii,body ascii,
    PRIMARY KEY(m_id,i_id,l_id));
  </code></pre>
  
  <p>Inserted some random data:</p>
  
  <pre><code>cqlsh:testkeyspace1&gt; insert into compositetest(m_id,i_id,l_id,body) VALUES ('m1',1,'l1','b1');
  cqlsh:testkeyspace1&gt; insert into compositetest(m_id,i_id,l_id,body) VALUES ('m2',2,'l2','b2');
  cqlsh:testkeyspace1&gt; insert into compositetest(m_id,i_id,l_id,body) VALUES ('m1',2,'l2','b2');
  cqlsh:testkeyspace1&gt; insert into compositetest(m_id,i_id,l_id,body) VALUES ('m2',1,'l1','b1');
  cqlsh:testkeyspace1&gt; insert into compositetest(m_id,i_id,l_id,body) VALUES ('m3',3,'l1','b1');
  cqlsh:testkeyspace1&gt; insert into compositetest(m_id,i_id,l_id,body) VALUES ('m3',2,'l2','b2');
  cqlsh:testkeyspace1&gt; insert into compositetest(m_id,i_id,l_id,body) VALUES ('m3',1,'l2','b2');
  cqlsh:testkeyspace1&gt; select * from compositetest;
  
   m_id | i_id | l_id | body
  ------+------+------+------
     m1 |    1 |   l1 |   b1
     m1 |    2 |   l2 |   b2
     m2 |    1 |   l1 |   b1
     m2 |    2 |   l2 |   b2
     m3 |    1 |   l2 |   b2
     m3 |    2 |   l2 |   b2
     m3 |    3 |   l1 |   b1
  </code></pre>
  
  <p>When I do a query </p>
  
  <pre><code>cqlsh:testkeyspace1&gt; select * from compositetest where i_id&lt;=3 limit 3;
  
   m_id | i_id | l_id | body
  ------+------+------+------
     m1 |    1 |   l1 |   b1
     m1 |    2 |   l2 |   b2
     m2 |    1 |   l1 |   b1
  </code></pre>
  
  <p>Now if I want to get the next 3 rows</p>
  
  <pre><code>cqlsh:testkeyspace1&gt; ?
  </code></pre>
  
  <p>Was trying to write CQL for slice range (not sure if it can be done)</p>
  
  <p>My CQLSh shows the Socket is closed and I see the error </p>
  
  <pre><code>TSocket read 0 bytes
  </code></pre>
  
  <p>On the server side I see the following error:</p>
  
  <pre><code>ERROR [Thrift:3] 2012-08-12 15:15:24,414 CustomTThreadPoolServer.java (line 204) Error occurred during processing of message.
  java.lang.NullPointerException
      at org.apache.cassandra.cql3.statements.SelectStatement$Restriction.setBound(SelectStatement.java:1277)
      at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.updateRestriction(SelectStatement.java:1151)
      at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:1001)
      at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:215)
      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></pre>
  
  <p>How do I get the next 3 rows, regarding the exception on server side, I will file a bug. The CQLSh closed and I have to now exit and reconnect</p>