aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-06-19 18:12:02 +0000
committerdan <dan@noemail.net>2010-06-19 18:12:02 +0000
commit8ce49d6ac0d238483a411145416187ff3cb15bf3 (patch)
tree9ca5dc34d2173a8c1d87d4a87811ae7c0dda4b0b /src
parent146ed78b7818b43845ae44d3cbb12c7c80183be5 (diff)
downloadsqlite-8ce49d6ac0d238483a411145416187ff3cb15bf3.tar.gz
sqlite-8ce49d6ac0d238483a411145416187ff3cb15bf3.zip
Change the name of IOCAP_SAFE_DELETE to IOCAP_UNDELETABLE_WHEN_OPEN. Have the xDeviceCharacteristics() method of the win32 VFS return this flag.
FossilOrigin-Name: 5a5ff4e3e4c707464f227907d0aefb8ef42180dd
Diffstat (limited to 'src')
-rw-r--r--src/os_win.c2
-rw-r--r--src/pager.c8
-rw-r--r--src/sqlite.h.in24
-rw-r--r--src/test_vfs.c26
4 files changed, 30 insertions, 30 deletions
diff --git a/src/os_win.c b/src/os_win.c
index ec62e394c..24d0e7ca3 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -1151,7 +1151,7 @@ static int winSectorSize(sqlite3_file *id){
*/
static int winDeviceCharacteristics(sqlite3_file *id){
UNUSED_PARAMETER(id);
- return 0;
+ return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN;
}
/****************************************************************************
diff --git a/src/pager.c b/src/pager.c
index a902d70ef..3d16c66f2 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -3924,9 +3924,9 @@ static int hasHotJournal(Pager *pPager, int *pExists){
assert( pPager->useJournal );
assert( isOpen(pPager->fd) );
assert( pPager->state <= PAGER_SHARED );
- assert( jrnlOpen==0
- || sqlite3OsDeviceCharacteristics(pPager->jfd)&SQLITE_IOCAP_SAFE_DELETE
- );
+ assert( jrnlOpen==0 || ( sqlite3OsDeviceCharacteristics(pPager->jfd) &
+ SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
+ ));
*pExists = 0;
if( !jrnlOpen ){
@@ -4509,7 +4509,7 @@ static int pager_open_journal(Pager *pPager){
rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0);
if( rc==SQLITE_OK ){
int iDc = sqlite3OsDeviceCharacteristics(pPager->jfd);
- pPager->safeJrnlHandle = (iDc&SQLITE_IOCAP_SAFE_DELETE)!=0;
+ pPager->safeJrnlHandle = (iDc&SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN)!=0;
}
#endif
}
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 093d5b3e7..f91f25b3f 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -497,18 +497,18 @@ int sqlite3_exec(
** information is written to disk in the same order as calls
** to xWrite().
*/
-#define SQLITE_IOCAP_ATOMIC 0x00000001
-#define SQLITE_IOCAP_ATOMIC512 0x00000002
-#define SQLITE_IOCAP_ATOMIC1K 0x00000004
-#define SQLITE_IOCAP_ATOMIC2K 0x00000008
-#define SQLITE_IOCAP_ATOMIC4K 0x00000010
-#define SQLITE_IOCAP_ATOMIC8K 0x00000020
-#define SQLITE_IOCAP_ATOMIC16K 0x00000040
-#define SQLITE_IOCAP_ATOMIC32K 0x00000080
-#define SQLITE_IOCAP_ATOMIC64K 0x00000100
-#define SQLITE_IOCAP_SAFE_APPEND 0x00000200
-#define SQLITE_IOCAP_SEQUENTIAL 0x00000400
-#define SQLITE_IOCAP_SAFE_DELETE 0x00000800
+#define SQLITE_IOCAP_ATOMIC 0x00000001
+#define SQLITE_IOCAP_ATOMIC512 0x00000002
+#define SQLITE_IOCAP_ATOMIC1K 0x00000004
+#define SQLITE_IOCAP_ATOMIC2K 0x00000008
+#define SQLITE_IOCAP_ATOMIC4K 0x00000010
+#define SQLITE_IOCAP_ATOMIC8K 0x00000020
+#define SQLITE_IOCAP_ATOMIC16K 0x00000040
+#define SQLITE_IOCAP_ATOMIC32K 0x00000080
+#define SQLITE_IOCAP_ATOMIC64K 0x00000100
+#define SQLITE_IOCAP_SAFE_APPEND 0x00000200
+#define SQLITE_IOCAP_SEQUENTIAL 0x00000400
+#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
/*
** CAPI3REF: File Locking Levels
diff --git a/src/test_vfs.c b/src/test_vfs.c
index 2d4dad786..46f3a0630 100644
--- a/src/test_vfs.c
+++ b/src/test_vfs.c
@@ -1066,19 +1066,19 @@ static int testvfs_obj_cmd(
char *zName;
int iValue;
} aFlag[] = {
- { "default", -1 },
- { "atomic", SQLITE_IOCAP_ATOMIC },
- { "atomic512", SQLITE_IOCAP_ATOMIC512 },
- { "atomic1k", SQLITE_IOCAP_ATOMIC1K },
- { "atomic2k", SQLITE_IOCAP_ATOMIC2K },
- { "atomic4k", SQLITE_IOCAP_ATOMIC4K },
- { "atomic8k", SQLITE_IOCAP_ATOMIC8K },
- { "atomic16k", SQLITE_IOCAP_ATOMIC16K },
- { "atomic32k", SQLITE_IOCAP_ATOMIC32K },
- { "atomic64k", SQLITE_IOCAP_ATOMIC64K },
- { "sequential", SQLITE_IOCAP_SEQUENTIAL },
- { "safe_append", SQLITE_IOCAP_SAFE_APPEND },
- { "safe_delete", SQLITE_IOCAP_SAFE_DELETE },
+ { "default", -1 },
+ { "atomic", SQLITE_IOCAP_ATOMIC },
+ { "atomic512", SQLITE_IOCAP_ATOMIC512 },
+ { "atomic1k", SQLITE_IOCAP_ATOMIC1K },
+ { "atomic2k", SQLITE_IOCAP_ATOMIC2K },
+ { "atomic4k", SQLITE_IOCAP_ATOMIC4K },
+ { "atomic8k", SQLITE_IOCAP_ATOMIC8K },
+ { "atomic16k", SQLITE_IOCAP_ATOMIC16K },
+ { "atomic32k", SQLITE_IOCAP_ATOMIC32K },
+ { "atomic64k", SQLITE_IOCAP_ATOMIC64K },
+ { "sequential", SQLITE_IOCAP_SEQUENTIAL },
+ { "safe_append", SQLITE_IOCAP_SAFE_APPEND },
+ { "undeletable_when_open", SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN },
{ 0, 0 }
};
Tcl_Obj *pRet;