You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2012/06/26 19:11:44 UTC
[jira] [Commented] (CASSANDRA-4372) CQL3 Range Query contains
unwanted results with composite columns
[ https://issues.apache.org/jira/browse/CASSANDRA-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401523#comment-13401523 ]
Jonathan Ellis commented on CASSANDRA-4372:
-------------------------------------------
LGTM, although if you want to leave the logging in, it should be converted to .debug w/o string concatenation
> CQL3 Range Query contains unwanted results with composite columns
> -----------------------------------------------------------------
>
> Key: CASSANDRA-4372
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4372
> Project: Cassandra
> Issue Type: Bug
> Components: API, Core
> Affects Versions: 1.1.1
> Environment: Mac OS 10.7.4, Cassandra 1.1.1, single node for testing
> Reporter: Reinhard Buchinger
> Assignee: Sylvain Lebresne
> Labels: bug, composite, compositeColumns, cql3, query, range
> Fix For: 1.1.2
>
> Attachments: 4372.txt
>
>
> Here is a CQL3 range query sample where I get wrong results (tested using cqlsh --cql3) from my perspective:
> CREATE KEYSPACE testing WITH strategy_class = 'SimpleStrategy' AND strategy_options:replication_factor = 1;
> USE testing;
> CREATE TABLE bug_test (a int, b int, c int, d int, e int, f text, PRIMARY KEY (a, b, c, d, e) );
> INSERT INTO bug_test (a, b, c, d, e, f) VALUES (1, 1, 1, 1, 2, '2');
> INSERT INTO bug_test (a, b, c, d, e, f) VALUES (1, 1, 1, 1, 1, '1');
> INSERT INTO bug_test (a, b, c, d, e, f) VALUES (1, 1, 1, 2, 1, '1');
> INSERT INTO bug_test (a, b, c, d, e, f) VALUES (1, 1, 1, 1, 3, '3');
> INSERT INTO bug_test (a, b, c, d, e, f) VALUES (1, 1, 1, 1, 5, '5');
> ----------
> Normal select everything query:
> SELECT * FROM bug_test;
> Results:
> a | b | c | d | e | f
> ---+---+---+---+---+---
> 1 | 1 | 1 | 1 | 1 | 1
> 1 | 1 | 1 | 1 | 2 | 2
> 1 | 1 | 1 | 1 | 3 | 3
> 1 | 1 | 1 | 1 | 5 | 5
> 1 | 1 | 1 | 2 | 1 | 1
> Everything fine so far.
> ----------
> Select with greater equal comparison for last column of composite key:
> SELECT a, b, c, d, e, f FROM bug_test WHERE a = 1 AND b = 1 AND c = 1 AND d = 1 AND e >= 2;
> Results:
> a | b | c | d | e | f
> ---+---+---+---+---+---
> 1 | 1 | 1 | 1 | 2 | 2
> 1 | 1 | 1 | 1 | 3 | 3
> 1 | 1 | 1 | 1 | 5 | 5
> 1 | 1 | 1 | 2 | 1 | 1
> Bug:
> Why was the last row returned? It shouldn't be there, right?
> ----------
> Select with greater comparison for last column of composite key:
> SELECT a, b, c, d, e, f FROM bug_test WHERE a = 1 AND b = 1 AND c = 1 AND d = 1 AND e > 2;
> Results:
> a | b | c | d | e | f
> ---+---+---+---+---+---
> 1 | 1 | 1 | 1 | 3 | 3
> 1 | 1 | 1 | 1 | 5 | 5
> 1 | 1 | 1 | 2 | 1 | 1
> Bug:
> Why was the last row returned? It shouldn't be there, right?
> The same issue is also present with between ranges (e >= 1 AND e <= 2)...
--
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