Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
2.7.0
-
Security Level: Public
-
2
Description
https://github.com/couchbase/couchbase-lite-core/issues/883
When starting with an empty sqlite database, the user_version pragma is 0.
So in SQLiteDataFile::reopen() it is set to 302.
But after that SQLiteDataFile::ensureIndexTableExists() is called which sets user_version to 301.
This leads to an sqlite error the next time SQLiteDataFile::reopen() is called:
As the user_version is 301 the method wants to adds the purgeCnt column to kv_meta again, which fails, because the column already exists.
I think the user_version should only be set to 301 in SQLiteDataFile::ensureIndexTableExists() if the current user_version is < 301