Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | 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. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
33dd671cb9c17f08dbc61aed91e80eae |
User & Date: | drh 2016-02-27 14:00:07.182 |
Context
2016-02-27
| ||
14:04 | Fix a requirement mark to conform to a typo fix in the documentation. (check-in: d1392c6279 user: drh tags: trunk) | |
14:00 | 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. (check-in: 33dd671cb9 user: drh tags: trunk) | |
00:21 | Add 'Replace.exe' to the MSVC clean target. (check-in: c2277fab12 user: mistachkin tags: trunk) | |
Changes
Changes to src/sqlite.h.in.
︙ | ︙ | |||
7964 7965 7966 7967 7968 7969 7970 | ** ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK on success ** or an appropriate [error code] if it fails. ** ** ^In order to succeed, a call to [sqlite3_snapshot_open(D,S,P)] must be ** the first operation, apart from other sqlite3_snapshot_open() calls, ** following the [BEGIN] that starts a new read transaction. ** ^A [snapshot] will fail to open if it has been overwritten by a | | > > > > | 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 | ** ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK on success ** or an appropriate [error code] if it fails. ** ** ^In order to succeed, a call to [sqlite3_snapshot_open(D,S,P)] must be ** the first operation, apart from other sqlite3_snapshot_open() calls, ** following the [BEGIN] that starts a new read transaction. ** ^A [snapshot] will fail to open if it has been overwritten by a ** [checkpoint]. ** ^A [snapshot] will fail to open if the database connection D has not ** previously completed at least one read operation against the database ** file. (Hint: Run "[PRAGMA application_id]" against a newly opened ** database connection in order to make it ready to use snapshots.) ** ** The [sqlite3_snapshot_open()] interface is only available when the ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. */ SQLITE_EXPERIMENTAL int sqlite3_snapshot_open( sqlite3 *db, const char *zSchema, |
︙ | ︙ |
Changes to test/snapshot.test.
︙ | ︙ | |||
330 331 332 333 334 335 336 337 338 339 | } {} do_test 6.3 { sqlite3 db2 test.db db2 eval "PRAGMA user_version ; BEGIN" sqlite3_snapshot_open db2 main $::snapshot db2 eval { SELECT * FROM x1 } } {z zz zzz} sqlite3_snapshot_free $snapshot finish_test | > > > > > > > > > > > > > > > > > > > > | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | } {} do_test 6.3 { sqlite3 db2 test.db db2 eval "PRAGMA user_version ; BEGIN" sqlite3_snapshot_open db2 main $::snapshot db2 eval { SELECT * FROM x1 } } {z zz zzz} do_test 6.4 { db2 close sqlite3 db2 test.db db2 eval "PRAGMA application_id" db2 eval "BEGIN" sqlite3_snapshot_open db2 main $::snapshot db2 eval { SELECT * FROM x1 } } {z zz zzz} # EVIDENCE-OF: R-55491-50411 A snapshot will fail to open if the # database connection D has not previously completed at least one read # operation against the database file. # do_test 6.5 { db2 close sqlite3 db2 test.db db2 eval "BEGIN" list [catch {sqlite3_snapshot_open db2 main $::snapshot} msg] $msg } {1 SQLITE_ERROR} sqlite3_snapshot_free $snapshot finish_test |