Commit Graph

93 Commits

Author SHA1 Message Date
drh
3f975373ce Fix obsolete comments. No changes to code.
FossilOrigin-Name: ec39c99bea024ffce9b87bbf3d80087ff772f43f7fb7e238754c364f7db2a17b
2018-01-12 18:03:38 +00:00
dan
614efe2b4b Experimental change to include changes made to the sqlite_stat1 table in
changesets generated by the sessions module. sqlite_stat1 entries in such
changesets are ignored by legacy clients.

FossilOrigin-Name: bd46c4429693545eb16db85692fc591ac529796aa746f5f21df1ce4380619320
2018-01-12 16:44:29 +00:00
dan
07d0f15e93 Fix incompatibilities between the "sqldiff --changeset" command and the
sessions module. Specifically, allow sessions to process changesets containing
tables with zero operations on them and have sqldiff output the expected
output for tables with multi-column primary keys.

FossilOrigin-Name: 0bb23c48064cc64134697469f3f4d2d3610b9e6c7a0dc54a3c47a00bd6c2a860
2017-05-22 18:09:00 +00:00
dan
ff677b20fc Allow sqlite3session_apply() to apply changesets to tables that have been
extended using ALTER TABLE ADD COLUMN.

FossilOrigin-Name: b20ff81ff9c8af500ea96e0ba9d34524220a89f1
2017-02-04 17:33:30 +00:00
dan
895decf6b5 Avoid passing NULL pointers to memcmp() or memcpy(), even when the
"number-of-bytes" argument is passed 0.

FossilOrigin-Name: 56ff72ab44288296efc99a608f7edc4346366a50
2016-12-30 14:15:56 +00:00
drh
48cd59a57d Avoid left-shifts of signed integers.
FossilOrigin-Name: 0715ce164333e27671efbec8796f238df98cc287
2016-05-03 00:04:55 +00:00
dan
14faa061fd Fix an almost entirely harmless buffer overread in the sessions module.
FossilOrigin-Name: 89b0ee3351381f7bc666cb206f77a56f2e0d4a0e
2016-04-29 10:13:22 +00:00
mistachkin
02d436b1f6 A couple more compiler warning fixes.
FossilOrigin-Name: 929fa4c31e7c5b8c6cbb1412478ea91b15ad5529
2016-04-12 20:26:51 +00:00
mistachkin
74f598b677 Fix harmless compiler warnings in the 'session' module.
FossilOrigin-Name: a18a6ce2271865d04cd75a8a5baa63798b7393db
2016-04-12 19:20:22 +00:00
dan
5f5663dc23 Add further tests for the code on this branch. Fix a problem in OOM handling.
FossilOrigin-Name: 195f3340ee4d870420e4f58d44300bab5436b920
2016-03-31 10:50:26 +00:00
drh
c8be643733 Enhanced comments describing the sessions file format. No changes to code.
FossilOrigin-Name: 84dc41e2df1092e9724a535b670343181a9cd0dd
2016-03-31 02:44:56 +00:00
drh
7e0765a9ec Fix the return code in sessionRetryConstraints().
FossilOrigin-Name: ea917c14b940f95b20b91dae77567dc25a651ef6
2016-03-31 00:45:58 +00:00
dan
d915152677 Have the sqlite3session_apply() function and its streaming equivalent retry any operations that failed with SQLITE_CONSTRAINT after all other operations on the same table have been attempted. New code is largely untested.
FossilOrigin-Name: 1085911afb51744f32fe9db183b50e8e88bdd73e
2016-03-30 21:19:00 +00:00
drh
50d348b1e1 Harden sqlite3session_delete() against trying to delete a session that
is not currently on the session list.

FossilOrigin-Name: 6c2d34df76fb7823f307c11a1135ab30674421a9
2016-02-13 14:45:56 +00:00
dan
6c39e6a800 Changes to the sesssions module ensure that tables appear within changesets and patchsets in the same order that they were attached to the sessions object.
FossilOrigin-Name: 7695890230dc1e0c6db9b7aa509db2039c7f7239
2015-10-01 16:35:57 +00:00
dan
5898ad6954 Add the sqlite3changegroup_xxx() APIs to the sessions module. For combining multiple changesets or patchsets.
FossilOrigin-Name: 0c1a901cd60e557fc676b97625243163dfe9be9d
2015-06-11 17:26:10 +00:00
dan
6dc29e60c8 Modify the sessions module to ignore all operations on tables with no primary keys as documented.
FossilOrigin-Name: bdaf9575cd9ebb33dc5da4062a84bca79e7b0fec
2015-06-02 09:19:22 +00:00
drh
dbbd816059 Merge the Makefile.msc fix and the compiler warning fix from trunk. Also
fix another compiler warning in sqlite3session_diff().

