1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Add extended error code SQLITE_READONLY_ROLLBACK. Returned if a read-only connection cannot read the database because doing so would require it to roll back a hot-journal.

FossilOrigin-Name: 39247b14a52b0c0222fe5a848bf0aef0854058c4
This commit is contained in:
dan
2013-03-05 15:09:25 +00:00
parent e1df4e31ec
commit e3664fb03c
6 changed files with 48 additions and 10 deletions

View File

@@ -4827,6 +4827,11 @@ int sqlite3PagerSharedLock(Pager *pPager){
goto failed;
}
if( bHotJournal ){
if( pPager->readOnly ){
rc = SQLITE_READONLY_ROLLBACK;
goto failed;
}
/* Get an EXCLUSIVE lock on the database file. At this point it is
** important that a RESERVED lock is not obtained on the way to the
** EXCLUSIVE lock. If it were, another process might open the