[jira] [Commented] (CASSANDRA-3604) Bad code in org.apache.cassandra.cql.QueryProcessor

2011-12-12 Thread Jonathan Ellis (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13167703#comment-13167703
 ] 

Jonathan Ellis commented on CASSANDRA-3604:
---

+1

 Bad code in org.apache.cassandra.cql.QueryProcessor
 ---

 Key: CASSANDRA-3604
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3604
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.1
 Environment: all
Reporter: Zoltan Farkas
Assignee: Sylvain Lebresne
 Fix For: 1.1

 Attachments: 3604.patch

   Original Estimate: 5m
  Remaining Estimate: 5m

 line 206:
 if (rows.get(0).key.key.equals(startKey))
 rows.remove(0);
 the equals will always return false because object of different types are 
 compared

--
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




[jira] [Commented] (CASSANDRA-3604) Bad code in org.apache.cassandra.cql.QueryProcessor

2011-12-09 Thread Zoltan Farkas (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13166734#comment-13166734
 ] 

Zoltan Farkas commented on CASSANDRA-3604:
--

similar issue also on line:214:
if (rows.get(lastIndex).key.key.equals(finishKey))
rows.remove(lastIndex);

 Bad code in org.apache.cassandra.cql.QueryProcessor
 ---

 Key: CASSANDRA-3604
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3604
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.0.5
 Environment: all
Reporter: Zoltan Farkas
   Original Estimate: 5m
  Remaining Estimate: 5m

 line 206:
 if (rows.get(0).key.key.equals(startKey))
 rows.remove(0);
 the equals will always return false because object of different types are 
 compared

--
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




[jira] [Commented] (CASSANDRA-3604) Bad code in org.apache.cassandra.cql.QueryProcessor

2011-12-09 Thread Zoltan Farkas (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13166762#comment-13166762
 ] 

Zoltan Farkas commented on CASSANDRA-3604:
--

that is not correct:

 if (rows.get(0).key.key.equals(startKey))
rows.remove(0);

rows is of type Listorg.apache.cassandra.db.Row

org.apache.cassandra.db.Row.key is of type DecoratedKey?

DecoratedKey?.key is of type ByteBuffer

startKey is of type RowPosition 

as such

ByteBuffer is compared with a RowPosition

can you please explain how startKey is of type ByteBuffer ?

 Bad code in org.apache.cassandra.cql.QueryProcessor
 ---

 Key: CASSANDRA-3604
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3604
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.0.5
 Environment: all
Reporter: Zoltan Farkas
   Original Estimate: 5m
  Remaining Estimate: 5m

 line 206:
 if (rows.get(0).key.key.equals(startKey))
 rows.remove(0);
 the equals will always return false because object of different types are 
 compared

--
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




[jira] [Commented] (CASSANDRA-3604) Bad code in org.apache.cassandra.cql.QueryProcessor

2011-12-09 Thread Zoltan Farkas (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-3604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13166786#comment-13166786
 ] 

Zoltan Farkas commented on CASSANDRA-3604:
--

OK, I believe we are looking at different versions I see the issue in:

trunk: Revision 1212726 last modified Dec 06

ByteBuffer startKeyBytes = (select.getKeyStart() != null)
Line 155:   ? 
select.getKeyStart().getByteBuffer(keyType)
   : null;

ByteBuffer finishKeyBytes = (select.getKeyFinish() != null)
? 
select.getKeyFinish().getByteBuffer(keyType)
: null;

THe actual definition
RowPosition startKey = RowPosition.forKey(startKeyBytes, p), finishKey 
= RowPosition.forKey(finishKeyBytes, p);


 Bad code in org.apache.cassandra.cql.QueryProcessor
 ---

 Key: CASSANDRA-3604
 URL: https://issues.apache.org/jira/browse/CASSANDRA-3604
 Project: Cassandra
  Issue Type: Bug
Affects Versions: 1.1
 Environment: all
Reporter: Zoltan Farkas
   Original Estimate: 5m
  Remaining Estimate: 5m

 line 206:
 if (rows.get(0).key.key.equals(startKey))
 rows.remove(0);
 the equals will always return false because object of different types are 
 compared

--
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