mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
The BTree layer now returns SQLITE_READONLY on an attempt to open a write
cursor on a read-only database. Previously, the failure would not occur until there was an attempt to write to the cursor. (CVS 1289) FossilOrigin-Name: 8a8be4687bf9fd88952b303f30f93aa6fed75b60
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.102 2004/02/14 17:35:07 drh Exp $
|
||||
** $Id: btree.c,v 1.103 2004/03/10 13:42:38 drh Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@@ -1031,10 +1031,15 @@ static int fileBtreeRollbackCkpt(Btree *pBt){
|
||||
** root page of a b-tree. If it is not, then the cursor acquired
|
||||
** will not work correctly.
|
||||
*/
|
||||
static int fileBtreeCursor(Btree *pBt, int iTable, int wrFlag, BtCursor **ppCur){
|
||||
static
|
||||
int fileBtreeCursor(Btree *pBt, int iTable, int wrFlag, BtCursor **ppCur){
|
||||
int rc;
|
||||
BtCursor *pCur, *pRing;
|
||||
|
||||
if( pBt->readOnly && wrFlag ){
|
||||
*ppCur = 0;
|
||||
return SQLITE_READONLY;
|
||||
}
|
||||
if( pBt->page1==0 ){
|
||||
rc = lockBtree(pBt);
|
||||
if( rc!=SQLITE_OK ){
|
||||
|
Reference in New Issue
Block a user