Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Re-opening a database with an Index causes failure
Description
I have code that does this:
Create a database
Add a couple of indexes
Close the database
Attempt to re-open it.
The attempt to re-open fails with the LiteCore error:
LiteCoreException{3, 1, "virtual tables may not be altered -- ALTER TABLE "kv_.test_scope_\Q6\No\Dzd\Ns\W\V\K.test_collection_\W\M\Tm\Xw\Nxnp\L\J::index2" ADD COLUMN expiration INTEGER; CREATE INDEX "kv_.test_scope_\Q6\No\Dzd\Ns\W\V\K.test_collection_\W\M\Tm\Xw\Nxnp\L\J::index2_expiration" ON "kv_.test_scope_\Q6\No\Dzd\Ns\W\V\K.test_collection_\W\M\Tm\Xw\Nxnp\L\J::index2" (expiration) WHERE expiration not null"}
I have code that does this:
Create a database
Add a couple of indexes
Close the database
Attempt to re-open it.
The attempt to re-open fails with the LiteCore error:
LiteCoreException{3, 1, "virtual tables may not be altered -- ALTER TABLE "kv_.test_scope_\Q6\No\Dzd\Ns\W\V\K.test_collection_\W\M\Tm\Xw\Nxnp\L\J::index2" ADD COLUMN expiration INTEGER; CREATE INDEX "kv_.test_scope_\Q6\No\Dzd\Ns\W\V\K.test_collection_\W\M\Tm\Xw\Nxnp\L\J::index2_expiration" ON "kv_.test_scope_\Q6\No\Dzd\Ns\W\V\K.test_collection_\W\M\Tm\Xw\Nxnp\L\J::index2" (expiration) WHERE expiration not null"}
The failure is completely repeatable