Commit Graph

18260 Commits

Author SHA1 Message Date
mistachkin 9f4aad446b Further corrections to read-only SHM file handling on Win32.
FossilOrigin-Name: 43c311701bdf1202918cd46fa6133a11458e0ef8ddb09e46290a231083f395ce
2017-11-09 18:53:51 +00:00
mistachkin a515065649 Corrections to Win32 lock detection for SHM files.
FossilOrigin-Name: 3a91be975daee65c3e1199855613066015d5df8ad44ababdef31d1c698b5e746
2017-11-09 18:21:51 +00:00
mistachkin 8a6fa5d41c Corrections to the Win32 porting changes on this branch.
FossilOrigin-Name: 0b26a5a26d700e20eea5ebbd620af0af6f2d61c652cfca5b8563267588cb2be6
2017-11-09 17:29:18 +00:00
mistachkin 4a9ff91852 Make it possible to use OSTRACE for multi-process testing.
FossilOrigin-Name: 0a7d416c4c43632725dc89cda8667cd9726b5152ee4692e4d0c9e2031e60cfb4
2017-11-09 17:29:04 +00:00
mistachkin 4ff8431fd1 Initial work on porting the changes on this branch to Win32.
FossilOrigin-Name: 3738bfd0c0eadb10eea58954af5052cb6ce164059f3aacfe65d7da6a400c63c7
2017-11-09 16:30:55 +00:00
drh 9214c1efe8 Extra comments on the sqlite3OsShmMap() call in walBeginUnlocked(). No
changes to code.

FossilOrigin-Name: 033ee92bf4d5dc57f5cb8fd02d1154ae06f2d3261d214e7191a82c70c8ffebf7
2017-11-08 19:26:27 +00:00
drh 7316960cec Turns out that SQLITE_READONLY_CANTLOCK is an historical name that must
be preserved.  So make a new SQLITE_READLOCK_CANTINIT name instead.

FossilOrigin-Name: 04974a8b5c0e6748216226006ca9125529c8bb2a7a9df4641217eb1413426a14
2017-11-08 17:51:10 +00:00
drh 7e45e3a5d7 Change the name of SQLITE_READONLY_CANTLOCK to SQLITE_READONLY_CANTINIT.
FossilOrigin-Name: 6d7f94faa7e6de62f82bc6cac019508a9c1ffd6fa1d14f52fa93e9c06afdd32f
2017-11-08 17:32:12 +00:00
dan 6c9d8f640b Update an assert in wal.c.
FossilOrigin-Name: 94527b897bac66d100ca92161f18b6f0e0768dd77ebcb06e3fb106f0e0e380ee
2017-11-07 21:25:15 +00:00
dan 08ecefc5b1 Handle the race condition that may occur if another process connects and then
checkpoints and truncates the wal file while a readonly-shm client is building
its heap-memory wal-index.

FossilOrigin-Name: 5a6703fc3f2174b3e9a624c7272ae013b73c42d6c97ffa62b58553efdb54e3bc
2017-11-07 21:15:07 +00:00
dan f12ba66cf8 On unix, if the *-shm file cannot be opened for read/write access, open it
read-only and proceed as if the readonly_shm=1 URI option were specified.

FossilOrigin-Name: ba718754fa5ab8596cb84b751051de98afa2706fe6c5df39ad6d925d790719ee
2017-11-07 15:43:52 +00:00
dan d24c5b1c98 Add fault-injection tests for the code on this branch.
FossilOrigin-Name: a7d949fb735f60c19e7257a1a7a12568a9c15be9cd980c018f3a0d6bf112c339
2017-11-07 09:08:43 +00:00
dan ab54838452 Add further test cases for the new code on this branch. And a couple of fixes.
FossilOrigin-Name: 71af9acb227a91d9ad8798c9d0b12d6967e863d050f5cb1fddb45f25ee1f47db
2017-11-06 19:49:34 +00:00
dan cbd3321978 Add further tests for the code added on this branch.
FossilOrigin-Name: a6716fcde38b28b8a03b40f9d16f78a57ec20f60cf391ff553692641cb7f0d3f
2017-11-04 21:06:35 +00:00
dan 11caf4f4b7 In cases where a readonly_shm client cannot take the DMS lock on the *-shm
file, have it parse the wal file and create a wal-index to access it in heap
memory.

FossilOrigin-Name: 18b268433d739486eac1b04947bd418655e4bc56e8dc63ffa558aa4552a32e30
2017-11-04 18:10:03 +00:00
dan 44c8a97e01 Fix test cases in wal2.test broken by the locking change in the previous
commit.

FossilOrigin-Name: f569c3517234881f9425075aab65a32ffd0deb8e793f421a241d8cca881da33f
2017-11-02 18:57:46 +00:00
dan dea5ce36f5 Avoid locking shm-lock WAL_READ_LOCK(0) during recovery. Doing this allows
recovery to proceed while a readonly_shm connection in unlocked mode has an
ongoing read transaction.

