[ 
https://issues.apache.org/jira/browse/CASSANDRA-19950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17885192#comment-17885192
 ] 

Caleb Rackliffe commented on CASSANDRA-19950:
---------------------------------------------

Possible repro from [~dcapwell]...

(Override {{isMultiCell()}} in {{ReverseType}})

{noformat}
@Test
public void repo()
{
    createTable("CREATE TABLE %s (pk int, ck frozen<list<int>>, v int, PRIMARY 
KEY(pk, ck)) WITH CLUSTERING ORDER BY (ck DESC)");
    execute("UPDATE %s SET v=42 WHERE pk=? AND ck=?", 0, Arrays.asList(0));
}
{noformat}

> Relation#toRestriction() may not handle ReversedType properly
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-19950
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19950
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL/Semantics
>            Reporter: Caleb Rackliffe
>            Priority: Normal
>             Fix For: 5.x
>
>
> {{o.a.c.cql3.Relation#toRestriction()}} uses {{ClusterMetadata#type}} 
> directly but this type can be {{ReverseType}}, which seems to bypass most of 
> the checks. Checks like {{isMultiCell()}} can be hard to spot as clustering 
> keys don't allow multi-cell, but then we do checks like:
> {noformat}
> checkFalse(column.type instanceof ListType, "Indexes on list entries 
> (%s[index] = value) are not supported.", column.name);
> {noformat}
> If the column is reversed clustering then this check always returns 
> {{false}}, even if it's a reverse list!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to