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

Benjamin Lerer commented on CASSANDRA-18386:
--------------------------------------------

The problem is that the {{queriedColumns()}} is broken for any query that use 
bind variables. As that method was only used by the logic used to create MVs it 
was not originally a problem. We should change the signature to provide the 
{{QueryOptions}} as an argument and probably change the method name as it is 
confusing. What the method returns is a {{ColumnFilter}} not the queried 
columns (that can be retrieved from the {{ColumnFilter}}. 
There is no need for {{asCQL}} to call {{queriedColumns()}} as it has already 
created the {{ColumnFilter}} correctly with the proper bind variable.
 

> SelectStatement.asCQL fails with IndexOutOfBoundsException
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-18386
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18386
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL/Interpreter
>            Reporter: David Capwell
>            Assignee: Aleksandr Volochnev
>            Priority: Normal
>             Fix For: 4.1.x, 5.x
>
>
> See 
> https://app.circleci.com/pipelines/github/dcapwell/cassandra/1934/workflows/2525f75d-a819-43db-8e89-c9d58cc8f4d7/jobs/18594
> {code}
> java.lang.IndexOutOfBoundsException: Index: 0
>       at java.util.Collections$EmptyList.get(Collections.java:4456)
>       at 
> org.apache.cassandra.cql3.Constants$Marker.bindAndGet(Constants.java:470)
>       at 
> org.apache.cassandra.cql3.selection.ElementsSelector$1.newInstance(ElementsSelector.java:129)
>       at 
> org.apache.cassandra.cql3.selection.SelectorFactories.newInstances(SelectorFactories.java:206)
>       at 
> org.apache.cassandra.cql3.selection.Selection$SelectionWithProcessing$1.<init>(Selection.java:564)
>       at 
> org.apache.cassandra.cql3.selection.Selection$SelectionWithProcessing.newSelectors(Selection.java:562)
>       at 
> org.apache.cassandra.cql3.statements.SelectStatement.queriedColumns(SelectStatement.java:195)
>       at 
> org.apache.cassandra.cql3.statements.SelectStatement.asCQL(SelectStatement.java:1634)
> {code}



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