diff options
author | drh <drh@noemail.net> | 2016-01-13 18:21:19 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-01-13 18:21:19 +0000 |
commit | c5f98779951f968c16ef74b3d96e8af541a4ecec (patch) | |
tree | e74065029601c7ddc8905b7ff80c420e48ed4f2d | |
parent | 9bd7cd12de44a30a5333f4fcd215356086436d11 (diff) | |
download | sqlite-c5f98779951f968c16ef74b3d96e8af541a4ecec.tar.gz sqlite-c5f98779951f968c16ef74b3d96e8af541a4ecec.zip |
Add the SQLITE_FCNTL_JOURNAL_POINTER file control.
FossilOrigin-Name: ea9ce228e8c0a2a366b252bff1088bb061d4ec6f
-rw-r--r-- | manifest | 27 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/pager.c | 8 | ||||
-rw-r--r-- | src/pager.h | 1 | ||||
-rw-r--r-- | src/sqlite.h.in | 10 | ||||
-rw-r--r-- | src/wal.c | 6 | ||||
-rw-r--r-- | src/wal.h | 4 |
8 files changed, 43 insertions, 18 deletions
@@ -1,5 +1,5 @@ -C When\sthe\s[https://www.sqlite.org/queryplanner.html#partialsort|block\ssorting\soptimization]\nis\sused\sin\sa\sscalar\ssubquery,\sbe\ssure\sto\sexit\sthe\sloop\sas\ssoon\sas\sthe\sfirst\nvalid\soutput\srow\sis\sreceived.\s\sFix\sfor\sticket\s[cb3aa0641d9a4]. -D 2016-01-13T17:59:28.834 +C Add\sthe\sSQLITE_FCNTL_JOURNAL_POINTER\sfile\scontrol. +D 2016-01-13T18:21:19.640 F Makefile.in 7c8cc4c2f0179efc6fa9492141d1fb65f4807054 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc e45d8b9b56dfa3f2cd860b2c28bd9d304513b042 @@ -298,7 +298,7 @@ F src/insert.c 6b45cc86967da11aa024d034745f93f66d53f650 F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/loadext.c 84996d7d70a605597d79c1f1d7b2012a5fd34f2b -F src/main.c b9641a4f650230bfc5dbb0bebf7b33ff4d27586a +F src/main.c 6d589f27980c4aec014ae9a081d611e7e5ebc115 F src/malloc.c 8f787669e79de26efc42272b5797bc00fff527c6 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b @@ -320,8 +320,8 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c 0ca6d8710366fbb01a275160f018334cd347cbda F src/os_win.c 386fba30419e8458b13209781c2af5590eab2811 F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca -F src/pager.c 58d2593612acb6b542de6715b4af397ea1fa0a35 -F src/pager.h bf25005b4656cd805af43487c3139fca9678d0cc +F src/pager.c 5dda328a9a5e9405b6971d62d0d5e3ea85c6195a +F src/pager.h 1c2a49143dfba9e69cc8159ef019f472ed8d260b F src/parse.y 23737e649c26ce327603799e57f5c2ff50e5e6ba F src/pcache.c 73895411fa6b7bd6f0091212feabbe833b358d23 F src/pcache.h 1ff11adce609ba7de139b6abfabaf9a2bac947b5 @@ -335,7 +335,7 @@ F src/resolve.c a83b41104e6ff69855d03cd0aaa09e93927ec39f F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c 47cd4189c47d937478dae4fc8ec4bceb4ecebf11 F src/shell.c ed71dc7679e6f087a3f1ea3f9dae4b0fae7209c3 -F src/sqlite.h.in 7d87d71b9a4689c51fa092f48f16590ff71558e3 +F src/sqlite.h.in 214476a62012e578f42133a9a3b4f97a9aa421a3 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d F src/sqliteInt.h f97614d43833bae0ed6c51ac8e550f0099a1d0ba @@ -409,8 +409,8 @@ F src/vdbesort.c a7ec02da4494c59dfd071126dd3726be5a11459d F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0 F src/vtab.c 2a8b44aa372c33f6154208e7a7f6c44254549806 F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb -F src/wal.c 974928c988681c5157202c79dd9f26afaa7b5086 -F src/wal.h 907943dfdef10b583e81906679a347e0ec6f1b1b +F src/wal.c 407f6f3929aeeb360f53a9279342940fe79823e1 +F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba F src/where.c c6d3d2f6af57d574a7365ee2b225a5024f2a6bec F src/whereInt.h 78b6b4de94db84aecbdc07fe3e38f648eb391e9a @@ -1406,11 +1406,8 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P fd0a50f0797d154fefff724624f00548b5320566 -Q +cdbb0947f9ce18d6d7e29ffab5ea6a2ee5365fbb -R 2d754bf0dc48cb48804e183af36b6602 -T *branch * branch-3.10 -T *sym-branch-3.10 * -T -sym-trunk * +P 8b4f5080621a8c23d9d32bf578bb83edc43de5c3 +Q +ad3daa5427672d2d236939ad3285b765f4601801 +R bb8c7c75156d0e9f49bd7bf8fc0998eb U drh -Z 6f8b5d3bc045113db8218e754cbb7983 +Z 4ce94583cf02eefad940c4cc50a9972d diff --git a/manifest.uuid b/manifest.uuid index aa9ed0c4f..cd12b7d10 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8b4f5080621a8c23d9d32bf578bb83edc43de5c3
\ No newline at end of file +ea9ce228e8c0a2a366b252bff1088bb061d4ec6f
\ No newline at end of file diff --git a/src/main.c b/src/main.c index 8b75e7150..2998f54c7 100644 --- a/src/main.c +++ b/src/main.c @@ -3424,6 +3424,9 @@ int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ }else if( op==SQLITE_FCNTL_VFS_POINTER ){ *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager); rc = SQLITE_OK; + }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){ + *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager); + rc = SQLITE_OK; }else if( fd->pMethods ){ rc = sqlite3OsFileControl(fd, op, pArg); }else{ diff --git a/src/pager.c b/src/pager.c index 2c8dceb75..8f49e656e 100644 --- a/src/pager.c +++ b/src/pager.c @@ -6693,6 +6693,14 @@ sqlite3_file *sqlite3PagerFile(Pager *pPager){ } /* +** Return the file handle for the journal file (if it exists). +** This will be either the rollback journal or the WAL file. +*/ +sqlite3_file *sqlite3PagerJrnlFile(Pager *pPager){ + return pPager->pWal ? sqlite3WalFile(pPager->pWal) : pPager->jfd; +} + +/* ** Return the full pathname of the journal file. */ const char *sqlite3PagerJournalname(Pager *pPager){ diff --git a/src/pager.h b/src/pager.h index ba4eec438..3552a876e 100644 --- a/src/pager.h +++ b/src/pager.h @@ -188,6 +188,7 @@ int sqlite3PagerMemUsed(Pager*); const char *sqlite3PagerFilename(Pager*, int); sqlite3_vfs *sqlite3PagerVfs(Pager*); sqlite3_file *sqlite3PagerFile(Pager*); +sqlite3_file *sqlite3PagerJrnlFile(Pager*); const char *sqlite3PagerJournalname(Pager*); int sqlite3PagerNosync(Pager*); void *sqlite3PagerTempSpace(Pager*); diff --git a/src/sqlite.h.in b/src/sqlite.h.in index be58c7cd1..59b30cdd3 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -794,8 +794,13 @@ struct sqlite3_io_methods { ** <li>[[SQLITE_FCNTL_FILE_POINTER]] ** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer ** to the [sqlite3_file] object associated with a particular database -** connection. See the [sqlite3_file_control()] documentation for -** additional information. +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +** <li>[[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. ** ** <li>[[SQLITE_FCNTL_SYNC_OMITTED]] ** No longer in use. @@ -1010,6 +1015,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_ZIPVFS 25 #define SQLITE_FCNTL_RBU 26 #define SQLITE_FCNTL_VFS_POINTER 27 +#define SQLITE_FCNTL_JOURNAL_POINTER 28 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -3310,4 +3310,10 @@ int sqlite3WalFramesize(Wal *pWal){ } #endif +/* Return the sqlite3_file object for the WAL file +*/ +sqlite3_file *sqlite3WalFile(Wal *pWal){ + return pWal->pWalFd; +} + #endif /* #ifndef SQLITE_OMIT_WAL */ @@ -44,6 +44,7 @@ # define sqlite3WalHeapMemory(z) 0 # define sqlite3WalFramesize(z) 0 # define sqlite3WalFindFrame(x,y,z) 0 +# define sqlite3WalFile(x) 0 #else #define WAL_SAVEPOINT_NDATA 4 @@ -138,5 +139,8 @@ void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot); int sqlite3WalFramesize(Wal *pWal); #endif +/* Return the sqlite3_file object for the WAL file */ +sqlite3_file *sqlite3WalFile(Wal *pWal); + #endif /* ifndef SQLITE_OMIT_WAL */ #endif /* _WAL_H_ */ |