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

If meta(3)>0 then make the database readonly for now. This allows the current

database to interact with future releases that might include autovacuum. (CVS 1888)

FossilOrigin-Name: 7619bf4771781005da23a3e9d7b00de405e27a64
This commit is contained in:
drh
2004-08-14 19:20:09 +00:00
parent 22ac46d15d
commit ae15787643
5 changed files with 22 additions and 17 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.181 2004/08/08 19:43:30 drh Exp $
** $Id: btree.c,v 1.182 2004/08/14 19:20:10 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@@ -3746,6 +3746,11 @@ int sqlite3BtreeGetMeta(Btree *pBt, int idx, u32 *pMeta){
if( rc ) return rc;
*pMeta = get4byte(&pP1[36 + idx*4]);
sqlite3pager_unref(pP1);
/* The current implementation is unable to handle writes to an autovacuumed
** database. So make such a database readonly. */
if( idx==4 && *pMeta>0 ) pBt->readOnly = 1;
return SQLITE_OK;
}