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

Joel Knighton commented on CASSANDRA-11442:
-------------------------------------------

This looks like a duplicate of [CASSANDRA-11331] to me, which is already in 
"Patch Available" status.

> `IF NOT EXISTS` doesn't work for `CREATE INDEX` queries when index name is 
> not specified
> ----------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11442
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11442
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Alex Petrov
>            Priority: Trivial
>             Fix For: 3.x
>
>         Attachments: 
> 0001-Make-IF-NOT-EXISTS-clause-work-on-index-creation-whe.patch
>
>
> `IF NOT EXISTS` doesn't work for `CREATE INDEX` queries when index name is 
> not specified. So executing {{CREATE INDEX IF NOT EXISTS ON %s(c)}} twice 
> would cause
> {code}
> Caused by: org.apache.cassandra.exceptions.InvalidRequestException: Index 
> table_0_c_idx_1 is a duplicate of existing index table_0_c_idx
>       at 
> org.apache.cassandra.cql3.statements.RequestValidations.invalidRequest(RequestValidations.java:199)
>       at 
> org.apache.cassandra.cql3.statements.RequestValidations.checkTrue(RequestValidations.java:63)
>       at 
> org.apache.cassandra.cql3.statements.RequestValidations.checkFalse(RequestValidations.java:111)
>       at 
> org.apache.cassandra.cql3.statements.CreateIndexStatement.announceMigration(CreateIndexStatement.java:225)
>       at 
> org.apache.cassandra.cql3.statements.SchemaAlteringStatement.executeInternal(SchemaAlteringStatement.java:120)
>       at org.apache.cassandra.cql3.CQLTester.schemaChange(CQLTester.java:637)
>       ... 29 more
> {code}
> Patch is attached. 
> If it helps, I've also created a branch: 
> https://github.com/ifesdjeen/cassandra/tree/11442-trunk



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to