Skip to content

Commit

Permalink
sql: add more tests to drop_index logic test
Browse files Browse the repository at this point in the history
Test edge cases around ambiguous, non-existing, and/or unqualified
index names, to reach test parity with alter_index logic test.

Release note: None
  • Loading branch information
rafiss committed Nov 26, 2019
1 parent 04ef85c commit fa4cbe5
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion pkg/sql/logictest/testdata/logic_test/drop_index
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ CREATE TABLE users (
statement ok
CREATE TABLE othertable (
x INT,
INDEX baw (x)
y INT,
INDEX baw (x),
INDEX yak (y, x)
)

statement error index name "baw" is ambiguous
Expand All @@ -22,6 +24,27 @@ DROP INDEX baw
statement error index name "baw" is ambiguous
DROP INDEX IF EXISTS baw

statement error index "ark" does not exist
DROP INDEX ark

statement ok
DROP INDEX IF EXISTS ark

statement error index "ark" does not exist
DROP INDEX users@ark

statement ok
DROP INDEX IF EXISTS users@ark

statement ok
DROP INDEX yak

statement ok
CREATE INDEX yak ON othertable (y, x)

statement ok
DROP INDEX IF EXISTS yak

statement ok
DROP TABLE othertable

Expand Down

0 comments on commit fa4cbe5

Please sign in to comment.