cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-4796) composite indexes don't always return results they should
Date Mon, 15 Oct 2012 13:38:03 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-4796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sylvain Lebresne updated CASSANDRA-4796:
----------------------------------------

    Attachment: 4726.txt

Hum, I think that is due to some bad merge or something along that way. Basically we were
using a column value instead of a key because SelectStatement.buildBound() was used on keys
but was (wrongfully) using columns internally instead.

Patch attached to change that and that makes buildBound static to make it harder to do that
kind of mistake again.
                
> composite indexes don't always return results they should
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4796
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4796
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Brandon Williams
>            Assignee: Sylvain Lebresne
>             Fix For: 1.2.0 beta 2
>
>         Attachments: 4726.txt
>
>
> composite_index_with_pk_test in the dtests is failing and it reproduces manually.
> {noformat}
> cqlsh:foo>            CREATE TABLE blogs (                 blog_id int,          
      time1 int,                 time2 int,                 author text,                 content
text,                 PRIMARY KEY (blog_id, time1, time2)             ) ;
> cqlsh:foo> create index on blogs(author);
> cqlsh:foo> INSERT INTO blogs (blog_id, time1, time2, author, content) VALUES (1, 0,
0, 'foo', 'bar1');
> cqlsh:foo> INSERT INTO blogs (blog_id, time1, time2, author, content) VALUES (1, 0,
1, 'foo', 'bar2');
> cqlsh:foo> INSERT INTO blogs (blog_id, time1, time2, author, content) VALUES (2, 1,
0, 'foo', 'baz');
> cqlsh:foo> INSERT INTO blogs (blog_id, time1, time2, author, content) VALUES (3, 0,
1, 'gux', 'qux');
> cqlsh:foo> SELECT blog_id, content FROM blogs WHERE time1 = 1 AND author='foo';
> cqlsh:foo>
> {noformat}
> The expected result is:
> {noformat}
>  blog_id | time1 | time2 | author | content
> ---------+-------+-------+--------+---------
>        2 |     1 |     0 |    foo |     baz
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message