diff options
author | Fyodor Kupolov <fkupolov@google.com> | 2017-07-28 13:34:56 -0700 |
---|---|---|
committer | Fyodor Kupolov <fkupolov@google.com> | 2017-08-01 18:12:58 +0000 |
commit | 41effbb659b63b3233036011750624b5da59d0a1 (patch) | |
tree | 274120e12a20ab06050781cf7f98fc5a99827930 /dist/sqlite3.h | |
parent | 11cbf1c9543b6322235ca36af0f7418c1d667f15 (diff) |
sqlite: Upgrade to SQLite 3.19.3 [batch-atomic-write] [NO PARTIAL RERUN]
Downloaded from https://sqlite.org/src/tarball/SQLite-def55027.tar.gz
$ shasum SQLite-def55027.tar.gz
5872660422a1ef8211f57f96f7c8507279a376f7 SQLite-def55027.tar.gz
Unpack and run
"./configure; make sqlite3.c" to generate the "sqlite3.c",
"sqlite3.h", "shell.c", and "sqlite3ext.h" source files
dist/orig contains the stock sqlite3 code, as generated from the
tar.gz file above.
dist contains a copy of dist/orig, but with the Android.patch
file applied.
Please see Android.patch for a list of differences between stock
and Android.
Experimental changes from batch-atomic-write-3.19 branch
https://sqlite.org/src/info/def55027b1f1db9c
With this enhancement, SQLite automatically omits the rollback journal
and uses the atomic write capabilities of F2FS when it can.
When F2FS atomic write is used, we find that transactions are about 3x
faster compared with an ext4 filesystem on the same SSD device.
Test: manual + SQLiteDatabaseTest CTS test
Bug: 64149514
Change-Id: I920f435748fa1d773be161f3264626d33b11edfd
Diffstat (limited to 'dist/sqlite3.h')
-rw-r--r-- | dist/sqlite3.h | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/dist/sqlite3.h b/dist/sqlite3.h index 296ada0..eb32c2b 100644 --- a/dist/sqlite3.h +++ b/dist/sqlite3.h @@ -121,9 +121,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.19.2" -#define SQLITE_VERSION_NUMBER 3019002 -#define SQLITE_SOURCE_ID "2017-05-25 16:50:27 edb4e819b0c058c7d74d27ebd14cc5ceb2bad6a6144a486a970182b7afe3f8b9" +#define SQLITE_VERSION "3.19.3" +#define SQLITE_VERSION_NUMBER 3019003 +#define SQLITE_SOURCE_ID "2017-07-28 02:02:45 def55027b1f1db9c083830019dbcc3daed94f6cc70a76b285ac1af9d82f81695" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -580,6 +580,11 @@ SQLITE_API 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 supports doing multiple write operations atomically when those +** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and +** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. */ #define SQLITE_IOCAP_ATOMIC 0x00000001 #define SQLITE_IOCAP_ATOMIC512 0x00000002 @@ -595,6 +600,7 @@ SQLITE_API 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 @@ -729,6 +735,7 @@ struct sqlite3_file { ** <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN] ** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE] ** <li> [SQLITE_IOCAP_IMMUTABLE] +** <li> [SQLITE_IOCAP_BATCH_ATOMIC] ** </ul> ** ** The SQLITE_IOCAP_ATOMIC property means that all writes of @@ -1012,6 +1019,40 @@ 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. +** +** <li>[[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** 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. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +** <li>[[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** 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. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +** <li>[[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. ** </ul> */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1043,6 +1084,9 @@ 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 +#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE |