You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Brandon Williams (JIRA)" <ji...@apache.org> on 2012/10/11 23:39:03 UTC

[jira] [Created] (CASSANDRA-4796) composite indexes don't always return results they should

Brandon Williams created CASSANDRA-4796:
-------------------------------------------

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


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

[jira] [Updated] (CASSANDRA-4796) composite indexes don't always return results they should

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ 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

[jira] [Commented] (CASSANDRA-4796) composite indexes don't always return results they should

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476639#comment-13476639 ] 

Jonathan Ellis commented on CASSANDRA-4796:
-------------------------------------------

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