1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Do not return SQLITE_IOERR when the user attempts to open a small file that is not a database with mmap enabled. Instead return SQLITE_NOTADB.

FossilOrigin-Name: bbcaab3e80d0ff776d8567094b137d1483b3377b
This commit is contained in:
dan
2013-03-25 14:31:39 +00:00
parent a1afc7425a
commit 11ac84635b
3 changed files with 9 additions and 9 deletions

View File

@@ -5051,7 +5051,7 @@ int sqlite3PagerSharedLock(Pager *pPager){
if( !pPager->tempFile && (
pPager->pBackup
|| sqlite3PcachePagecount(pPager->pPCache)>0
|| pPager->bUseFetch /* TODO: Currently required for xUnfetch(0) only. */
|| pPager->bUseFetch
)){
/* The shared-lock has just been acquired on the database file
** and there are already pages in the cache (from a previous
@@ -5078,7 +5078,7 @@ int sqlite3PagerSharedLock(Pager *pPager){
if( nPage>0 ){
IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers)));
rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24);
if( rc!=SQLITE_OK ){
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){
goto failed;
}
}else{