aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/appendvfs.c
diff options
context:
space:
mode:
authordrh <>2021-03-08 13:30:29 +0000
committerdrh <>2021-03-08 13:30:29 +0000
commit1e6f33464551982fe75bf8e4b92f50714599d0a8 (patch)
tree54b11b4d9a8e248a8786bdc26614cef997223cca /ext/misc/appendvfs.c
parent40942f22f1d4adcd3c1053e4655f0287d33215b4 (diff)
downloadsqlite-1e6f33464551982fe75bf8e4b92f50714599d0a8.tar.gz
sqlite-1e6f33464551982fe75bf8e4b92f50714599d0a8.zip
Correct the precendence order for rules that determine how a database is
opened by appendvfs when a database is appended to another database. FossilOrigin-Name: 92989fc56f2e81ac13f8106ec83c930f43d10715269b988ee47c9bfa53621995
Diffstat (limited to 'ext/misc/appendvfs.c')
-rw-r--r--ext/misc/appendvfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/misc/appendvfs.c b/ext/misc/appendvfs.c
index 8d62318a5..245c551fa 100644
--- a/ext/misc/appendvfs.c
+++ b/ext/misc/appendvfs.c
@@ -26,12 +26,12 @@
**
** (1) An empty file is an ordinary database.
**
-** (2) If the file begins with the standard SQLite prefix string
-** "SQLite format 3", that file is an ordinary database.
-**
** (2) If the file ends with the appendvfs trailer string
** "Start-Of-SQLite3-NNNNNNNN" that file is an appended database.
**
+** (3) If the file begins with the standard SQLite prefix string
+** "SQLite format 3", that file is an ordinary database.
+**
** (4) If none of the above apply and the SQLITE_OPEN_CREATE flag is
** set, then a new database is appended to the already existing file.
**
@@ -44,7 +44,7 @@
** database, then keep it in a separate file.
**
** If the file being opened is a plain database (not an appended one), then
-** this shim is a pass-through into the default underlying VFS. (rule 2)
+** this shim is a pass-through into the default underlying VFS. (rule 3)
**/
#include "sqlite3ext.h"
SQLITE_EXTENSION_INIT1
@@ -472,7 +472,7 @@ static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){
*/
static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){
char zHdr[16];
- if( apndIsAppendvfsDatabase(sz, pFile) /* rule 3 */
+ if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */
|| (sz & 0x1ff) != 0
|| SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0)
|| memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))!=0