cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Petrov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-11442) `IF NOT EXISTS` doesn't work for `CREATE INDEX` queries when index name is not specified
Date Sat, 26 Mar 2016 19:27:25 GMT
Alex Petrov created CASSANDRA-11442:
---------------------------------------

             Summary: `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
            Assignee: Alex Petrov
            Priority: Trivial


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



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

Mime
View raw message