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
This commit is contained in:
parent
eb6f3d5159
commit
ad9e6037a4
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue