1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Add tests for too-tiny appended DBs, clarify align macro.

FossilOrigin-Name: eb40a8dea6afe6890ddda989de83f3d4ae03b112bf78bfc818dfbd57cc5b5b2a
This commit is contained in:
larrybr
2021-03-08 20:13:43 +00:00
parent 52a0753152
commit ddf4972063
4 changed files with 61 additions and 14 deletions

View File

@ -490,8 +490,9 @@ static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){
}
/* Round-up used to get appendvfs portion to begin at a page boundary. */
#define APND_START_ROUNDUP(fsz, nPageBits) \
(((fsz) + ((1<<nPageBits)-1)) & ~(sqlite3_int64)((1<<nPageBits)-1))
#define APND_ALIGN_MASK(nbits) ((1<<nbits)-1)
#define APND_START_ROUNDUP(fsz, nbits) \
( ((fsz)+APND_ALIGN_MASK(nbits)) & ~(sqlite3_int64)APND_ALIGN_MASK(nbits) )
/*
** Open an apnd file handle.