Commit Graph

2182 Commits

Author SHA1 Message Date
dan bcd303ac7d Enhance error detection and fix other issues in unionvtab code.
FossilOrigin-Name: 9c3f1b9a82e500e015deb0cc669fbb32e7f0cdc69f926ceff383ab946f8d8d18
2017-07-17 20:25:21 +00:00
drh 72495b44e0 Improved the interface to the fts5() extension mechanism for enhanced
security.

FossilOrigin-Name: bc78235f547977f1a821342ca8f3e03103a0eb351f8b3115ac10b43dd9c7044d
2017-07-17 15:38:57 +00:00
drh aabebc27b7 Comment changes clarifying details of the pointer-type parameter. No
changes to code.

FossilOrigin-Name: e4579e50a1ece4f65dfdae39d5c1670f0e3f7d4824e7d242f07ec9859d15155f
2017-07-17 12:41:29 +00:00
drh ae3ec3f920 Add an experimental "pointer type" parameter to sqlite3_bind_pointer(),
sqlite3_result_pointer(), and sqlite3_value_pointer().  The pointer type is
a string that must compare equal using strcmp() or else the pointer comes
through as a NULL.

FossilOrigin-Name: 211cce04e97d2e325a6ea3e99738fc71115d673dc13daeffb03ac3140deb11de
2017-07-17 00:40:19 +00:00
dan d8ecefa5ab Add the "unionvtab" virtual table extension in ext/misc/unionvtab.c.
FossilOrigin-Name: 62a86aa6c0519cf1fa232169122d3d6ae8d2f66b20530fb934a82a15712bd2f0
2017-07-15 20:48:30 +00:00
drh c9fb27bfa8 In the LSM1 virtual table, dequote the filename before opening the file.
FossilOrigin-Name: 6ed4ef03ff6f22ae83a14facc48ce594911d7d7b37446436b68af3a822578fae
2017-07-14 15:57:56 +00:00
mistachkin 59541d70a8 Changes to the LSM1 Tcl tests to make things work on Win32.
FossilOrigin-Name: 7dc5e70ef1faa0b51a04abdfe1ee2f9ea5c2d0f99ea8ef6260b9de02500cf8b2
2017-07-14 15:45:27 +00:00
drh a199ffca58 Include a hint in the header comment of the LSM1 makefile about how to
set the LSMOPTS variable.

FossilOrigin-Name: b5e3b264814cde9572130b70fc0d21ccebc2d7f5f0e7db50b6395cb63723383e
2017-07-14 15:42:11 +00:00
drh aa15168983 Update the Makefile for LSM1 so that the LSMOPTS can be set prior to
including the Makefile, in order to add platform arguments such as -fPIC.

FossilOrigin-Name: fe319bcd7f85e9997babdb024ab350514524f5901903600fa9780bdcd1805098
2017-07-14 15:32:11 +00:00
drh 3eddffd8bb Fix a typo in the header comment to the remember extension. No code changes.
FossilOrigin-Name: 604b9664f4dd6e8d188b5c57407edbbe0639345f8d30bf2d19016f8324934840
2017-07-14 15:18:51 +00:00
drh e83b847b75 Change the name of the STMT virtual table to SQLITE_STMT. Also remove the
first column of that virtual table, which was a pointer leak.

FossilOrigin-Name: 1bc4e93407b7894b0271fbde3720930dcaadda6070e871d9719c4e8dc65b915f
2017-07-14 15:14:21 +00:00
dan 4b8035e69b Add very simple tcl tests for the lsm1 extension.
FossilOrigin-Name: 5e0a97930b08fff1c3a29f5c8b2962b856e3302209228c0e71b9f1a1bd2a4be3
2017-07-14 11:40:48 +00:00
drh c9407508b1 Update header comments on the carray() and remember() extensions to bring
out the fact that the pointer arguments must be bound using
sqlite3_bind_pointer().

FossilOrigin-Name: 55f5396576d186f310cb0fa66fbdb8ea68c18a3d0fe5de4b395ea03c7aa04c9e
2017-07-13 19:11:13 +00:00
drh d43748aa98 Update the FTS3 extension to use sqlite3_result_pointer() and
sqlite3_value_pointer() for passing FTS3 cursor objects from the table
into functions such as snippet().

FossilOrigin-Name: 0fa2e170e5e078d155c98b212ade36bd8424502ae07f2d82ebf77a76f57586ba
2017-07-13 17:48:14 +00:00
drh 3fb406083a Merge the latest changes from trunk.
FossilOrigin-Name: a54be6e041a9185787a22b86603dcb0654e5e4af71225b556d1b6279f8520ad8
2017-07-13 17:34:46 +00:00
drh 7ccf95dbab Fix harmless compiler warnings about incomplete structure initializers.
FossilOrigin-Name: 604c11d1a39f09e47b6fcee0f8b1c1054f9dbbc7b2c1cf93312aeaa4b7095018
2017-07-12 18:05:54 +00:00
dan 47ebd4cadd Fix a problem in an lsmtest test case caused by writing data in "text" mode
instead of "binary".

FossilOrigin-Name: 3e56a79ad8754e6da3181883154fa1c8b227a8d16c9b2a3eba925371595ae1f9
2017-07-12 14:03:13 +00:00
dan 1cd523cf0f In lsm, attempt to unmap the database file before truncating it when
disconnecting. A mapped file may not be truncated on win32.

FossilOrigin-Name: 39069941e98605bc8c7c736819781761760ee2b83363471ceb6f19e5eb06b13a
2017-07-11 20:36:35 +00:00
dan 416b8694fa Simplify the way in which the database file is truncated when the last
connection disconnects. Also ignore the error code from the xTruncate call -
as truncating a database file is always optional.

FossilOrigin-Name: b0a49d90fc91acca1306cf6145adc83acd368686768b7eb4a3b27515b3237396
2017-07-11 19:55:38 +00:00
drh 8999798e60 Fix harmless compiler warnings in the core.
FossilOrigin-Name: 55e93f256018757e5e1cb3b10ef48abf5914e7687419eae58b00998a37061261
2017-07-11 18:11:33 +00:00
mistachkin ba334bb20d Make win32GetTimeOfDay() in the lsm1 test code more portable.
FossilOrigin-Name: 2fe3a84330063378ca9fc5bfc8efe486c52d50b5c40be4f402a4f2318be69436
2017-07-11 17:54:27 +00:00
mistachkin b7bfc3b12d Fix a whitespace alignment issue in lsm1.
FossilOrigin-Name: a8e651e0e52b016c3939df3ee23b4981f1a8841c7ddd2981c1ef391feb559a5e
2017-07-11 17:06:42 +00:00
mistachkin 36c68234d6 Fix more harmless compiler warnings in lsm1, seen with MSVC 2015.
FossilOrigin-Name: 0f1307f1f5638c1c4f1ce2b89cdef7ce8b76dc2a38685cd1ca152cde9e8727da
2017-07-11 16:46:41 +00:00
mistachkin 1be5051923 Fix harmless compiler warnings seen with MSVC for lsm1.
FossilOrigin-Name: cf6da4a52f7f9047e653ef2972e4c0910b29d7182d789a9e30225dc1849e8779
2017-07-11 16:36:10 +00:00
drh 56eb09bc23 Add support for tab-completion (using the ext/misc/completion.c virtual table)
to the command-line shell.

FossilOrigin-Name: 95cd1d9f8baa6be305c9a8bfa26fef2a403f2d5b3b5c9c55382ec04f0bc98d40
2017-07-11 13:59:07 +00:00
drh f3c0009d8b Add the "phase" output column on the COMPLETION table-valued function, for
debugging.  Improved comments on the implementation.

FossilOrigin-Name: 0e2135552757cc6566ac959475d3b87254b6d462425ee6c457c743001f3370e2
2017-07-11 02:05:21 +00:00
drh dc4dde6bd9 The COMPLETION virtual table now looks at the names of databases, tables,
and columns in addition to SQL keywords.

FossilOrigin-Name: 1cc97711fa86a3938f0930200476d1b0991e4b893a8be3a19015423a3de56bef
2017-07-11 01:38:45 +00:00
drh 3265b5649e Incomplete implementation of the COMPLETION table-valued function. So far it
only works for SQL keywords.

