1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Add support and documentation for the fullfsync pragma. Also include

some other unrelated documentation updates. (CVS 3080)

FossilOrigin-Name: f2069d0bf3161591535e68b7389792e9cb7fe043
This commit is contained in:
drh
2006-02-11 01:25:50 +00:00
parent 78aecb7250
commit ac530b1ab4
15 changed files with 120 additions and 73 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
** $Id: pragma.c,v 1.117 2006/02/10 02:27:43 danielk1977 Exp $
** $Id: pragma.c,v 1.118 2006/02/11 01:25:51 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -152,6 +152,7 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
{ "count_changes", SQLITE_CountRows },
{ "empty_result_callbacks", SQLITE_NullCallback },
{ "legacy_file_format", SQLITE_LegacyFileFmt },
{ "fullfsync", SQLITE_FullFSync },
#ifndef SQLITE_OMIT_CHECK
{ "ignore_check_constraints", SQLITE_IgnoreChecks },
#endif
@@ -180,10 +181,6 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
db->flags &= ~p->mask;
}
}
/* If one of these pragmas is executed, any prepared statements
** need to be recompiled.
*/
sqlite3VdbeAddOp(v, OP_Expire, 0, 0);
}
return 1;
}
@@ -437,7 +434,6 @@ void sqlite3Pragma(
"Safety level may not be changed inside a transaction");
}else{
pDb->safety_level = getSafetyLevel(zRight)+1;
sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level);
}
}
}else
@@ -947,6 +943,15 @@ void sqlite3Pragma(
** are only valid for a single execution.
*/
sqlite3VdbeAddOp(v, OP_Expire, 1, 0);
/*
** Reset the safety level, in case the fullfsync flag or synchronous
** setting changed.
*/
if( db->autoCommit ){
sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level,
(db->flags&SQLITE_FullFSync)!=0);
}
}
pragma_out:
sqliteFree(zLeft);