FossilOrigin-Name: 7530e1bf557083ef91447a02f05b019dbe60fa70
2015-05-19 23:04:26 +00:00
drh
adf3bf5811 Merge recent trunk changes, include the R-Tree enhancement that allows
8-byte BLOB arguments to geometry functions, and the fix for the TEXT affinity
problem that could cause corrupt indexes.

FossilOrigin-Name: 0a0de8b72ca24f287f9c84766a14e12ea4564b59
2015-05-19 22:42:23 +00:00
dan
b9db909952 Modify the sqlite3session_diff() API so that tables with no PRIMARY KEYs are ignored. This matches the other sessions APIs. Also change sqlite3session_diff() so that it returns SQLITE_SCHEMA, instead of SQLITE_ERROR, if the tables being compared do not have compatible schemas.
FossilOrigin-Name: aada0ad08e3baa10d14d1f3393183110289e068e
2015-04-23 17:22:49 +00:00
dan
4cc923e3e3 Fix the error message returned by sqlite3session_diff() for tables with no PRIMARY KEY.
FossilOrigin-Name: 4d34a3d40da210bebb2a2e6dff094f9a39c92798
2015-04-23 15:03:14 +00:00
dan
dd009f839c Fix a performance problem in sqlite3session_diff().
FossilOrigin-Name: ea400eca314d81761fe5c0e329b906c045f0dfe4
2015-04-23 14:40:17 +00:00
dan
10dc553c13 Hold the database mutex for the duration of sqlite3session_diff().
FossilOrigin-Name: 6f33050115562833c43da3c99dd37aeb0bf966b6
2015-04-17 11:31:08 +00:00
drh
92f283c0d4 Fix a stray backslash character in a printf format string in
sessionDiffFindModified()

FossilOrigin-Name: abb192a1d79388d4717f459b91e34f9c035935f2
2015-04-16 13:52:03 +00:00
drh
df3c171881 Merge all recent trunk enhancements into the sessions branch.
FossilOrigin-Name: 5f14f34f072921e229bc20a5185c0cdb3f464c04
2015-04-12 01:33:37 +00:00
dan
58bd114a6f Merge the sessions-diff branch with this one.
FossilOrigin-Name: 805baa57e5d2e97dccddc08eb72f2564df4802e8
2015-04-11 17:09:36 +00:00
dan
730bb805a8 Updates to comments describing the changeset and patchset formats.
FossilOrigin-Name: 5342f721e878b52f207731ea57411f3669ae3f3f
2015-04-09 19:19:22 +00:00
dan
3cc89d9567 Fix problems in the sessions module causing it to produce spurious SQLITE_NOMEM errors when handling SQL text or blob values zero bytes in size.
FossilOrigin-Name: b9459d5980c6249a5c1bc5ea72cb4f3b1ba0e433
2015-04-08 16:43:31 +00:00
dan
cf8e91442d Add experimental API sqlite3session_diff().
FossilOrigin-Name: c4340b2ea2115ad97dcac036f9034e132ab789e5
2015-04-08 16:01:12 +00:00
dan
abae0c4f1d Fix a problem causing sqlite3changeset_concat() to fail to detect attempts to concatenate patchsets which changesets.
FossilOrigin-Name: 236704a9d1551a50a55bd6e0b6473191a7a7dd21
2014-10-15 20:02:21 +00:00
drh
f1a08ad88d Change the names of the stream interface APIs to be of the form
"_strm" instead of "_str".  In other words, added an "m" to the end, to
try to make it clear that we are talking about a "stream" and not a "string.