FossilOrigin-Name: caefbc723b5f67afc5ef10b92b20400cbb76cb03e7e75e18d2726cc552083e09
2017-07-11 00:09:44 +00:00
mistachkin b2950c48e1 Fix harmless compiler warnings in lsmtest.
FossilOrigin-Name: bd8a1fb9b33418717c786a7275f636cd4d5facd66de9a416f948b61c6490c743
2017-07-10 21:32:11 +00:00
drh 4a9e14077e Fix errors in comments in the STMT virtual table. No code changes.
FossilOrigin-Name: 9a8f045d62f5c6593a5a2842e817b49fa9d00c74e329a15a326f74e583c1f767
2017-07-10 20:39:59 +00:00
mistachkin 240e7ef4bb Minor cleanup and refactoring of the Win32 VFS for lsm1.
FossilOrigin-Name: bf7eda67c8124c3cd5d9150f2f2694cd3f991b20e0a527398885976d0d787242
2017-07-10 20:33:50 +00:00
mistachkin 91ea8cf4ac Cleanup header usage in lsmtest for files that require _O_BINARY.
FossilOrigin-Name: f3a6a64ec90e6cf24aadf62aef4f92104be5ba6790f7fca040eff7abc31f1061
2017-07-10 18:57:03 +00:00
dan ff7733db52 In LSM, avoid calling the VFS xTestLock method to test for a lock that
conflicts with one held by the same process. The results of such a call are
considered undefined (since they are different under win32 and posix).

FossilOrigin-Name: a82a9bea624caf6b24d8e3f3c596817968b258f06e54288022f6df8226281057
2017-07-10 18:33:41 +00:00
mistachkin 50963c9da8 Fix comment in the Win32 VFS for lsm1.
FossilOrigin-Name: 12a421bcacf72128426eeafed8663accd8f2ac7edb46f620b60b8239065e657e
2017-07-07 21:20:26 +00:00
mistachkin 85bd1cd52b For lsmtest, use a more portable means of setting open() files to binary.
FossilOrigin-Name: aea6e0ffd33f41482f1b53b9f21b77add2865abda4eec1d9ee197177f74f43d0
2017-07-07 21:15:24 +00:00
mistachkin 1d91e9f26a Adjust copy_file() lsmtest function so it works properly for locked database files on Win32.
FossilOrigin-Name: 54a3855583deac93c955ed77fe82be6a6b7aadd3fdb7e6b895888e2a4ff530bd
2017-07-07 20:35:14 +00:00
drh a690ff360b Change the error message text for SQLITE_ERROR to omit the part about
"missing database" as that meaning is now obsolete (since approx SQLite 2.0).

FossilOrigin-Name: 732f90d6327c5c6368fc8b4cc207bd644ef08e3ae6d2e7295258ab099deaba63
2017-07-07 19:43:23 +00:00
mistachkin b11c650c01 Fix typos in Win32 VFS for lsm1.
FossilOrigin-Name: 0961ec873b78ad2da0ea9cdf2934bc8f08276375a153fe5d9fa8d4280328deef
2017-07-07 19:22:35 +00:00
mistachkin 73518c5876 Fix the memcpy calls in the lsmWin32OsShmMap function for lsm1.
FossilOrigin-Name: aa4890b9f9e9698c61d6ca0e24c26280f5e0a87a8c02865933ad483a1fd44d84
2017-07-07 19:12:55 +00:00
mistachkin 9a7a77ad36 Add support for LSM_DEBUG to the MSVC makefile for lsm1.
FossilOrigin-Name: 277a7fedafbe5b43d44086f3cb73e952873913bdc4b51041f45b6571b386d7d9
2017-07-07 18:31:51 +00:00
mistachkin 9b8c5f6819 Fix the usleep() macro in the Win32 test code for lsm1.
FossilOrigin-Name: 63599fa524a7c72ffa5362041f2ec394d9af9c43025d8b6d5a34e98eb423d5ff
2017-07-07 17:57:21 +00:00
mistachkin e60092b90c Improve clarity in the Win32 VFS for lsm1.
FossilOrigin-Name: 9c7a9e805d95d3d4a3f7e2d608280b7ca0dda01114e32cd366b1deb14e6e6839
2017-07-07 16:46:08 +00:00
mistachkin baebf3cc4b Add support for LSM_DEBUG_MEM to the MSVC makefile for lsm1.
FossilOrigin-Name: 3340de83df8c4fb19f729e6ff0838a9a03a1e701cdb40cb830e76f294198024a
2017-07-07 16:29:37 +00:00
dan 45158fa5d9 Remove a block from the Win32 VFS for lsm1 that is now superfluous.
FossilOrigin-Name: 5f726f2830dcf91f5e5c010b10761757f746d39b9dd2b8c9770452ce65bb1652
2017-07-07 16:27:43 +00:00
dan 3bc909b0af In lsmtest, use an empty string instead of ":memory:" when requesting a
temporary database from SQLite. This prevents other test code from trying to
unlink() ":memory:", which fails on win32.

FossilOrigin-Name: 281ad505d7a112c5524ea9fb195dfc46f819a58f79f42b37b12fbfe46a089ff2
2017-07-07 16:09:24 +00:00
mistachkin 5bd9e61f05 Remove a block from the Win32 VFS for lsm1 that is now superfluous.
FossilOrigin-Name: db4a41408eff450ee429b936847313c2c92ba1f5b1fcbadaacaff3c08bfdd589
2017-07-07 16:07:53 +00:00
mistachkin d429ec222c Memory reallocation fix for the Win32 VFS for lsm1.
FossilOrigin-Name: 5a3140e4dedace6de4366a3c52e41b818b6d19f356fdab738c6605afc1b674fa
2017-07-07 16:06:30 +00:00
drh 4676462f92 Merge recent enhancements from trunk.
FossilOrigin-Name: 73d0fc027ddcc24e55cdc8c54443a96083cc9a29e57c0abe97e8586ff8a7f4c5
2017-07-07 14:26:43 +00:00
dan adea0d1c39 Have fts3 virtual table cursors free internal resources when they reach EOF,
instead of waiting until the xClose method is called.

FossilOrigin-Name: b6b14ab6c8f9758a64e5fd29203f8fa610b5c4ef917de9be51ae55e072fad4ed
2017-07-05 18:48:07 +00:00
dan 7181395a4d Fix a problem in lsmtest causing one test to fail for multi-threaded LSM
connections.

FossilOrigin-Name: 2bce64c8864b616f9ab0063f64d0ceb2f83e53e110970c6b3b11003cba5c8804
2017-07-05 14:29:04 +00:00
dan 431a53fde2 Fix further OOM handling cases in LSM.
FossilOrigin-Name: ca757c8665e27de884086b2aab2bd1db481e2d12f2afe136ec151bf5a0e65b91
2017-07-04 19:23:32 +00:00
dan 038af0bdc6 Fix a couple of problems in handling OOM conditions within LSM.
FossilOrigin-Name: 989a5c1745a7145c14c6d9b713176ecba6b99296de8bdd09f666eeef10da9c2e
2017-07-04 17:25:45 +00:00
drh 518ee8f06f Fix compiler warnings in LSM1, especially in the test logic.
FossilOrigin-Name: 9bd3be92b8add7bd0d7bc4b0742b2dd227ebb8d67a839b78f26f2b06b47490f2
2017-07-03 21:09:28 +00:00
dan 45408a108f Fix a bug in lsm queries on levels undergoing incremental an merge that
contain range-delete markers.

FossilOrigin-Name: b2c2487928becbea5a932895d153709c98a057a3c71c2600e165478562e9f7c5
2017-07-03 20:19:28 +00:00
dan 05dda7ba8e Add more tests for LSM log file recovery. Fix a problem in recovering log
files that contain range deletes.

FossilOrigin-Name: e34eafd4c5b2bbf2735e136ad69b67bb4288ad4d01a0128d8e107ac46209a182
2017-07-03 09:00:18 +00:00
dan 24f6904e99 Fix a memory management problem in lsm log recovery code.
FossilOrigin-Name: dd55af30b4440bba1b97c2155b9f499d791cd7d8bae8341972c41439fdc41edc
2017-07-01 20:59:06 +00:00
drh c7b1ee5f6e Enhance the RTree module to detect node truncation early and report an error.
FossilOrigin-Name: 66de6f4a9504ec2670b7273de8fb6955c80e03f7f73414ea6b80fd8a99f75976
2017-07-01 15:21:17 +00:00
drh 3561dd4afe Update the carray() and remember() extension functions so that they user
the new sqlite3_value_pointer() interface.

FossilOrigin-Name: a99fa94db7185b8eaf3c9b184cb1479f8b3d5781f71f1717a4b3f2dd1d184fe4
2017-06-30 23:46:16 +00:00
mistachkin 04222ce52e Add some assert() statements in the Win32 interface for lsm1.
FossilOrigin-Name: d076d58ff108d286f7ac1f81e1ce945d6f4a4f5f97e3b8d5cee6f8d9a6c48d8f
2017-06-30 19:22:33 +00:00
mistachkin 88f769f967 Fix some minor typos in lsm1.
FossilOrigin-Name: 0ef777d7474383c0211b19baa4a161cf7fce6570f384dfef368cdab45c1a0f01
2017-06-30 18:12:09 +00:00
dan a5b55e370f Avoid constantly freeing and reallocing small internal buffers associated with
LSM cursors. Instead, allow them to persist for the lifetime of the cursor if
they are LSM_SEGMENTPTR_FREE_THRESHOLD (default 1024) bytes or smaller.

FossilOrigin-Name: bacfe8cb3e4d3be736c6789b2ce55ef5603e5c7a289b05b37cae2203cd7f2290
2017-06-30 11:44:11 +00:00
dan 28508ddb42 Avoid reading or writing the 32 locking bytes at the end of the first
meta-page of an LSM database.

FossilOrigin-Name: 2b5df3e8a80ae5c0415081dd9b29acaad1464be2e7971399e52c1c98408322d9
2017-06-29 20:13:44 +00:00
mistachkin 97e8b3ea32 Fix issues in the POSIX and Win32 interfaces for lsm1.
FossilOrigin-Name: 38ec41416679e8280d77c8a4913aa6a321784b1237a3fe409b8e256c5f4513de
2017-06-29 19:08:52 +00:00
mistachkin de680efbc3 More updates to the Win32 interface for lsm1.
FossilOrigin-Name: cae647696769c9fcdc3beafdfdf74d8384217f4b22820e4545093bea7be58f7c
2017-06-29 16:51:52 +00:00
mistachkin c2586f77ad Correct typo in the Win32 interface for lsm1.
FossilOrigin-Name: 1b4facb1ad0085aa52e63d4d432179467ddc2a69b668d49d86e65ead66a73f57
2017-06-29 15:57:42 +00:00
drh 01e6d540a7 Add interfaces sqlite3_prepare_v3() and sqlite3_prepare16_v3() with the
extra prepFlags argument. Add the SQLITE_PREPARE_PERSISTENT option as 
one bit in that argument.  Use the new option in FTS3, FTS5, and RTREE.

FossilOrigin-Name: 03977248e6fdaa9b35c15e5dd9bb89552f2f0a913cc31609b5af1e2347b67d38
2017-06-29 15:24:57 +00:00
mistachkin 14e61df283 Further corrections to the Win32 interface for lsm1.
FossilOrigin-Name: 4df6e2476ce93b9ca7a6959c8c2d6ef2c30395984b007d74166031dcf09d54b4
2017-06-29 15:13:48 +00:00
drh c6603af755 Rename the "stmts" virtual table to just "stmt" without the final "s".
FossilOrigin-Name: adfdb80105c46ac42b71132c80a91dbd5b1c9ff241fb4fbb5d04641a88898d90
2017-06-29 14:33:51 +00:00
mistachkin 3881d23c72 A couple fixes for the Win32 interface for lsm1.
FossilOrigin-Name: ebbd98e941d8a8ea97b434c29b70095515af0adab1977aa4d37fe74a7401f846
2017-06-29 14:17:48 +00:00
mistachkin 2ca62cb102 Compilation fix for lsm1 using MSVC.
FossilOrigin-Name: b7794cc5d5abc13c6301c8d5c1b330405432c047f154083430fd15823221e552
2017-06-29 13:35:44 +00:00
drh e4b45f536e Add the LSM1 extension.
FossilOrigin-Name: 824e83274c04d24fd854bc7376c958ea6b05862efc562a3dfed0fc888fd96cc2
2017-06-29 13:19:55 +00:00
mistachkin d90dbb8c1c Implement xUnlink, xShmMap, and xShmUnmap for lsm1 on Win32.
FossilOrigin-Name: 680cc064c9e809ddc643074b5e65677f484d904b3d52826f6def480ddaa8f0ab
2017-06-29 12:54:58 +00:00
drh 00d11d400b Add the SQLITE_STMTSTATUS_REPREPARE and SQLITE_STMTSTATUS_RUN options to
sqlite3_stmt_status().  Use this for two new columns in the stmts virtual
table.

FossilOrigin-Name: b0b0c8f8d548ef78584ab714ab120b01c1b83fc0d8ae2fd7626b970bab9fca58
2017-06-29 12:49:18 +00:00
mistachkin cffbd543d3 Implement xRemap for lsm1 on Win32. Also, zero file handle when closing it.
FossilOrigin-Name: 93c9aa7d9aea46b331c53ff579ef704e88ce90f96600b69479a87a4bb4ca2a91
2017-06-29 00:20:42 +00:00
mistachkin 44ab70db7e Implement xLock and xTestLock for lsm1 on Win32.
FossilOrigin-Name: 9112117dad8085c385aa614cd982b307f5822761607ba358f34df7848c549134
2017-06-28 21:36:40 +00:00
drh d0bbe4e9c2 Incorporate recent trunk changes.
FossilOrigin-Name: 62b8269ba2ff71e2daaa86688698896badd6f6e34ab42fbf92dda7fcda73a230
2017-06-28 15:56:58 +00:00
drh f00f530b7d Build the "stmts" virtual table into the amalgamation. It is active only
when compiled using SQLITE_ENABLE_STMTSVTAB.  That option is supplied to the
command-line shell.

FossilOrigin-Name: 0ff057d86e42e518fda22bfbf5f1977ab6bd0a74a9211ff259ee7e8a7ce98b58
2017-06-28 15:47:29 +00:00
drh 2fb960b545 Fix harmless compiler warnings in the CSV extension.
FossilOrigin-Name: f02a54599de7620438aecd3753199fc52ce8919d7503bb8b2f5592b0e51dbf8c
2017-06-28 15:17:31 +00:00
mistachkin ec99c0f632 Improve a local variable name.
FossilOrigin-Name: d0f6973d93c36451bf64f47de9a88abec613a624603033bf6717f5071139b6d2
2017-06-27 22:33:06 +00:00
mistachkin b5fdc26c21 Initial work on porting lsmtest to Win32.
FossilOrigin-Name: 7e669d9bfab237ff7ece821cf95cfd3bb753b1882b9a86044b7d4579808aecf4
2017-06-27 22:27:54 +00:00
mistachkin 59b1dd3830 Implement xFullpath for Win32.
FossilOrigin-Name: dbe9c8aa8d70051fafec569054eeda6c02efe9d036ab6beada00da3ed42e52d9
2017-06-27 18:15:38 +00:00
dan 210ec4c855 Fix a virtual table problem that can occur when the vtab is on the RHS of a
LEFT JOIN and there is a MATCH constraint in the ON clause, or when the vtab
is in a sub-query that is the RHS of a LEFT JOIN and there is a MATCH
constraint in the WHERE clause of the sub-query.

FossilOrigin-Name: 87b381663398f029f52cb5598aadd069b03034b6f833ce80ba762b406075a44e
2017-06-27 16:39:01 +00:00
mistachkin 8e1ddde079 Minor corrections to the previous check-in.
FossilOrigin-Name: e1cf8a78a0bbd7b05cefab22a5c9676098887ee9811d37330ce89b3367856f92
2017-06-27 06:28:00 +00:00
mistachkin 02679b0466 Work in progress porting lsm1 to Win32.
FossilOrigin-Name: 2017636e93cf810fe4d1247c18de9f316fca037035a026f77c4588563d7bf0cc
2017-06-27 05:59:47 +00:00
drh d5fbde80a2 The ".import" command of the shell, and the csv virtual table extension both
ignore a single UTF-8 BOM at the beginning of their input.

FossilOrigin-Name: 7c15d762d99c2e3e534cd35dfe25ddcd317637eb1f2655fd24c2dd5f9d5a7613
2017-06-26 18:42:23 +00:00
dan 4261a4065f Remove an invalid assert() from lsm test code.
FossilOrigin-Name: ca8a7e995c3da10ba05e3b7d4818c633fe5ba6d6f9351b67017a2603b50b903d
2017-06-26 11:46:01 +00:00
dan 3a31c67aae Fix another problem with multi-threaded mode in the LSM test code.
FossilOrigin-Name: 461ced77d93e84f09bfb4291999cd0245506fa9a8369049fd68968bbcf18d41b
2017-06-26 08:24:35 +00:00
dan e6f98bcf09 Update a test case to reflect the fact that the lsm blocksize is configured in
KiB. And defaults to 1024, not 2048.

FossilOrigin-Name: d7015475f121db1f56060716cd8adb73e9b52016890ec9018b620ef9d7d4fbff
2017-06-26 07:31:28 +00:00
dan 07cae6ae74 Fix some compiler warnings in lsm_file.c.
FossilOrigin-Name: 23f16382ed47a90bf5e6c1684d54d28484dca46fea20ca0f131bd477cf222bfb
2017-06-26 06:53:24 +00:00
dan f417f28bd7 Add extra test cases for sqlite3changeset_apply() and ALTER TABLE ADD COLUMN.
FossilOrigin-Name: 603838fc9a65adda831a6a17b31b2e80f5b56e5946a9f0c1fa2c83d2f2a67f6a
2017-06-17 16:39:10 +00:00
drh b74013300c Merge the latest changes from trunk.
FossilOrigin-Name: 60105c2253d0b617037e975b0d0b729bcb59b950aa2c33d8891394ad45aabb69
2017-06-15 15:06:26 +00:00
dan 2ebf8f474e Fix sqlite3rbu_close() so that the pzErrmsg parameter may be passed NULL.
FossilOrigin-Name: c433672dd8ab625628bde2f4f40a2dc000ed915dbe91833d3f753d8ab51baf25
2017-06-13 16:52:34 +00:00
drh e46c63d565 Fix the sessiondiff test module so that it does not run if the session
extension is not enabled.

FossilOrigin-Name: 8f92b7a6223a69304dc8a6ab3b43a49cbb87f572a1e65d8a0c6dc09fca38e1a8
2017-06-11 19:40:34 +00:00
dan 41ac439dbe Fix another lsmtest build problem. Add the "-trans BOOLEAN" option to "lsmtest
speed2".

FossilOrigin-Name: 61853bc171e7c3af1db6a33ac8b1ad21e1c08e8d6b317fe061fdcd89c9a42e88
2017-06-07 19:46:18 +00:00
drh 0282c03abc Merge in trunk enhancements.
FossilOrigin-Name: f8bbb608cbf6c245628e3d362e9181fb3dc402b1d8241bcb687caf395f63c916
2017-06-07 16:25:25 +00:00
dan 3b328522f4 Fix a threading problem in lsm test code.
FossilOrigin-Name: 501238b9fbb4eece084b4bfce84a5f37a986f34db8081df517e60ef81f357454
2017-06-06 16:14:49 +00:00
drh 59ce97a013 Merge all recent trunk enhancements.
FossilOrigin-Name: 1d23294d88b1a80fe1f5403ea4fd75e61bb4932d5b714ea450d1b4b84f0896ab
2017-06-02 23:44:38 +00:00
drh 6c2d94f928 Fix a typo in the header comment of the "series.c" virtual table extension.
FossilOrigin-Name: d637feb4e3032ee0067c204b56d2af5f7eab228e645f2e77b0b043c2b299724d
2017-06-02 13:16:54 +00:00
dan 38d6985509 Add test code for LSM to the ext/lsm1/lsm-test directory.
FossilOrigin-Name: bb7436e84a315baf05f00e6cab396017e3f287ea404d32e0cc4f389fa1194dec
2017-06-01 16:13:57 +00:00
drh 2c2f392dca Add interfaces sqlite3_prepare_v3() and sqlite3_prepare16_v3() with the
extra prepFlags argument.  Add the SQLITE_PREPARE_PERSISTENT option as one
bit in that argument.

FossilOrigin-Name: 4a25c5883380fe5990d8180adb58c3bdc7a3d081bc4c69cd4de3cd57074fb251
2017-06-01 00:54:35 +00:00
drh 3528f6b62b Add the SQLITE_STMTSTATUS_MEMUSED option for sqlite3_stmt_status() that reports
the amount of heap memory used for a single prepared statement.

FossilOrigin-Name: b57d510465458dec5b5fc778fd6e8833392964201f9febebf526e60a543da0c2
2017-05-31 16:21:54 +00:00
drh 6b37e0adc9 Add the experimental "stmts" virtual table for introspection of prepared
statements.

FossilOrigin-Name: cb4c5c66aba757356da3b8ec3c66a5c8c40e180b3360638ac634f7787404a5b1
2017-05-31 16:09:04 +00:00
mistachkin 831265f962 Fix harmless compiler warnings in FTS5.
FossilOrigin-Name: 57a60e959c198b87ed29fab14356f89e0ea7cdb1dd99adbea45b40e8d0cb310a
2017-05-24 15:32:44 +00:00
drh 92b71757f7 Do not use strcpy() in the (obsolete) amatch extension.
In releasetest.tcl, run Apple tests using -Os instead of -O1

FossilOrigin-Name: 4440e42031b9cb0edf9a8621cd4f46f209392940ec5b9eefcf8c1e3fef5f7b76
2017-05-23 19:35:20 +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 22025ef198 Fix some problems in fts5 code detected by -fsanitize=undefined.
FossilOrigin-Name: 35f721045dfe3f82e016938ab1a668bfc37b6b57b8813cc963ef640ec82de58d
2017-05-19 12:32:32 +00:00
drh 31976dacf1 Merge changes from trunk.
FossilOrigin-Name: 6e0f64ab5eafda5d9e61e00c89af3c1ea2c5aa29821da1bdbcab040957b12403
2017-05-15 17:56:48 +00:00
drh 9715f0e544 Enhance the json_extract() function to reuse parses of the same JSON when
the function appears multiple times in the same query.

FossilOrigin-Name: 3ba9e7ab79e32090a71c7aa152da9bd5951940ae5e2cf433bceadeb6bfca193f
2017-05-11 18:42:19 +00:00
dan 6b4fbabd6a Do not save the state of an fts5 merge operation mid-way through an input
term, even if no previous entry for that term has caused any output. Doing so
may corrupt the FTS index.

FossilOrigin-Name: 9a2de4f05fabf7e725666fb8824ae1adad56834d7ae4f2e118375bb6f9c0ae77
2017-05-11 18:14:06 +00:00
drh 3fb153cb29 Cache the JSON parse used by json_extract().
FossilOrigin-Name: 44ca6c2c4639f3c50ae9233ee299ff0fc4566462c31f28d8676f8de7ffdcd7f0
2017-05-11 16:49:59 +00:00
drh f8a2e8c2d2 Fix requirements marks and harmless compiler warnings.
FossilOrigin-Name: 198ff4c01d86d193a54745764d69376cab8e94747a4daa444690f7e1ec87800b
2017-05-06 17:12:52 +00:00
drh bd0f1dbd06 Get sqlite3_expert building on Windows.
FossilOrigin-Name: d8254047b30f7c1be486bf39d4420678604573b951b5cc83c19ebf74aba0864c
2017-05-03 12:50:46 +00:00
drh 138bd6df41 In sqlite3expert.c, do not copy the schema for virtual tables. Updates to
makefiles to make building easier.

FossilOrigin-Name: da15752dccf6090e40ec825db89048eca2b30185882225bf81f1891e914c2e7f
2017-05-03 12:15:20 +00:00
drh 382bce037c In the sqlite3_expert command-line tool, allow two-dash options. Do not
accept the database name if it begins with "-".

FossilOrigin-Name: af7d1596044980e0a18baa3ab6674779724dffbf18a152c72e53f11a08999e68
2017-05-02 20:42:30 +00:00
drh 5034dc673d Merge the latest enhancements from trunk.
FossilOrigin-Name: a7dcf6a79f7e1c5884baee2909a4bf3174ae06d561dae87b390856e573f81b49
2017-05-02 19:45:14 +00:00
drh e780764b4e Fix the fts3EvalAverageDocsize() routine so that it returns errors from
sqlite3_reset() rather than always returning SQLITE_OK.

FossilOrigin-Name: 430f539cbb3f806fb89191e0b759a5f8b49d9e5b6c95fe9a4b55a1aa0875762a
2017-05-02 18:00:31 +00:00
dan 6f92c34866 Update this branch with latest trunk changes.
FossilOrigin-Name: 11f4761c3a84e2cc9df62f117a003af8c57f3d226eec5a40d6241b121e78d002
2017-05-01 14:25:34 +00:00
dan b9e6a73866 Replace <fts5.h> with "fts5.h" in test file fts5_test_tok.c.
FossilOrigin-Name: 63d9ca5c7392e1efe3330689fe750310a952287e843b3242178724e8561fae0e
2017-04-26 14:34:04 +00:00
dan f3ac8ba569 Another minor formatting fix.
FossilOrigin-Name: 9fa2ce3c2b75408594d387684984cd946765776d30bc622a1f4e64d6fe1856d5
2017-04-21 19:58:35 +00:00
dan 6b0fa916f5 Fix formatting errors in the previous commit.
FossilOrigin-Name: da9a2e5aa977f7e8e9e4365f7b34bb4f482029a3d44646100773cedc8ea9b959
2017-04-21 19:56:53 +00:00
dan 5b9dbd1ed0 Update the README.md file in the ext/expert/ directory.
FossilOrigin-Name: 3b2ff4e0692dfca395d4523b7d5cd0dfd5c319c1072a2a873631fa477cee0b79
2017-04-21 19:53:39 +00:00
dan 0619838c55 Fix an FTS5 bug that could cause a prefix-query without a prefix-index on a
database that contains delete-markers to return extra, non-matching, rows.

FossilOrigin-Name: 840042cb2bed2924e2263f21887317f661e5a585c4466c3af25b91ed57a6b49b
2017-04-21 16:04:18 +00:00
dan c42a0056d7 Merge latest trunk changes into this branch.
FossilOrigin-Name: b1533bc455f52f570c0f4b8aaa0da802757dc89b0e45b9a9b31aa591a44bf7bd
2017-04-20 17:35:46 +00:00
dan bc3f784cd2 Speed this branch up a bit by filtering before the virtual table layer when
sampling user data.

FossilOrigin-Name: 8e57c31340dd9ffc457da63c5996fb1b573f8154f864ec2b52c15f399906ac8b
2017-04-20 16:43:32 +00:00
dan 2ed99def5b Avoid creating a temp table in the user database in the sqlite3_expert code.
Trouble is, this makes sampling for stat1 data much slower.

FossilOrigin-Name: c62e358243d96cb38a7ce2aa679fc640b62bf46080eab4bd5fc2acf5997d6cd5
2017-04-20 16:08:33 +00:00
dan e53b4f9774 Add an option to generate stat1 data based on a subset of the user database
table contents to sqlite3_expert.

FossilOrigin-Name: c69c3e21db6e141f7e24226c6432f2ed31fe5f177bd23781915871f8600ee56a
2017-04-20 09:54:04 +00:00
dan dc62daca86 Further improvements to coverage of fts3 module.
FossilOrigin-Name: 6b21d0fdebdccfaf63590d9ca9a279c22b8baec07c1a669b9f617f25bd857384
2017-04-19 13:25:45 +00:00
dan a059e99ca8 Further modifications and test cases to improve test coverage of fts3.
FossilOrigin-Name: ea8a0d2ce0cb1ca3f4f18c72fb780d1c26792799acc87e6726f9eaccf2f178bf
2017-04-19 07:33:52 +00:00
dan a6ed5a4f39 Have sqlite3_expert_analyze() populate the sqlite_stat1 table before running
queries through the planner for the second time.

FossilOrigin-Name: a157fcfde5afc27ae38e7cf4669fcc8e60e23d9d301ffe2e541dd69f895b493b
2017-04-18 20:10:16 +00:00
dan 0027e98b85 Use sqlite3_table_column_metadata() instead of a SELECT statement to check for
the existence of a %_stat table in fts3. This leads to smaller and easier to
test code.

FossilOrigin-Name: dc2a48020a3c856a8b4cfa2309c290f0508b991e92cc0e4de680d19aae7872fc
2017-04-18 13:50:00 +00:00
dan 7853002c71 Fix sqlite3_expert handling of triggers on views.
FossilOrigin-Name: ff4976da667872614331d88e68fb67d347874f164a1c7950dd738c7c2320b954
2017-04-18 09:04:48 +00:00
dan bda00fbdb7 Refactor the fts3ColumnMethod() function so that all branches can be covered.
FossilOrigin-Name: e47fdb493bd76d85f6f05771ee7a0b3ee31b1eb05839a60d2bdb47149ac692d8
2017-04-18 05:49:23 +00:00
dan 280db65e2c Add support for analyzing trigger programs to the sqlite3_expert code.
FossilOrigin-Name: 159e8022a9d6701532b8b60e0c41154bc434c1bbdb107c8c97a78fb1140fa745
2017-04-17 17:03:08 +00:00
dan 624edacf6a Further improvements to test coverage in fts3.
FossilOrigin-Name: 352413eed469802665e7d2c17b7fe6e3a0b0b2209ce45bdc85fd4243cec50ea6
2017-04-17 16:07:25 +00:00
dan ddf4747053 Improve coverage of code in fts3.
FossilOrigin-Name: 1a08a836fa919524216a16faf5212eebc9ad788c9e15463b68b0576dfccd4387
2017-04-17 13:38:09 +00:00
drh b65b3e429a Add the anycollseq.c loadable extension in etc/misc
FossilOrigin-Name: d7b9813cb17615c3d00afd6994a4309d6d48c8e924b6cd813c543e1fa65c7719
2017-04-16 22:08:31 +00:00
dan 2abf90096f Fix problems with handling constraints on the rowid column in sqlite3expert.c.
FossilOrigin-Name: 2e6308798ae2db30564deb35ba3896597448edabbcac6efc4ff084552e42de30
2017-04-15 16:52:12 +00:00
dan 990b6ceccf Merge latest trunk changes into this branch.
FossilOrigin-Name: 2d0c458e013cb2d02fbeabed8dabd66f55141aac194611f0e599b3c95af1964f
2017-04-15 15:47:19 +00:00
dan 79610f5d09 Fix memory leaks in the code on this branch. Make use of the
sqlite3_index_constraint.usage field. Do not try to handle ORDER BY terms with
explicit COLLATE clauses - they don't get passed to the vtab layer anyway.

FossilOrigin-Name: 0cd75a872c89958a7f418720a0e8c6f638f8284c488f666015c19136feae6be8
2017-04-15 14:16:04 +00:00
dan 0824ccf29b Modify the code in ext/expert/ to use the vtab interface instead of
sqlite3_whereinfo_hook(). Remove sqlite3_whereinfo_hook().

FossilOrigin-Name: 3bb6585004090dbf92dd5e9abdf0fd2c921e64b5b3121c4fb7446db764ab59e5
2017-04-14 19:41:37 +00:00
mistachkin b1ed717f18 Make USE_FULLWARN=1 the default for MSVC and fix harmless compiler warnings.
FossilOrigin-Name: 6bf673767b8e5cedef1acff795cbe524fab8db2525c06424db4e038934a33936
2017-04-14 14:50:34 +00:00
dan 81beb6d115 Update this branch with latest changes from trunk.
FossilOrigin-Name: 5fcd840cf9b6a5c3ee4ef1e8f92f6c30f96a7899a3d774ee9be8a816916f2c3b
2017-04-13 16:19:40 +00:00
dan 929b695111 Allow a user column name to be used on the LHS of a MATCH operator in FTS5.
FossilOrigin-Name: 6f54ffd151b0eca6f9ef57ac54802584a839cfc7373f10c100fc18c855edcc0a
2017-04-13 09:45:21 +00:00
drh 8671538cad Fix a regression caused by the fix for ticket [6c9b5514077fed34551f98e64c09a1] -
control characters allowed in JSON.

FossilOrigin-Name: 8e7b611863247a3bf46a96ec4b47d24c0ae0d60c9cee968a1cfd1da157e7c9bb
2017-04-13 00:12:32 +00:00
dan 03155f659f Update fts5 to support "<colset> : ( <expr> )" for column filtering, as well
as "<colset> : NEAR(...)" and "<colset> : <phrase>".

FossilOrigin-Name: c847543f8bb1376fef52bca72b4191162a32eb7e6c5f0cd1aa0ab116b3183396
2017-04-12 17:50:12 +00:00
drh 26849e14c2 Improved \n and \r escapes in the ext/misc/dbdump.c utility function. The
implementation of dbdump.c now matches the implementation in the CLI.

FossilOrigin-Name: f2643315bb41a71eebd79f5d671f9163187e299a52ff8a481186f1e8fa7e5262
2017-04-12 17:38:24 +00:00
dan 0e0f5edbb5 Update this branch with latest trunk changes.
FossilOrigin-Name: 0f66a093935100efd731e14aa63b57360ddd517c1ac97edd1ea9a9de95e1f3cc
2017-04-11 19:00:30 +00:00
drh ff6d50e973 Limit the depth of recursion for valid JSON in the JSON1 extension in order
to avoid using excess stack space in the recursive descent parser.
Fix for ticket [981329adeef51011052667a9].

FossilOrigin-Name: 1f68c184596912d742b50b1ca38252a9e783aacf121619a27b17a7ae9f6df041
2017-04-11 18:55:05 +00:00
dan c2309693b9 Fix a formatting issue in the output of the sqlite3_expert program.
FossilOrigin-Name: cc8c3581060ffef02290b680183e6f6bc9837ba3550e74c8aaabdc7c45edc223
2017-04-11 18:29:14 +00:00
dan a4e61024d7 Add header comments to the API functions in sqlite3expert.h. Include a list of
all candidate indexes in the report output by the sqlite3_expert program.

FossilOrigin-Name: 0c45c5eb9f0f171b8d7c5f0d2973f9f59915467506cdff1450f3e4b2134a01ca
2017-04-11 17:43:12 +00:00
dan 96d43a05ec Add ext/expert/README.md.
FossilOrigin-Name: 9318f1b9ed2d8da3a82ea69179e2d56a99d326c7721642665f87f6a4534e7bf0
2017-04-10 20:00:26 +00:00
dan cd84474ece Changes to allow the code in sqlite3expert.c to be tested directly (via the
API in sqlite3expert.h) instead of by invoking the sqlite3_expert application.
Fix memory leaks and other problems.

FossilOrigin-Name: 5dd9831721b70a89a26728adcd49c7f6103ef8266891a79c2db34d913702709e
2017-04-10 16:13:20 +00:00
drh e12e24ded8 Change the JSON extension so that it disallows control characters inside of
strings.  Fix for ticket [6c9b5514077fed34551f98e64c09a10dc2fc8e16].

FossilOrigin-Name: 475d8f82ec61a4ff3e6a7650731230ccecb6cc580d1397d189d0ba479d9bad4d
2017-04-10 12:25:05 +00:00
dan 958151b005 Fix the -file option on the sqlite3_expert program.
FossilOrigin-Name: 0857c48e02a76490fc623364f77363165dea94ec254f93d8f0fd0bac2968c572
2017-04-09 08:38:37 +00:00
dan 2b78dd2359 Merge latest trunk with this branch.
FossilOrigin-Name: e051e8f21b909c5e89a7203eef6501fecd64f82a634c4e10398b5ef7d716eb37
2017-04-08 19:00:37 +00:00
dan e7c3aca601 Rename shell6.test to expert1.test. Have it invoke the sqlite3_expert binary
if it is present.

FossilOrigin-Name: be0deff940bea4f653d644113f42529a32ff7039d1d168119233aaf000a22f40
2017-04-08 18:56:32 +00:00
drh 9fa866a8d9 Disallow leading zeros on numeric constants in JSON.
Fix for ticket [b93be8729a895a528e2]

FossilOrigin-Name: 204e72f0080e8f08f99978870bd3cb9d59b068ecffee82192d707c650548b43b
2017-04-08 18:18:22 +00:00
dan 65e67ed1b2 Use hash tables instead of in-memory database tables for a few purposes in
sqlite3expert.c.

FossilOrigin-Name: bf10e68d9e4d5eae7ae6148a7ad64c9596f2ed8ccd36065adb09a1f9e7dae50b
2017-04-08 17:41:24 +00:00
dan 5b09d13a58 Have the rtree module close any open blob-handle within the xSavepoint method.
This prevents such an open blob handle from interfering with DROP TABLE
operations.

FossilOrigin-Name: fa4416adc2a9a3a80db1d5befc0b95c3d0fc41affe38f7f2f45cdfae3f1b49eb
2017-04-08 13:52:41 +00:00
dan be0bc8bb4d Have fts5 close any open blob-handle when a new savepoint is opened. This
ensures that fts5 does not prevent DROP TABLE statements (which always open a
savepoint) from succeeding.

FossilOrigin-Name: a921ada89050ce1d162fd1b0056939573635e2cec7ac0c2a99ae924b3ae593f7
2017-04-08 09:12:20 +00:00
drh 297e2bdb8e Make sure the RTree sqlite3_blob handle is reset prior to renaming the table.
FossilOrigin-Name: 1cdae2db3c54970a1811e597065724578408c84d49d75b8fe25d56281ddc2e94
2017-04-08 01:09:14 +00:00
dan 8e0b8e0688 Refactor code to suggest indexes from the shell tool into an extension in
ext/expert. Unfinished.

FossilOrigin-Name: 305e19f976ca064638a294e0817bf547ea745e1eb74746c5855514e6ced9c5fa
2017-04-07 20:14:22 +00:00
drh 2fb79e9b04 Fix two harmless compiler warnings.
FossilOrigin-Name: 32be9c3faaafd736da3f49d475dc9279af4e4ba38070b60033d898345080acf0
2017-03-25 12:08:11 +00:00
drh ba7cce317b Fix a harmless compiler warning in the JSON1 extension.
FossilOrigin-Name: c2c3dd84534bb5ea81c974847b74a166c9cba1545fc749ce625929f303bf22e4
2017-03-24 19:45:05 +00:00
drh 29c9969871 Fix an error in the new json_patch() routine discovered by Ralf Junker.
FossilOrigin-Name: 9d5350418b2f6113e0b50c57e8a872006f27753067baf08ffdfa7943c0c9a148
2017-03-24 12:35:17 +00:00
drh 37f03dfb1f Change the name of the json_merge_patch() function to just json_patch().
FossilOrigin-Name: 04d4100445a3373986ee962618bc03ec304f6ba2f867c8e9eee415daffb593fc
2017-03-23 20:33:49 +00:00
drh 1fe162fd0c Avoid redundant edits in the json_merge_patch() function.
FossilOrigin-Name: 4a8e6437dd610c5376a07867a73e5a7e2ea90357a018e1788ecce6f4e10bc939
2017-03-23 12:56:44 +00:00
drh 0002d246a9 Fix harmless compiler warnings in the new json_merge_patch() logic.
FossilOrigin-Name: 5d2cf5a2f8afd88d041d89b3936042ce5a43629d23c48738cb2791b24da3e6af
2017-03-23 00:46:15 +00:00
drh bb7aa2d85e Various fixes to the json_merge_patch() function.
FossilOrigin-Name: f49fd2554b0723eb7cf2fd765d655c6820833ee7e5f7d7629d98c27a6fffa1d9
2017-03-23 00:13:52 +00:00
drh f07b249f92 Change the name of the new function to "json_merge_patch()".
FossilOrigin-Name: 53bf70f37bbca319ea35f70849e2a34ae628a504486158fdad5c4bb7431c68e0
2017-03-22 21:45:20 +00:00
drh 633647af75 Initial implementation of the json_mergepatch(A,B) SQL function.
FossilOrigin-Name: a267444039af519f088dd8f8ee33f686cc3071c087677075af2364ebc2587514
2017-03-22 21:24:31 +00:00
dan 119fc11eb0 Add short script ext/fts3/tool/fts3cov.sh. To help measure test-coverage of
fts3 source code.

FossilOrigin-Name: ee9588e873ffebcaa177957950cbb14924e154c391ed7f687116065064ff11b0
2017-03-21 17:19:31 +00:00
dan 74869e5e52 Avoid passing NULL as the second argument to memcpy() in fts3.
FossilOrigin-Name: 49b93d972de9649abfd6235b65dda1c9d468956671e50704afde6181ffa56dea
2017-03-20 19:35:30 +00:00
dan 6b904f5e01 Avoid a technically undefined right-shift of a signed value in rtree.c.
FossilOrigin-Name: a144875fe44ff3a30bab299d50b7dbec2ee21f8c73e692a71ee1f7c54b5f0c76
2017-03-20 19:26:27 +00:00
dan 920c83f18f Fix some problems in fts3 found by address-sanitizer.
FossilOrigin-Name: 16a8e84fa7f67a467f824bdd7f72cbd6a6e95dab8cc7aa1e0e751720b98f3e31
2017-03-20 18:53:32 +00:00
drh 6f25936c9c Updates to README files under the ext/ hierarchy. No changes to code.
FossilOrigin-Name: 029bc5d224bcbdcca2307710539b133c39e2a27b971c28b294a1f517b80cb418
2017-03-15 20:27:46 +00:00
drh 9c4527e57d Improved header comment on the shathree.c extension. No changes to code.
FossilOrigin-Name: 84f2e3d5f611b35de16684956d842df6c93d858e8187f17eb27452758a752c57
2017-03-15 13:47:39 +00:00
drh d3bc75fb94 Fixes to the dump logic. All appears to be working in preliminary tests.
FossilOrigin-Name: 007b11e301d444361c8eff8734dc2fb968a64343c177ff30cec74a0cf76099e8
2017-03-13 21:49:48 +00:00
drh 473af4fe03 First draft of the complete dbdump.c library.
FossilOrigin-Name: 84ea4fcc52d0af02648c52989c2e69f4961071e1620382555ec59a39161a7a7d
2017-03-13 21:26:41 +00:00
drh 688633cb9e Infrastructure for an extension C-library to implement sqlite3_db_dump() and
a corresponding "dbdump" command-line utility - both of which do the same
work as the ".dump" command of the CLI.

FossilOrigin-Name: 74c5ace498f72d7f5495203678bedd0bc540211131a4e4db7b62115d5322a288
2017-03-13 19:26:34 +00:00
dan 1ba30db8bd Remove the rbu_round_trip.tcl script. It is now part of project "test-dbs".
FossilOrigin-Name: b5bf2957677e8f2acd7426b302229a966de08fd9
2017-03-10 18:36:34 +00:00
drh 4146b4e34a Improved comments explaining the sha3_query() format. Fix a performance #ifdef
error in the sha3 implementation.

FossilOrigin-Name: 54ef7abd7f5b16f4b29c9519d283e142c9340fbf
2017-03-08 15:03:12 +00:00
drh acc83d2e4f Add the shathree.c extension for implementing SHA3() and SHA3_QUERY() SQL
functions.

FossilOrigin-Name: f7ca9193ddafd3676406bdfeb1b7d21182c2a3c1
2017-03-08 13:50:40 +00:00
dan 5cc95ebf37 Add test script ext/rbu/rbu_round_trip.tcl. Uses "dbselftest" to test that
"rbu" and "sqldiff" work together.

FossilOrigin-Name: 961e79da73b4550b3e5b0f9a617133a76485db67
2017-03-07 20:03:25 +00:00
dan 0e9b43ff85 Before beginning an incremental checkpoint in RBU, sync the directory
containing the target database file. This ensures that the new directory entry
created by renaming the *-oal file to *-wal is synced to disk.

FossilOrigin-Name: 915a9a28783fbb2f4c0794eb4264ce8c0b9d42f7
2017-03-03 16:51:46 +00:00
dan 1d62a66230 Fix another RBU case similar to the previous. This one for systems where the
sector-size is larger than the page-size.

FossilOrigin-Name: 4012bb3aa91927156ba149caa4e5c622b0729d79
2017-03-02 16:56:48 +00:00
dan cb1b0a693a When saving the state of an RBU update in the incremental-checkpoint phase,
sync the database file. Otherwise, if a power failure occurs and the RBU
update resumed following system recovery, the database may become corrupt.

FossilOrigin-Name: edee6a80e1cc7e6a2b8c3c7f76dd794fc8ab9a72
2017-03-02 14:51:47 +00:00
dan 81415257ec Improve performance of fts5 writes by writing the "averages" record once at
the end of each transaction instead of every time the table is updated.

FossilOrigin-Name: 2b210d691462b463796e7948399133c296e89ebf
2017-02-27 17:06:56 +00:00
dan 9c58b63c18 Add an sqlite3_set_last_insert_rowid() method. Use it to work around fts4 and
fts5 modifying the last-insert-rowid unintuitively from within commit
processing.

FossilOrigin-Name: fe41bb5632a5d438acfd682809f1bd12315b970a
2017-02-27 14:52:48 +00:00
dan 70cdf38232 Add an 'extern "C"' block to header file sqlite3userauth.h.
FossilOrigin-Name: ffd61fb449a510b2fc90caf86b266733051cc365
2017-02-25 20:57:46 +00:00
dan f0e808c60b Fix an FTS5 problem that could cause a crash when certain queries were
interrupted using sqlite3_interrupt().

FossilOrigin-Name: e400909f313c317b7b67be6eb867ed61df7383dc
2017-02-21 17:52:58 +00:00
drh dc5ece86ae Remove the CLANG_VERSION macro, since we have learned that version numbers in
clang are "marketing" and are inconsistent and unreliable.  Builds using clang
will still use the GCC_VERSION macro since clang works hard to be gcc
compatible.

FossilOrigin-Name: 810d29320b853b3a01aa50d8f2a0bceacf79e0aa
2017-02-15 15:09:09 +00:00
drh ac279be98e Avoid a duplication #define in FTS5
FossilOrigin-Name: c447441cff1884d6fe5f0a76d64b3e7d908584a1
2017-02-13 13:20:02 +00:00
drh a39284bfa8 Cleanup the usage of the SQLITE_DISABLE_INTRINSIC compile-time option.
Remove the SQLITE_RUNTIME_BYTEORDER compile-time option.  Use
-DSQLITE_BYTEORDER=0 instead.  Fix a bug in R-Tree that occurs when compiling
on a known little-endian machine without the use of intrinsic byteswapping
functions.

FossilOrigin-Name: 798fb9d70d2e5f95e64237b04d6692360133381a
2017-02-09 17:12:22 +00:00
dan 18fdde21b8 Avoid preparing a SELECT statement each time an UPDATE or DELETE
by docid is executed against an fts3 table.

FossilOrigin-Name: 9962c10a5c6672bd82b2bf640d878fcdac0b815a
2017-02-08 19:10:47 +00:00
dan 9fcb6ddc1e Fix a build problem affecting non-amalgamation rtree builds.
FossilOrigin-Name: bb7f445ba1df53cd4a169612b18fc533016102b7
2017-02-07 14:45:18 +00:00
drh 364ca6a90e Fix SQLITE_BYTEORDER #defines in R-Tree when compiled separately from the
amalgamation.

FossilOrigin-Name: a136609c98ed3cc673c5a3c2578d49db3f2518d1
2017-02-07 13:51:48 +00:00
drh edd9bcb372 Make the cellMargin() routine of R-Tree slightly smaller and faster while also
fixing a harmless compiler warning.

FossilOrigin-Name: 07fe6228208684d579c4f6c334c90eb6262a9233
2017-02-07 12:58:38 +00:00
drh b18bf843f7 Fix a minor typo in a comment in R-Tree. No changes to code.
FossilOrigin-Name: f77ee9e941f22b0b2e88871df4466fdde9cde131
2017-02-07 00:55:47 +00:00
drh 04128ace8d Remove a small amount of unnecessary code from R-Tree.
FossilOrigin-Name: e5aea894267addb4dc9b21de24a20417b0be508a
2017-02-06 16:52:32 +00:00
drh 9630f3ba08 Remove incorrect testcase() macros from R-Tree.
FossilOrigin-Name: 853a58a75ecbd01ebbf7e07fbd8c4fc9bef54a99
2017-02-06 01:19:07 +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
drh fe05491b87 In RTREE, use an sqlite3_blob object rather than an sqlite3_stmt object
for reading content out of the %_node shadow table.

FossilOrigin-Name: 97ccf3e4de11ffea46993cb7fb7ab559b9810705
2017-02-04 14:24:05 +00:00
drh 010e312f8f Close sqlite3_blob objects on xSync rather than waiting until xCommit.
FossilOrigin-Name: 95ee745fceb4a48c683f34c404c380fe5e7d684a
2017-02-04 13:12:12 +00:00
mistachkin 07b139b8c1 Fix issues in the sha1 extension seen with MSVC.
FossilOrigin-Name: 5a0da77c22ebc7db5e63b1520d30f3ad97b9bb3b
2017-02-02 19:24:05 +00:00
drh 3accc7e1af Remove the unused pReadNode prepared statement from each RTREE object.
FossilOrigin-Name: e51dc0ec60d45cd57564735b6b2bb254a588533e
2017-02-02 16:30:25 +00:00
drh ce655a2367 Fix a potential uninitialized (though harmless) variable in RTREE.
FossilOrigin-Name: a1c74e09d63aca630d022ed074866433eed6b493
2017-02-02 16:08:27 +00:00
drh 413e207e31 The sqlite3_blob_close() interface can cause recursive invocations of
nodeBlobReset() in RTREE.  Make sure that does not cause problems.

FossilOrigin-Name: 88333441cbf26bfde2acebf2a3f75b5ebbdfb0ae
2017-02-02 15:35:54 +00:00
drh 2033d1c8ca Change RTREE so that the sqlite3_blob object is closed whenever the cursor
count drops to zero and there is not a pending write transaction.

FossilOrigin-Name: 9bb4eafe1a60176ed2e731bb7e3067c0b8a46615
2017-02-02 14:40:06 +00:00
drh 6d683c5c6e Use the sqlite3_blob interface for reading values from the %_node shadow
table in RTREE.  This is a work in progress.  There are still some minor
problems.

FossilOrigin-Name: fc4917d730b29b0bf60fea5e0166728635783e9c
2017-02-02 02:28:45 +00:00
mistachkin 6890d3e458 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 0c66cf0f0a9ada2ddcb8d61001ef791b86226416
2017-02-01 23:06:17 +00:00
mistachkin 2fa517bf2a Fix C99-style variable declaration issue seen with older versions of MSVC.
FossilOrigin-Name: 54d285464a222c59327eb6c917c1cc0125a55a27
2017-02-01 22:59:29 +00:00
mistachkin 2e52532217 Fix harmless compiler warnings seen with MSVC.
FossilOrigin-Name: 997f765bc6706769ae15f3e719354473e02bd78b
2017-02-01 22:43:08 +00:00
drh 31a1349515 Unwind the RTREE dimension loop inside of rtreeCallbackConstraint().
FossilOrigin-Name: 4854ea9c18e7d8066c90b41568d0fae97b01ea6d
2017-02-01 17:08:56 +00:00
drh 5db59b33c4 Completely unroll the dimension loop inside of cellArea() in RTREE.
FossilOrigin-Name: 3c4c0126c287f844220b65e00fec17c059fbb7c8
2017-02-01 16:41:30 +00:00
drh 0e6f67b754 Precompute the nDim2 value in the Rtree object and use that to make loops
over coordinates faster.

FossilOrigin-Name: f1f3c8cc733a05c12dd980f2dfa0ab4ccd76c04b
2017-02-01 15:49:02 +00:00
drh 03626e3812 Use compiler intrinsic functions (when available) for byteswapping in RTREE.
FossilOrigin-Name: 82fcd54a5941c20895ffc22d8009c1ebdae44eda
2017-02-01 15:24:32 +00:00
dan f62154d4ac Changes so that the pre-update hook and the sessions module work with WITHOUT
ROWID tables.

FossilOrigin-Name: 964bdc27f8f1b1db2e5c0c2a65c8156614cbe087
2017-02-01 14:10:24 +00:00
drh 14494fa712 More RTREE performance optimizations related to decoding values.
FossilOrigin-Name: c5395e7496d0cd593f5e16ee5f6719d020dc0c66
2017-02-01 02:25:28 +00:00
drh fcbd6cdb41 R-TREE optimization: unwrap the coordinate decode loop in
rtreeCallbackConstraint().

FossilOrigin-Name: 0bf7b51896ec441f62490964c7a44a3c75c6b7e2
2017-01-31 21:22:03 +00:00
dan 610e17bd91 Add a speed-test program for the sessions module.
FossilOrigin-Name: 25f1275fe3e940c1d9a7b013cb3744304b2eda1e
2017-01-31 17:31:30 +00:00
dan cb9a364390 Experimental change to invoke the preupdate hook when WITHOUT ROWID tables are
written.

FossilOrigin-Name: 856f8604c59c8fdd9bfb7d86fc0e212f091ab49a
2017-01-30 19:44:53 +00:00
dan f64ece143c Avoid redundant table b-tree cursor seeks in UPDATE statements that use the
two-pass strategy.

FossilOrigin-Name: dc555b1039c6930f6d15355c698ff917a85e8056
2017-01-28 19:45:34 +00:00
drh cc04dacb85 Add the sha1.c loadable extension that implements the sha1() and sha1_query()
SQL functions.

FossilOrigin-Name: 24e77c1cef163a9822635570b3211789ff23d5c9
2017-01-27 19:27:38 +00:00
drh 9ec82ff2ba Alternative ICU fix (compare to check-in [50e60cb4]) that avoids casting
integers to pointers.

FossilOrigin-Name: d9752c8f7c55426fd7d2b877c5cc3784f93b5349
2017-01-27 13:14:12 +00:00
drh 87f500ce43 Modify the ICU extension to use a static initializer, as VC++ complains about
a dynamic initialization.  Maybe the dynamic structure initialization is a
GCC extension.

FossilOrigin-Name: 50e60cb44fd3687dde5551d02bad60c323beaabc
2017-01-26 00:58:27 +00:00
drh 666d34c791 Fix SQLITEINT_H macro usage in two extensions.
FossilOrigin-Name: 0803390c152141c9ab4e7a28406b2a5d72a5c2fa
2017-01-25 13:54:27 +00:00
dan 1b9fd2651b Fix a problem preventing FTS5 from correctly passing the FTS5_TOKENIZE_PREFIX
flag to custom tokenizer implementations.

FossilOrigin-Name: 03c601344ed56b316bcc5fd02f6648b0009ba61b
2017-01-23 07:06:27 +00:00
mistachkin 2f31d02049 In the 'vtshim' extension, avoid accessing freed memory when handling errors from xCreate/xConnect.
FossilOrigin-Name: ffd559afd32dcdce9c733ebccdee88fda9b689cf
2017-01-19 18:20:36 +00:00
dan 25fd2e247b Fix a problem that could cause a spurious SQLITE_NOMEM error when attempting
to resume an RBU operation if the previous client failed right after
completing the incremental checkpoint. Also a "cannot vacuum wal db" error
that could occur when resuming an RBU vacuum if an error (OOM or IO error)
occurs during the incremental checkpoint.

FossilOrigin-Name: 681d96eb822e606da53700867191d4738bda20c8
2017-01-17 10:41:42 +00:00
dan ef2f5925d8 Fix a problem preventing resumption of RBU operations after recovering from a
process or system failure that occurs during the incremental-checkpoint phase.

FossilOrigin-Name: 97914266cb4ec63b0c9185ab139673139bd2f0ed
2017-01-13 18:24:37 +00:00
dan 1439a1e80f Improve handling of corrupt data in fts5.
FossilOrigin-Name: 609ac1c73f7c2b48a571c178a72383996a9538fe
2017-01-06 11:55:03 +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
dan 55092c1504 Fix an fts5 bug that could cause a crash following an OOM error or
sqlite3_interrupt() interrupt.

FossilOrigin-Name: 0ea3ece988883874bb88e3daaa220d7fc0cf36ef
2016-12-09 16:12:04 +00:00
drh c9c81dc6d7 Add the remember(V,PTR) extension function which copies an SQL value into
an application variable.

FossilOrigin-Name: d2d30914d81022d7d4e1670caf9326524520deaf
2016-11-30 16:54:52 +00:00
dan 158e4e56d7 Simplify some code in fts5_expr.c. Add some extra test cases for the same.
FossilOrigin-Name: 7cc2d60dce90b8d4dca35708e33002ae6387806e
2016-11-28 14:52:23 +00:00
dan 9c8753c0a8 Fix a problem in rtreeD.test causing it to fail in OMIT_BUILTIN_TEST builds.
FossilOrigin-Name: d6b3779e6dad038d8bc35139cf314bf1e6e91977
2016-11-17 20:05:00 +00:00
dan b3e845ba33 Fix an fts5 problem causing a crash in phrase queries where the first token of
the phrase matches one or more rows but some other token within the phrase
matches zero.

FossilOrigin-Name: e78f6f3bbf4781850960fe6741f7cba480f2c27d
2016-11-14 08:19:37 +00:00
mistachkin 58282f68d8 Fix typo in the CSV extension.
FossilOrigin-Name: b4889588246c33374ff3758e21ccc4ce246380b6
2016-11-09 01:46:13 +00:00
drh 6850a63393 Fix OOM error reporting in the json1_group_object() SQL function. Remove
an unreachable branch from the JSON1 logic.

FossilOrigin-Name: b54098491531cd26ed461275ef4aae3d3ec9065e
2016-11-07 18:18:08 +00:00
drh 27b2d1b88b Replace some unreachable branches from the JSON1 extension with assert().
FossilOrigin-Name: 145cd13e3c5a42a717807bcc13c0f7212f38bff8
2016-11-07 15:15:42 +00:00
drh ad875e7416 Fix the JSON1 extension so that the JSON validator correctly rejects malformed
backslash escapes within string literals.

FossilOrigin-Name: 7a63539169a384960e30a63e0c8e9b0f07fa431e
2016-11-07 13:37:28 +00:00
drh b1c9633493 Mark the ICU extension functions as deterministic.
FossilOrigin-Name: afbbb6c66a85ff3f4c8dce677e0892a2a51d2b8e
2016-11-04 12:03:26 +00:00
dan e43635aaa7 In the sessions module, avoid recording a change if an UPDATE statement
overwrites a column with REAL affinity containing an integer value with the same value.

FossilOrigin-Name: b861328ab9ceec6926d97658c3606e6ae9ad39bf
2016-10-21 21:21:45 +00:00
dan e24452edef Avoid using the "direct overflow read" optimization to read large blobs if the
pager layer has a wal file open - even if the database header indicates that
the db is not a wal database.

FossilOrigin-Name: b54c15f11796a75683eec4b502a22ccb87d621c6
2016-10-21 10:49:39 +00:00
mistachkin 47d00872fc Escape non-ASCII character from an ICU extension comment.
FossilOrigin-Name: 5ec02ecf3d20ce7e3f5249e9a3684f9b67a7d703
2016-10-17 18:44:11 +00:00
dan ef74652ceb Remove a stray line from session4.test causing a memory leak. No changes to SQLite code.
FossilOrigin-Name: 6624c4964b63e259d5ee006eaa7ec79ddadbd6a6
2016-10-10 14:48:36 +00:00
dan ea5e5f0b89 Fix a case in which the rtree module was ignoring an OOM while generating an error message.
FossilOrigin-Name: 788f86bebe413b5a0ab41ba3d75ba8728827a964
2016-10-10 10:06:59 +00:00
dan 642f0146d7 Fix some compiler warnings in fts5.
FossilOrigin-Name: b066637bb75959267fe6104da323c5112ad78f82
2016-10-05 20:14:29 +00:00
drh 5e769a50ad Two more typo fixes in comments.
FossilOrigin-Name: 40c0fb0af678797c39a99853f9f4102464c16f4b
2016-09-28 16:05:53 +00:00