15014 Commits

Author SHA1 Message Date
drh
cc99e24491 Add the experimental snapshot interface. Because it is experimental, it is
subject to change or removal at a later date.

FossilOrigin-Name: 9b124a5a310aec0145495c9980bc0c1308fcca02
2015-12-11 12:44:52 +00:00
drh
9b810ae8f3 Fix a memory allocation bug introduced last week by check-in
[a9e819082ba].  The bug only appears on systems where the size of a structure
is not always a multiple of 8 - which in practice means only on 32-bit 
windows systems.

FossilOrigin-Name: 96d3e99ffe59b5280b8b7fc269c94a72e15c345b
2015-12-11 04:11:17 +00:00
drh
5a6e89c644 Mention that the snapshot interfaces are only available if SQLite is compiled
with SQLITE_ENABLE_SNAPSHOT.

FossilOrigin-Name: 843c15a552657ca43ff200edb7da7566752d7941
2015-12-11 03:27:36 +00:00
drh
68d28ea4f0 Disable the snapshot test scripts if not compiled with SQLITE_ENABLE_SNAPSHOT.
FossilOrigin-Name: 5fd008f0433833e4341d526dcc2387570ffe1fea
2015-12-11 03:20:39 +00:00
drh
c49e960d41 Fix a variable type mismatch problem in the snapshot logic.
FossilOrigin-Name: 93fb8010e4999b6b832d63a7c5a152f65d4415a3
2015-12-11 03:16:54 +00:00
drh
71b62fa456 Fix a bad assert related to snapshots.
FossilOrigin-Name: 767ee30efa5dd469e3a51d4e44cbe473061819b9
2015-12-11 01:22:22 +00:00
drh
e230a8994e Snapshot documentation updates. Comment changes only - no changes to code.
FossilOrigin-Name: ef51a398a04963508389ffe2f9d8359c1ec48261
2015-12-10 22:48:22 +00:00
dan
7116dc60dc Update the sqlite3_snapshot_get() API so that if the caller does not have an open read transaction on the named database, one is automatically opened.
FossilOrigin-Name: b9c90f10297d8516a661449e8af898e682c930aa
2015-12-10 20:03:08 +00:00
dan
745c14eb15 Add tests to snapshot.test.
FossilOrigin-Name: f3b743623a4501833478c8a86c0922931955aeb6
2015-12-10 19:44:34 +00:00
dan
a7aeb39836 Return SQLITE_BUSY (not SQLITE_BUSY_SNAPSHOT) if sqlite3_snapshot_open() fails to obtain the shared checkpointer lock.
FossilOrigin-Name: 5343060bcc6c99029f731f8020d2cba3f405f207
2015-12-10 19:11:34 +00:00
dan
7d15979420 Add tests to ensure that an sqlite3_snapshot_open() client cannot be tricked into reading a corrupt snapshot even if another process fails mid-checkpoint.
FossilOrigin-Name: b908048b6cfa1ee2fe1f7a17bae475ddd9d0376c
2015-12-10 18:06:21 +00:00
drh
34628b4b4f Move pointer range comparisons into a macro, where they can be dealt with in a more portable way.
FossilOrigin-Name: 05bc4f920ce23da48d1da6cd36a956fd6fd7c862
2015-12-10 17:59:50 +00:00
dan
3bf83ccd70 Have sqlite3_snapshot_open() avoid a race condition by taking a shared CHECKPOINTER lock while checking pInfo->nBackfillAttempted.
FossilOrigin-Name: 8084eae0bc4f6513b1147fb890a6b2813f1c0a09
2015-12-10 15:45:15 +00:00
drh
ac536e613a Move pointer range comparisons into a macro, where they can be dealt with
in a more portable way.

FossilOrigin-Name: ad3124c834b080aaaf24934d6f08b3601ac3ae53
2015-12-10 15:09:17 +00:00
mistachkin
c9fb38e7ad Fix spacing typo in comment. No changes to code.
FossilOrigin-Name: 3a18526fc2253658dad84c5e600481c8a62efe40
2015-12-10 03:16:47 +00:00
drh
998147ec38 Add the nBackfillAttempted field in formerly unused space in WalCkptInfo and
use that field to close the race condition on opening a snapshot.

FossilOrigin-Name: cb68e9d0738fc7db7316947b4d2aab91aae819f2
2015-12-10 02:15:03 +00:00
dan
65127cd57d Update sqlite3_snapshot_open() to reduce the chances of reading a corrupt snapshot created by a checkpointer process exiting unexpectedly.
FossilOrigin-Name: 7315f7cbf4179aadda0f1a0baa1526a9b9f9729f
2015-12-09 20:05:27 +00:00
drh
5ef09bf918 Further simplifications to the VDBE code generation logic that flow out
of the previous check-in.