FossilOrigin-Name: 1f44bfdc237ee6304f4aa56e5c5d1c0d74fcc944
2014-09-27 20:45:48 +00:00
dan
f05ac11214 Fix a segfault in the sessions module that could follow an OOM.
FossilOrigin-Name: 09985fa6b60a0bf38e23bbccd4d8e1d1cbf66124
2014-09-27 18:18:32 +00:00
dan
e8fa8c9649 Fix a segfault in the streaming API functions triggered by a very long table name.
FossilOrigin-Name: d2642543eed54da1ac0f757d43dd4d72482eb752
2014-09-27 16:33:09 +00:00
dan
16228167c2 Improve sessions module documentation and comments. Fix some other code issues.
FossilOrigin-Name: bfc8bd80f8b225cebc66478448510ce84223ae7d
2014-09-27 12:26:18 +00:00
dan
fa29ecc4ed Fix a problem with concatenating patchsets containing DELETE and INSERT operations on the same row.
FossilOrigin-Name: 4d8537eafb40e3687abc057ba26a1f7014f2c2d9
2014-09-26 10:52:21 +00:00
dan
cbf6d2d2aa Add streaming version of sqlite3changeset_concat().
FossilOrigin-Name: 88eb6656bdb047a104837a2e15e7fe18c0a7a159
2014-09-25 20:43:28 +00:00
dan
fa122adac1 Add streaming version of sqlite3changeset_invert() to sessions module.
FossilOrigin-Name: 8ded6a46794c7bff1c8b790c662ba7e92f576380
2014-09-25 14:54:20 +00:00
dan
4757c65866 Add streaming version of sqlite3changeset_apply(). Tests and fixes for the same and sqlite3changeset_start_str().
FossilOrigin-Name: b917fc146876f764442de08d5ec36e5b4cf5ab52
2014-09-24 17:13:20 +00:00
dan
ef7a630496 Begin adding 'streaming' APIs to sessions module. This is a work in progress.
FossilOrigin-Name: 3c7d3d950bbf5f5ed3696ebc61c77ca48bafe2b5
2014-09-23 20:39:55 +00:00
drh
f5ab08c779 Fix a harmless compiler warning in the sessionAppendDelete() function.
FossilOrigin-Name: 1324d08d0c639378cf1b03bd6410db81947747ac
2014-08-18 20:14:30 +00:00
dan
082c96dffa Add miscellaneous test cases to improve coverage of sessions module.
FossilOrigin-Name: 0fac6cfffe628ea02c78ebad065307309ec9eaa1
2014-08-18 16:03:46 +00:00
dan
a71d2371d0 Fix some missing and out-of-date comments in the sessions module.
FossilOrigin-Name: 05c1d9149b27c68e2654ed28491722927d2176f5
2014-08-16 19:01:00 +00:00
dan
64277f4a70 Fixes for the sqlite3changeset_concat() API regarding patchsets.
FossilOrigin-Name: dccb34859508eac8146ae5b19c447673d04be3b0
2014-08-16 16:47:55 +00:00
dan
73b3c05590 Begin adding the sqlite3session_patchset() API to the sessions extension. This is an interim commit.
FossilOrigin-Name: 60a4565a8c44762a002cd02979317df5ca47e899
2014-08-15 20:15:49 +00:00
drh
5671ef69ec Sync the latest trunk changes, and in particular the STAT4 IS NOT NULL fix.
FossilOrigin-Name: b006792695d23980e1923b21915d5c1138ecf29d
2014-02-11 04:30:29 +00:00
dan
7531a5a378 Add the sqlite3session_table_filter API to the sessions extension.
FossilOrigin-Name: b7e4dd889d37c8f57c2d3c7900e802f644aac3ea
2013-08-23 17:43:32 +00:00
drh
07001c45a1 Remove the undocumented sqlite3_foreign_key_check() API and replace it with
sqlite3_db_status(db, SQLITE_DBSTATUS_DEFERRED_FKS, ...).  Add test cases
for the new functionality.

FossilOrigin-Name: d39e65fe702a2e11477f2d996f77404f45763368
2013-07-11 13:49:59 +00:00
dan
cb3e4b797e Experimental change to the handling of foreign key constraint violations when applying a changeset: all foreign keys, immediate and deferred, are deferred until the end of the transaction (or sub-transaction) opened by the sqlite3changeset_apply(). A single call to the conflict-handler (if any) is made if any FK constraint violations are still present in the database at this point. The conflict-handler may choose to rollback the changeset, or to apply it, constraint violations and all.
FossilOrigin-Name: 1d44e5d3c2b1dc958442f9114a960b256e002ed3
2013-07-03 19:53:05 +00:00
dan
35e2858e98 Fixes for the sessions module so that it works with sqlite3_extended_error_codes() set.
FossilOrigin-Name: c2972b6aed23f6c76a289534de9ea4732a48f40e
2013-07-02 20:23:40 +00:00
drh
1ffe7c7fab Also export the sqlite3changeset interfaces in the amalgamated version of
the sessions extension.

FossilOrigin-Name: 5b399f2bc43612c52ea2289001d852d7ba6f9750
2013-03-19 17:10:10 +00:00