Skip to content

Commit

Permalink
pager: move xPreMainDbOpen call to its proper place
Browse files Browse the repository at this point in the history
xPreMainDbOpen hook was only called in case of non-null
WAL pathname, which is a minor mistake - let's fix it.
  • Loading branch information
psarna committed Jan 12, 2023
1 parent 2838baa commit b6f5c5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -4893,17 +4893,16 @@ int sqlite3PagerOpen(
sqlite3FileSuffix3(zFilename, pPager->zWal);
pPtr = (u8*)(pPager->zWal + sqlite3Strlen30(pPager->zWal)+1);
#endif
}else{
pPager->zWal = 0;
}

if (pWalMethods->xPreMainDbOpen) {
int rc = pWalMethods->xPreMainDbOpen(pWalMethods, zPathname);
if (rc != SQLITE_OK) {
return rc;
}
}

}else{
pPager->zWal = 0;
}
#endif
(void)pPtr; /* Suppress warning about unused pPtr value */

Expand Down

0 comments on commit b6f5c5d

Please sign in to comment.