Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-550

SQLite index creation mistakenly sets user_version backwards

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 2.7.0
    • 2.7.0
    • LiteCore
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jimb Jim Borden
            jimb Jim Borden
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty