From: drh Date: Wed, 19 Jul 2017 11:20:32 +0000 (+0000) Subject: Add VFS interfaces needed to make use of batch atomic write capabilities X-Git-Tag: version-3.19.4~1^2~1^2~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=466004d5a474eaf82344c0c4fb3c005fe4590ff4;p=thirdparty%2Fsqlite.git Add VFS interfaces needed to make use of batch atomic write capabilities in the underlying filesystem. FossilOrigin-Name: 929bc46b8be0111a7b6e3d6fe129f0cad869c6a551bd47569c122742597b9f1c --- diff --git a/manifest b/manifest index aed1eb2c5a..08cb95d385 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\scrash\sin\sunionvtab\scaused\sby\sa\smisconfiguration.\sAdd\sother\stest\scases\nfor\sthe\ssame. -D 2017-07-18T21:19:17.472 +C Add\sVFS\sinterfaces\sneeded\sto\smake\suse\sof\sbatch\satomic\swrite\scapabilities\nin\sthe\sunderlying\sfilesystem. +D 2017-07-19T11:20:32.402 F Makefile.in d9873c9925917cca9990ee24be17eb9613a668012c85a343aef7e5536ae266e8 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 02b469e9dcd5b7ee63fc1fb05babc174260ee4cfa4e0ef2e48c3c6801567a016 @@ -455,7 +455,7 @@ F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/select.c c6bf96a7f9d7d68f929de84738c599a30d0a725ab0b54420e70545743cd5ee7b F src/shell.c dd4494287b22ac5ab0654fdd5acb1f2172d2fe621f673a39229ddc31bd8d598f F src/shell.c.in b5725acacba95ccefa57b6d068f710e29ba8239c3aa704628a1902a1f729c175 -F src/sqlite.h.in dad804d4e1979a2ddec33cc8da6aa50c04e6ba0dcb4058e7b3609588d010e041 +F src/sqlite.h.in d11303f0c79ce08edb57893ee5eb168e83cdc6d0cad973da5957b954d0ff950e F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 967154985ed2ae62f90d9029bb5b5071793d847f1696a2ebe9e8cc0b042ae60b F src/sqliteInt.h 0ba730cdc8afa723a5642380712f8bb33abd6a69218571c18b94acf3562de22a @@ -1636,7 +1636,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 505fdc8ff5150276d3c6ab6135a542b791e9e79e2f76323e592b73b3fdc9bc2a -R 8a8c551ade3a7904ad53bd61f1cbe08d -U dan -Z 3243e7bcd67f989b9bcab9c5c686c467 +P 255d6b99de2bb210c09ebee9f9481ba3d1130fda47e6e01b4cc8411d00679d09 +R fcea2dbde9fcd8d5a84c03eddfc73a94 +T *branch * batch-atomic-write +T *sym-batch-atomic-write * +T -sym-trunk * +U drh +Z 449d02eadec688967e645655067d23f3 diff --git a/manifest.uuid b/manifest.uuid index 516ce5aff9..ea184f4bf7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -255d6b99de2bb210c09ebee9f9481ba3d1130fda47e6e01b4cc8411d00679d09 \ No newline at end of file +929bc46b8be0111a7b6e3d6fe129f0cad869c6a551bd47569c122742597b9f1c \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 427b6f747e..7c3f0f73d1 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -580,6 +580,11 @@ int sqlite3_exec( ** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on ** read-only media and cannot be changed even by processes with ** elevated privileges. +** +** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying +** filesystem can multiple write operations atomically when those +** write operations are bracketed by [SQLITE_IOCAP_BEGIN_ATOMIC_WRITE] and +** [SQLITE_IOCAP_ATOMIC_WRITE_COMMIT]. */ #define SQLITE_IOCAP_ATOMIC 0x00000001 #define SQLITE_IOCAP_ATOMIC512 0x00000002 @@ -595,6 +600,7 @@ int sqlite3_exec( #define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 #define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000 #define SQLITE_IOCAP_IMMUTABLE 0x00002000 +#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000 /* ** CAPI3REF: File Locking Levels @@ -1012,6 +1018,19 @@ struct sqlite3_io_methods { ** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by ** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for ** this opcode. +** +**
  • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, that +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** +**
  • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1043,6 +1062,8 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_JOURNAL_POINTER 28 #define SQLITE_FCNTL_WIN32_GET_HANDLE 29 #define SQLITE_FCNTL_PDB 30 +#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31 +#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE