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

SQLite index creation mistakenly sets user_version backwards

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 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

          Build couchbase-lite-cblite-2.6.0-209 contains couchbase-lite-core commit 455f4e7 with commit message:
          CBL-550: Only change to user_version 301

          build-team Couchbase Build Team added a comment - Build couchbase-lite-cblite-2.6.0-209 contains couchbase-lite-core commit 455f4e7 with commit message: CBL-550 : Only change to user_version 301

          Build couchbase-lite-net-2.7.0-91 contains couchbase-lite-core commit 455f4e7 with commit message:
          CBL-550: Only change to user_version 301

          build-team Couchbase Build Team added a comment - Build couchbase-lite-net-2.7.0-91 contains couchbase-lite-core commit 455f4e7 with commit message: CBL-550 : Only change to user_version 301

          Build couchbase-lite-ios-2.7.0-98 contains couchbase-lite-core commit 455f4e7 with commit message:
          CBL-550: Only change to user_version 301

          build-team Couchbase Build Team added a comment - Build couchbase-lite-ios-2.7.0-98 contains couchbase-lite-core commit 455f4e7 with commit message: CBL-550 : Only change to user_version 301

          Build couchbase-lite-log-2.7.0-79 contains couchbase-lite-core commit 455f4e7 with commit message:
          CBL-550: Only change to user_version 301

          build-team Couchbase Build Team added a comment - Build couchbase-lite-log-2.7.0-79 contains couchbase-lite-core commit 455f4e7 with commit message: CBL-550 : Only change to user_version 301

          Build couchbase-lite-cblite-2.7.0-5 contains couchbase-lite-core commit 455f4e7 with commit message:
          CBL-550: Only change to user_version 301

          build-team Couchbase Build Team added a comment - Build couchbase-lite-cblite-2.7.0-5 contains couchbase-lite-core commit 455f4e7 with commit message: CBL-550 : Only change to user_version 301

          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