FossilOrigin-Name: 6a5dfe85b519b920ce8c842057767a8793d92236
2015-12-09 17:23:12 +00:00
drh
8c8dddc904 Simplification of the DROP TRIGGER logic using sqlite3NestedParse() instead
of hand-coded VDBE code.  This is a manual cherry-pick of the key change from
check-in [c80bbf14b365d].

FossilOrigin-Name: 8021b4c8139ba56d6b1e2e26aeec4f9bf77f37c9
2015-12-09 16:26:38 +00:00
drh
ee3b7a2767 Merge unrelated fixes from trunk.
FossilOrigin-Name: 362615b4df94358d0264b0991c3090a0878f054c
2015-12-09 16:04:06 +00:00
drh
72ea29d7ae Changes to avoid undefined behavior in memset() and memcpy() and in the
comparisons of pointers from different allocations.  All problems are found
by analysis tools - none have been seen in the wild.

FossilOrigin-Name: 901d0b8f3b72e96ffa8e9436993a12980f5ebd51
2015-12-08 16:58:45 +00:00
drh
ea06a271a4 Avoid doing comparisons with pointers that might have been previously been
passed to realloc() and/or free().

FossilOrigin-Name: f20396adb2cff12a17a3fc90b36241ae3fdfd62a
2015-12-08 16:08:10 +00:00
drh
92a8277149 Add a test case of the form "WHERE a<2 OR a<3" using PRAGMA count_changes.
This test case was failing before the 3.9.0 release.

FossilOrigin-Name: 177862c1d50ba899d890fbc35f35e7423bc6aed5
2015-12-08 04:18:33 +00:00
mistachkin
a295d1521a Update the TclKit download URL.
FossilOrigin-Name: 07e5199c6f868cc02a0b708865254056c4f3daf3
2015-12-08 00:47:32 +00:00
mistachkin
855ed4a3b4 Update MSVC batch build tool to the latest Windows 10 SDK version.
FossilOrigin-Name: 2ad5017190334b7dd53294a30c3b3232e0c35869
2015-12-07 23:31:59 +00:00
drh
df12f1c69b Add the ".changes ON|OFF" command to the sqlite3.exe command-line shell, for
testing and verifying the sqlite3_changes() and
sqlite3_total_changes() interfaces.

FossilOrigin-Name: 9bbe1afc1521b111a0a93803b41ff04e0ee55630
2015-12-07 21:46:19 +00:00
drh
dc27851e21 Fix the openDirectory() routine in the unix VFS so that it works for databases
located in the root of the filesystem and for database files that have no
pathname at all.

FossilOrigin-Name: e7ae120d04cffafd9bc2b4ecd68571c17e05ed72
2015-12-07 18:18:33 +00:00
drh
d797a9b5cb Changes to avoid obscure, theoretical undefined behavior. This is preventative
measures only - no actual problems observed on tested compilers.

FossilOrigin-Name: a9e819082ba19e72db03bba37edfb7702ff489a5
2015-12-07 16:43:44 +00:00
dan
818b11aebb Add tests for snapshot_get(), _open() and _free().
FossilOrigin-Name: 502cc6f353358946080d9bcd335aed526825b88a
2015-12-07 14:33:07 +00:00
dan
fc1acf33b8 Add untested implementations of experimental APIs sqlite3_snapshot_get(), _open() and _free().
FossilOrigin-Name: 0715eb00aa8891400cd50a15509d3d7b13789626
2015-12-05 20:51:54 +00:00
drh
28a6a1168b Remove the dependence on "exec ls -U" from the vtabH.test module, as the -U
option to "ls" is not universally available.

FossilOrigin-Name: 4ecbc75b465533cf80e166a9d0879b9afd3fe2be
2015-12-04 13:44:07 +00:00
drh
2f5bfd959a Prevent a segfault on Solaris in the test_fs.c due to differences in the
definition of the dirent object.

FossilOrigin-Name: 042738ad3b769ad70fd7603f928d5b94a952267d
2015-12-04 03:27:45 +00:00
drh
15427279c8 Fix typos in requirements text and update requirements marks. No changes
to code.

