Commit Graph

16 Commits

Author SHA1 Message Date
dan edace5d4f1 Require that the database handle be in autocommit mode for
sqlite3_snapshot_get() to succeed. This is because it may open a read
transaction on the database file.

FossilOrigin-Name: 83b658dad091211ade3594d1e8d00ce525882506
2016-11-18 18:43:39 +00:00
dan 25accbca72 Enhance existing snapshot tests to serialize/deserialize snapshots. No new
tests.

FossilOrigin-Name: 16b9bf92741e4c62874cffd7c6a61763c5054c7a
2016-11-18 14:38:41 +00:00
drh 3791c9c288 Fixes to requirements marks. No changes to code.
FossilOrigin-Name: 79ecd0ef20c12198e950a730871444a980a0f1b2
2016-05-09 23:11:47 +00:00
dan 745be369c7 Update the documentation for sqlite3_snapshot_cmp() to make the circumstances under which the comparison is valid clearer. Add tests for the same.
FossilOrigin-Name: 8fc834741bf6c8a832a180795c3d6f5c3dcfcd62
2016-04-12 15:14:25 +00:00
dan ad2d5baf1f Add the sqlite3_snapshot_cmp() API.
FossilOrigin-Name: c698a21af740ca1019c3a771fb83e569cd6bf23e
2016-04-11 19:59:52 +00:00
dan cc47eac005 Fix some test scripts so that they work with various permutations.
FossilOrigin-Name: f4d234b5013bf93b6eac7f8be6d4c074cf9f5293
2016-03-24 15:09:14 +00:00
drh d892ac97bb Enhance documentation of sqlite3_snapshot_open() to explain that the database
connection must have participated in at least one read operation prior to
the beginning of the transaction for which the snapshot is to be opened.
Add test cases for this fact.

FossilOrigin-Name: 33dd671cb9c17f08dbc61aed91e80eaeb84bfaf5
2016-02-27 14:00:07 +00:00
drh a23bc8a345 From test scripts, remove stray "breakpoint" commands and blank lines
at the ends of files.

FossilOrigin-Name: a6b35273239669189f33402144f58328b133d182
2016-02-05 16:46:09 +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
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
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
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
dan 818b11aebb Add tests for snapshot_get(), _open() and _free().
FossilOrigin-Name: 502cc6f353358946080d9bcd335aed526825b88a
2015-12-07 14:33:07 +00:00