mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
If a hot-journal file is detected but the application does not have the required read/write permissions, return SQLITE_CANTOPEN. Prior to this change, SQLITE_BUSY was returned. Ticket #3457. (CVS 5849)
FossilOrigin-Name: dc5308c7629abe6a3bad21489c8e97087c264e5a
This commit is contained in:
11
src/pager.c
11
src/pager.c
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.499 2008/10/22 16:26:48 shane Exp $
|
||||
** @(#) $Id: pager.c,v 1.500 2008/10/29 07:01:57 danielk1977 Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -2640,8 +2640,8 @@ static int pagerSharedLock(Pager *pPager){
|
||||
assert( !pPager->tempFile );
|
||||
rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &fout);
|
||||
assert( rc!=SQLITE_OK || pPager->jfd->pMethods );
|
||||
if( fout&SQLITE_OPEN_READONLY ){
|
||||
rc = SQLITE_BUSY;
|
||||
if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){
|
||||
rc = SQLITE_CANTOPEN;
|
||||
sqlite3OsClose(pPager->jfd);
|
||||
}
|
||||
}else{
|
||||
@@ -2652,11 +2652,6 @@ static int pagerSharedLock(Pager *pPager){
|
||||
}
|
||||
}
|
||||
if( rc!=SQLITE_OK ){
|
||||
if( rc!=SQLITE_NOMEM && rc!=SQLITE_IOERR_UNLOCK
|
||||
&& rc!=SQLITE_IOERR_NOMEM
|
||||
){
|
||||
rc = SQLITE_BUSY;
|
||||
}
|
||||
goto failed;
|
||||
}
|
||||
pPager->journalOpen = 1;
|
||||
|
Reference in New Issue
Block a user