FossilOrigin-Name: 5190d84a296b7cf716ef43bf7b6d4d351ef1a4d650de37dc01a5ab333da7c05d
2017-11-02 11:12:03 +00:00
dan 92c02da33e If a readonly_shm connection cannot map the *-shm file because no other
process is holding the DMS lock, have it read from the database file only,
ignoring any content in the wal file.

FossilOrigin-Name: ce5d13c2de69b73378637d4f7e109714f7cd17bf1d1ad995e0be442d517ed1b3
2017-11-01 20:59:28 +00:00
dan 514c4b7e5d Merge latest trunk changes into this branch.
FossilOrigin-Name: 985bfc992950625a45a7521bf4c8438cd0170de974dff976968be158ac5922a9
2017-11-01 07:06:41 +00:00
dan 176b2a916b Fix a race condition in os_unix.c that might allow a client to use a *-shm
file corrupted by a power failure if another client fails between locking the
*-shm file and truncating it to zero bytes.

FossilOrigin-Name: d655bfabd110999b6808073c334869c5b6a8334df56811df883e47e56d3f1cbb
2017-11-01 06:59:19 +00:00
drh d59fde3da5 Update the built procedures for the sqlite3_analyzer utility to allow it
to be linked with an external sqlite3.o library.  Automatically detect a
missing dbstat extension and report the compile-time error.

FossilOrigin-Name: bb39744f4b2b25c10d293e85db7579e2a99c639fdab45e93d1de75952b68b2de
2017-10-31 14:56:44 +00:00
drh 6f09910779 Fix redundancies in the makefiles that resulted from moving shell.c over
to shell.c.in.

FossilOrigin-Name: bf09fa683ea42b7552bd2f29ab5371bd175f0055cf9a453e6f8c6f4408cd168f
2017-10-31 12:20:43 +00:00
drh 183f0aa6c4 Fix a minor comment typo. No changes to code.
FossilOrigin-Name: 5f79e6d9c3d44b0cc7cf805429006f7b29a69e8d863b58472172a56b29a7bb4e
2017-10-31 12:06:29 +00:00
drh 9d9c41e25e Remove unnecessary NEVER() and ALWAYS() conditionals.
FossilOrigin-Name: 1c80c75d4be2f3d44fb18bb4c07eccac2aba79b688215a741317dfc47dc7c2ce
2017-10-31 03:40:15 +00:00
drh 666fb6914d Add the showshm utility program for printing out the shm header in a
human-readable format.

FossilOrigin-Name: f6304fd142c998aba44f02c6018223af2630671b4791d750b70a59ab1adb8d6d
2017-10-30 23:25:06 +00:00
drh 07dae088b9 Clarify some comments describing the WAL index file. No changes to code.
FossilOrigin-Name: 3be3aad9ecbe33060cfa9c6059b9206ed221d1fd72a69c355a9387f9f4e075e7
2017-10-30 20:44:36 +00:00
drh eba21f9eb2 Improve the performance of the LIKE operator by using strcspn() to aid
wildcard matching.

FossilOrigin-Name: 37284d4e8f501a37c582aa899419a3dfe0932e2a8e2ef2fdf59addd1d3cdacb4
2017-10-30 18:49:11 +00:00
drh b68db3187b Increase the version number for the next release - which is still months
away but there have been significant query planner enhancements since the
previous release.

FossilOrigin-Name: 457eedfac0ff652912c4cfb89682acb3d2e372ef00745139adf8492a0b61fa09
2017-10-28 20:54:51 +00:00
drh fca23557fe Reactivate query flattening when the result set of the outer query has
no function calls or subqueries.  This is a partial reversal of 
check-in [c9104b59].  Co-routines are still preferred if the outer
query has a complex result set, but for simple results sets, query flattening
is used.  Check-in [4464f40ccd7] is completely backed
out due to this change.

FossilOrigin-Name: d17ef7d153058f7332b3fec421ade42c67e26b06f36fc1629e6799537a5afc5f
2017-10-28 20:51:54 +00:00
drh 6d6e76f75f Add test cases from OSSFuzz to prevent a regression in co-routine
processing.

FossilOrigin-Name: 689743d8e3fa81e65dcb067bbf61bab09210b3b39586c865c00d9f1d6692daf2
2017-10-28 12:20:09 +00:00
drh 0503f2acfa Fix a Pager ref-count leak in the sqlite_dbpage virtual table.
FossilOrigin-Name: c063bb04da77d6847e4e254b6bb939c860e781382e34ddff8e0454d9db7552e2
2017-10-27 18:24:11 +00:00
mistachkin b4bab90b31 Handle the Ctrl-C event for the shell on Win32.
FossilOrigin-Name: c8aaf37117ed4a23bbd15dc481788735efcb77bff98be423eca3521c0a9270de
2017-10-27 17:09:44 +00:00
drh 6e61c5f895 Additional test case demonstrating the ability to access structure elements
using quoted names in the JSON1 extension.

FossilOrigin-Name: 8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f
2017-10-27 12:27:25 +00:00
drh 47d9f83982 Enhance the min/max optimization so that it works with indexes on
expressions.

