We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d886746 commit 507c90aCopy full SHA for 507c90a
sqleet.c
@@ -432,7 +432,8 @@ static int codec_set_to(Codec *codec, Btree *pBt)
432
/* Non-empty database, read page 1 with the codec */
433
DbPage *page;
434
sqlite3PcacheClear(pager->pPCache);
435
- if ((rc = sqlite3PagerGet(pager, 1, &page, 0)) == SQLITE_OK) {
+ rc = sqlite3PagerGet(pager, 1, &page, PAGER_GET_READONLY);
436
+ if (rc == SQLITE_OK) {
437
rc = SQLITE_NOTADB;
438
if (!memcmp(page->pData, "SQLite format 3", 16)) {
439
const uint8_t *data = page->pData;
@@ -464,7 +465,7 @@ static int codec_set_to(Codec *codec, Btree *pBt)
464
465
rc = SQLITE_OK;
466
}
467
- pager_unlock(pager);
468
+ pagerUnlockIfUnused(pager);
469
sqlite3BtreeLeave(pBt);
470
return rc;
471
0 commit comments