FossilOrigin-Name: 8534a46c06601ad35b97caee442371f24c718d0f
2015-12-03 22:33:55 +00:00
drh
9802947fd8 Improved OOM recovery in the SELECT code generator logic.
FossilOrigin-Name: e6521a436d464a42b87a7d5ba5cc98235b92440a
2015-12-03 21:47:30 +00:00
drh
7a7f688979 Make the SQLITE_ENABLE_8_3_NAMES compile-time option available to
sqlite3_compileoption_used().

FossilOrigin-Name: 06338201f3f00151232e5c6a40edcdbea04d7553
2015-12-03 20:50:10 +00:00
drh
90e5dda217 Cleaner code and additional comments on the handling of 8+3 filenames when
trying to find the name of a database file based on its journal filename, 
in the unix VFS.

FossilOrigin-Name: 9e489a71f2aeb1f13f9ca6f106b9144d07ca25aa
2015-12-03 20:42:28 +00:00
drh
7be53fe441 Make the sqlite3_status64(), sqlite3_strlike(), and
sqlite3_db_cacheflush() APIs available to loadable extensions.

FossilOrigin-Name: a78e865607194718e2ef958879dbf549ac3c9970
2015-12-03 13:43:07 +00:00
dan
5fcc1ba4e7 Fix threadtest3 so that it builds using the autoconf build system.
FossilOrigin-Name: d96de532cc4a192cfebae900701dcee0a7d29273
2015-12-03 12:01:54 +00:00
dan
48c06f32ca Improve concurrency in test_multiplex.c. Add a switch to "threadtest3" allowing it to run using the multiplexor VFS.
FossilOrigin-Name: 9d2c62b04e3a9ac5d9adea2aac7ec3f3bc3e88bd
2015-12-03 11:51:18 +00:00
drh
c18ed977e8 A unix VFS change replaces fsync() with fstat() when using SQLITE_NO_SYNC, so
set PRAGMA synchronous=OFF in the sysfault-3 test to avoid erroneously causing
errors in xSync.

FossilOrigin-Name: 4f7f355021f9eb048fffc84e559bfb3fdb1e1e69
2015-12-03 01:48:32 +00:00
drh
f7ce4291a9 Remove unreachable branches from the decltype computation logic in the query
planner.

FossilOrigin-Name: 4f2bcff94c672312805be1400050a7026f93a9d7
2015-12-02 19:46:12 +00:00
dan
9a8941fc83 Have the sqlite3_column_decltype() API report the declared types for the left-most SELECT statement in a compound SELECT.
FossilOrigin-Name: 3e1d71fcaf57c0223ab9a7366c8607f8f66bb21c
2015-12-02 18:59:44 +00:00
drh
af19f173d3 Fix an incorrect, though harmless, assert() in the unix VFS.
FossilOrigin-Name: 4692ae84f93530e27d7c106a60236355e176b7fd
2015-12-02 17:40:13 +00:00
drh
ab37277367 Remove more (dead) SQLITE_FCNTL_WAL_BLOCK logic from wal.c - code that was
missed during the [e1d5320ca08933] check-in.

FossilOrigin-Name: 58c15c6af964563ac7ece8606d16730ccf9ee72b
2015-12-02 16:10:16 +00:00
drh
333e6ca9a5 Remove an unreachable branch from the unixMapfile() routine of the unix VFS.
FossilOrigin-Name: b50f67bc46e65fe4e51667d48b4add58706a9443
2015-12-02 15:44:39 +00:00
drh
f3b1ed0fc2 Minor simplifications to the unix VFS.
FossilOrigin-Name: 2f13c16b45685ec6850cbd9da79e8198bad6a491
2015-12-02 13:11:03 +00:00
drh
2c8fd12f42 Change the SQLITE_NO_SYNC compile-time option to call fstat() in place of
fsync() rather than being a total no-op.

FossilOrigin-Name: f64ea8a052af9790d5e6987cbd5e81d77da6f172
2015-12-02 02:33:36 +00:00
drh
adfa22e118 Fix a (harmless) off-by-one error in the unix VFS logic that fsync()s a
directory after deleting a file.

FossilOrigin-Name: 3d02711a709a7e708edb0ea8ca5d17b39dd307f6
2015-12-02 02:08:30 +00:00
drh
50358adfaa Simplification of the logic used to take the process-wide lock in the
unix-excl VFS.

FossilOrigin-Name: 73defd52bb0e3e5db763d3bfbeebc972b645867e
2015-12-02 01:04:33 +00:00
drh
dcfb9652fd Remove all traces of SQLITE_FCNTL_WAL_BLOCK from the unix VFS - that feature
had been disabled for a long time and never actually worked.

FossilOrigin-Name: e1d5320ca089336e26d200305b744b06ce883be4
2015-12-02 00:05:26 +00:00