From ad9e6037a4558c6fd5a2fcaf9d81a4725a1dd82f Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Fri, 14 Apr 2017 14:44:28 -0400 Subject: [PATCH] Ensure that curSchema is set before opening the DB Without this, it's possible to get `curSchema = 0` which then causes us not to trigger the branch that maintains forward compatibility with the 1.12 schema. Fixes #1332 --- src/libstore/local-store.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 31102203..57d7c9c7 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -225,6 +225,7 @@ LocalStore::LocalStore(bool reserveSpace) schemaPath = settings.nixDBPath + "/schema"; if (settings.readOnlyMode) { + curSchema = getSchema(); openDB(false); return; } @@ -309,6 +310,7 @@ LocalStore::LocalStore(bool reserveSpace) } catch (SysError & e) { if (e.errNo != EACCES) throw; settings.readOnlyMode = true; + curSchema = getSchema(); openDB(false); return; }