FossilOrigin-Name: 6caec9082b3ad6d3f89f6291084a8f5c80f296630e2e94bc764389ac1a47a833
2017-10-26 20:04:28 +00:00
drh 7ea11066b6 Extra ".selecttrace" output following aggregate analysis. No changes to
production builds.

FossilOrigin-Name: 6fbf74ab3189b9cb20cf7cc8db0226eb935a8eab477cc83b8390492fcf2f1f76
2017-10-26 18:43:19 +00:00
dan ab04eff809 Fix an error in the previous commit on this branch.
FossilOrigin-Name: f71dfee06ce1e0eee760cfca19482bdec7729d6c7d28f10f4cfd21e1f92a04b0
2017-10-26 17:34:50 +00:00
dan 9181ae990a Instead of extra locks, use F_GETLK to ensure that readonly_shm clients cannot
connect to a wal-mode database if there are no writers.

FossilOrigin-Name: 5492f457dc7cc5c416de4b4e61e84bd2f10b4e6ce54011b7a60feb47f629c923
2017-10-26 17:05:22 +00:00
dan 4544e28425 Fix a bug causing "make amalgmation-autoconf" to create an invalid package if
either the current or parent directory contains a file named install.sh or
install-sh.

FossilOrigin-Name: e1faa7859451ee969f0ce02d2d4e4c54d0e2e018b37b8faf690e6b87593cce7d
2017-10-26 15:21:56 +00:00
drh b5039fb7d3 Use extra locks to prevent a readonly_shm=1 process from connecting to a
WAL-mode database if there are no writers.

FossilOrigin-Name: 35d979082b4ab36d6a8975f8f15a50e69f46b72a173164d2b353377b9f758bd8
2017-10-25 23:28:13 +00:00
drh 3cd8aaa748 Fix the sqlite3_dbpage virtual table so that it can read and write from
any attached database.

FossilOrigin-Name: d4f893e1ae53a0445939ea2920af87d21dd36270494381028b2eaebe5c188f18
2017-10-25 19:18:33 +00:00
dan 7e2b38c53b Add tests cases and fix minor issues in the rtreecheck() function.
FossilOrigin-Name: d6130cd226c0ca95e02f0cbabfdc27071acdcf83e0d0cb0eaa47d992479ed9a1
2017-10-25 18:17:24 +00:00
mistachkin 2c0d084400 Add SQL scalar function rtreecheck() to the rtree module. For running checks to ensure the shadow tables used by an rtree virtual table are internally consistent.
FossilOrigin-Name: 7d26498063bbc4525976ace698fafcf161d939908f4ffb36d7a4df8fb1bce1fb
2017-10-25 18:01:58 +00:00
mistachkin 8c66e5b73e Fix compilation issue (C99-ism) seen with MSVC.
FossilOrigin-Name: 61870b42b033189509b244c76d28932f7a447b887ffe04a3c81461148e54cfb5
2017-10-25 18:00:58 +00:00
dan 1917e92fdb Add SQL scalar function rtreecheck() to the rtree module. For running checks
to ensure the shadow tables used by an rtree virtual table are internally
consistent.

FossilOrigin-Name: dde0bb3eab1316c3247b1755594527ca70955aab4ad4907190731f7ec092b327
2017-10-25 16:38:34 +00:00
drh b5d013edd1 Do not reference the ioctl() system call in the unix backend unless it
is actually needed by the Batch Atomic Write extension.  This should allow
the build to work on VxWorks.

FossilOrigin-Name: adfa7ed2de3e833fff65935455e71236a59602aaf7b97ece667ab300dca9f673
2017-10-25 16:14:12 +00:00
drh 98d529b541 Add the sqlite_btreeinfo eponymous-only table for introspecting the schema
and estimating the sizes of various btrees.

FossilOrigin-Name: 1e30f4772db1e1086096f72d32e87c552923be8b264aa13cf822fae754eb083d
2017-10-25 01:34:24 +00:00
mistachkin ea78f64dc1 Force the autoconf makefile for MSVC to always use the 'find.exe' included with Windows.
FossilOrigin-Name: b76bffd332585e8412a0a994ae6dee79a83213d8b709d7f858c5c05678ab0887
2017-10-24 21:17:12 +00:00
drh e2f3b671ed Merge all of the fixes from the 3.21.0 release.
FossilOrigin-Name: 5ab662b443df17c5ebdadc0bdac2f447c5c7e86f7a32a6943bb4ac8605879441
2017-10-24 19:05:26 +00:00
drh 39f2b329f6 Version 3.21.0
FossilOrigin-Name: 1a584e499906b5c87ec7d43d4abce641fdf017c42125b083109bc77c4de48827
2017-10-24 18:55:49 +00:00
dan 952523f618 Fix a problem in the incr-blob code causing a new cursor to be opened for
every sqlite3_blob_reopen() call.

FossilOrigin-Name: 41ef34a1f0650c50cacb203665cd9d57db53a49c979bf0d5a78937517f763a2c
2017-10-24 17:28:25 +00:00