[
https://issues.apache.org/jira/browse/CASSANDRA-8275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14303698#comment-14303698
]
Tyler Hobbs commented on CASSANDRA-8275:
----------------------------------------
Review comments:
* {{SelectStatement.restrictedNames}} could use a comment explaining what the
values in the map mean
* The two unit tests that are expected to fail are missing the table name in
the 2.0 patch
* In the trunk patch,
{{SingleColumnPrimaryKeyRestrictions.addIndexExpressionTo()}} could use
comments explaining the logic. It's not clear why we only check
{{isClusteringColumn()}} once, what {{position}} is tracking, and why
{{CONTAINS}} is treated specially. Also, typo in the {{clusteringColumns}}
variable name.
* In 2.0, this appears to cause a regression in the dtest
{{CQLTests.simple_tuple_query_test()}}. It throws an IRE when the query should
be supported. I'm not sure if we need CASSANDRA-8613 applied at the same time
to fix this.
* Also in 2.0, in the dtest {{CQLTests.composite_index_with_pk_test()}}, we're
not requiring {{ALLOW FILTERING}} (where I believe we should be), causing a
test to fail.
I didn't run the dtests against 2.1 or trunk, but I recommend running at least
{{cql_tests.py}} against the patches for those branches.
> Some queries with multicolumn relation do not behave properly when secondary
> index is used
> ------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-8275
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8275
> Project: Cassandra
> Issue Type: Bug
> Reporter: Benjamin Lerer
> Assignee: Benjamin Lerer
> Fix For: 3.0, 2.1.3, 2.0.13
>
> Attachments: CASSANDRA-8275-2.0.txt, CASSANDRA-8275-2.1.txt,
> CASSANDRA-8275-trunk.txt
>
>
> In the case where we perform a select using a multicolumn relation over
> multiple columns that use a secondary index the error message returned is
> wrong.
> The following unit test can be use to reproduce the problem:
> {code}
> @Test
> public void testMultipleClusteringWithIndex() throws Throwable
> {
> createTable("CREATE TABLE %s (a int, b int, c int, d int, PRIMARY KEY
> (a, b, c, d))");
> createIndex("CREATE INDEX ON %s (b)");
>
> execute("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 0, 0,
> 0);
> execute("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 0, 1,
> 0);
> execute("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 0, 1,
> 1);
> execute("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 1, 0,
> 0);
> execute("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 1, 1,
> 0);
> execute("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 1, 1,
> 1);
> assertRows(execute("SELECT * FROM %s WHERE (b) = (?)", 1),
> row(0, 1, 0, 0),
> row(0, 1, 1, 0),
> row(0, 1, 1, 1)
> );
>
> assertRows(execute("SELECT * FROM %s WHERE (b, c) = (?, ?) ALLOW
> FILTERING", 1, 1),
> row(0, 1, 1, 0),
> row(0, 1, 1, 1)
> );
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)