Commit Graph

12896 Commits

Author SHA1 Message Date
dan
524a733d89 Fixes to os_unix.c to support database (and other) files larger than 2GiB on Android.
FossilOrigin-Name: ad7063aa1a0db32cdbe71815545b2edca57d3bcc
2014-09-06 17:06:13 +00:00
dan
3fdf46a16e Merge latest trunk changes with this branch.
FossilOrigin-Name: 9dca7ce55797b3eb617859f6189c1a2ec6f66566
2014-09-06 16:52:18 +00:00
dan
2ee5341288 Fixes to os_unix.c to support database (and other) files larger than 2GiB.
FossilOrigin-Name: e7fae33c0754488336ce093189a83dfe1b818d89
2014-09-06 16:49:40 +00:00
peter.d.reid
60ec914c74 Fix typos in comments. No code changes.
FossilOrigin-Name: e62aab5e9290503869e1f4d5e0fefd2b4dee0a69
2014-09-06 16:39:46 +00:00
drh
60da72741a Do not require a page-size change if the attempt to change the page size
failed due to an OOM error.

FossilOrigin-Name: 4d4fb197dc438a486cf5d967cf435f1132902c63
2014-09-06 03:38:51 +00:00
drh
44ee1dc843 Add the sqlite3_memdebug_title_count global variable, used during debugging
to count the number of invocations of test_memdebug_settitle.  By examining
this variable in the debugger after a segfault, one can then set a breakpoint
on test_memdebug_settitle that will fire just before the problem.

FossilOrigin-Name: 27e3ca3e0f1da54e3527704a8601bb9003b086bf
2014-09-06 03:16:28 +00:00
mistachkin
6b9da12856 Fix a couple of typos in comments. No changes to code.
FossilOrigin-Name: a758465e3cfa7e0cb8749d097cd6fb5f86b60955
2014-09-06 02:00:41 +00:00
drh
d8b77e20fc Query planner heuristic update:
When doing a full table scan on a table that has an equality constraint on
an unindexed column, do not allow the estimated number of output rows to
be greater than half the total number of rows in the table.

FossilOrigin-Name: 73954f93c4c6f880c6e01d0d130e3fed40fd4106
2014-09-06 01:35:57 +00:00
mistachkin
30c633a097 Fix harmless compiler warning.
FossilOrigin-Name: 733119067757814609a9cea6b975818607bee4e3
2014-09-05 05:58:37 +00:00
drh
f8ede57a61 Update comments in the ANALYZE command that describe how the Stat4Accum
objecct is passed around within the VDBE.  No changes to functional code.

FossilOrigin-Name: 9779c7a9eb1e2bd36e9286331a9314f064014d80
2014-09-01 23:06:44 +00:00
drh
975e076681 Avoid a confusing (though correct) argument to the sqlite3_result_blob()
function in the implementation of ANALYZE.

FossilOrigin-Name: 4cae93f8ae8fb3fe38fd5dc7d3a5ea0d11552841
2014-09-01 22:34:54 +00:00
mistachkin
832436d145 For sqlite3_win32_is_nt(), assume WinRT is NT-based and revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available.
FossilOrigin-Name: be0a037244762cc0f5ff4a6d7822902f862767bd
2014-09-01 19:29:19 +00:00
drh
54d7518746 Tweak the documentation for SQLITE_LIMIT_WORKER_THREADS. No changes to
executable code.

FossilOrigin-Name: 672e7387b1bda8d007da7de4244226577d7ab2dc
2014-09-01 18:21:27 +00:00
drh
0f8f26716c Add support for using separate worker threads to speed large sorts.
The SQLITE_MAX_WORKER_THREADS and SQLITE_DEFAULT_WORKER_THREADS compile-time
options and the SQLITE_LIMIT_WORKER_THREADS argument to 
sqlite3_limit() and the "PRAGMA threads=N" pragma are added.

FossilOrigin-Name: b1c0f0bc1bd8a3477cd7a7ab510f0442ac88b517
2014-09-01 17:36:46 +00:00
drh
19541f3018 Attempt to make the xDelete method of the unix VFS more robust on VxWorks.
FossilOrigin-Name: b0f6b91f36b503d8ba8d5257bb194f8c1afb4833
2014-09-01 13:37:55 +00:00
drh
ee6438df0b Micro-optimizations in sqlite3BtreeNext() and sqlite3BtreePrevious().
FossilOrigin-Name: 839c7996eecd5480152c514555b9aa1121a69ce0
2014-09-01 13:29:32 +00:00
mistachkin
31970cca38 Fix harmless compiler warnings for MSVC.
FossilOrigin-Name: 3ef3246120d72dffe469733bb21667a548af0a44
2014-09-01 01:16:49 +00:00
drh
44dec87538 In the command-line shell, added options --lookaside, --pagecache, and
--scratch used to configure auxiliary memories.

FossilOrigin-Name: f61db04be4d7fb21b7f721647c37c45e283ffbea
2014-08-30 15:49:25 +00:00
drh
6b2129aaaf Disable worker threads when SQLITE_THREADSAFE=0. Set the default compile-time
maximum number of worker threads to 8 and honor the
SQLITE_DEFAULT_WORKER_THREADS compile-time constant (which defaults to 0).

FossilOrigin-Name: 33fa0410499900dd8beb44b9a8ffbd9f4b68c8d8
2014-08-29 19:06:07 +00:00
drh
43cbe14378 Fix the speedtest1.c test program to set the worker thread count using
the threads pragma.

FossilOrigin-Name: 2ab4b5adc60b52bf2d2b79968d226b8dd7d2ab3b
2014-08-29 18:06:33 +00:00
drh
111544cbb4 Add SQLITE_LIMIT_WORKER_THREADS for controlling the maximum number of
worker threads.

FossilOrigin-Name: 1b598c68f32db635d1cea1373bedc434aa60cf08
2014-08-29 16:20:47 +00:00
drh
503ae86508 Merge recent performance enhancements from trunk onto the threads branch.
FossilOrigin-Name: 35c44a3c73e2e8b14ff194c41986f4bdb9dfe737
2014-08-29 14:40:07 +00:00
drh
46048d2f24 Note a fault after all, rather a testing mistake.
Move this change back to trunk.
Was: Avoid an unnecessary OP_Move operation for expression subqueries.

FossilOrigin-Name: 2a74129a21f9745f1363f844807e2d10201a3f40
2014-08-29 14:20:46 +00:00
drh
53932ce8fa Avoid an unnecessary OP_Move operation for expression subqueries.
FossilOrigin-Name: 462f42af52f146fd328ddcbbe78c8444ef7bd2c3
2014-08-29 12:29:39 +00:00
drh
ae914d783a Improved WHERETRACE messages for the estimated output row reductions from
range scans.

FossilOrigin-Name: fdd478bb11eb9e244a7a1fb628ac27c53830fb24
2014-08-28 19:38:22 +00:00
drh
defb8223b4 Fix a problem causing an inaccurate stat4-based estimate for the
number of rows visited by a range scan.

FossilOrigin-Name: a9daf3ac444b896013f4054051937d49a597624a
2014-08-28 17:30:28 +00:00
drh
b34fc5be6d Add a testcase() macro to help verfity the row estimation logic.
FossilOrigin-Name: 6ba609522ea7325341fad93bdb5f869c6506dea4
2014-08-28 17:20:37 +00:00
dan
7fa0631ece Fix a problem causing an inaccurate stat4-based estimate for the number of rows visited by a range scan.
FossilOrigin-Name: 052d89b554a947b7e420b7feb6650f5069b7cefa
2014-08-28 16:01:31 +00:00
drh
5418b1298f Fix a formatting error ("%d" needed in place of "%g") on a WHERETRACE
macro inside of the query planner.  This fix applies to debugging logic
only.

FossilOrigin-Name: c931ca2b7763cf894ece26ca4775d638876107e9
2014-08-28 13:42:13 +00:00
drh
bc59ac0e26 Refactor the sqlite3PcacheFetch() routine into three separate routines,
which are significantly faster overall and about 100 bytes smaller in
size as well.

FossilOrigin-Name: bdb6e4978d1a26d5f795262172605184264ede9c
2014-08-27 23:18:01 +00:00
mistachkin
a1dc42aa91 Add a VDBE synopsis comment for clarification.
FossilOrigin-Name: 029a6dc744c24e7be482298c678af8a115d6a87b
2014-08-27 17:53:40 +00:00
dan
54ae4e3179 Add a missing ticket number to a comment in index7.test.
FossilOrigin-Name: d8b1c4336145d436241863c3525530e24a24799b
2014-08-27 17:48:15 +00:00
dan
0829169f1e When determining whether or not a partial index is usable, do not assume that the cursor number assigned to each table in the query is the same as its index in the FROM clause. Fix for ticket [98d973b8f5].
FossilOrigin-Name: fcebca166f15431764b82a8b267f11d28386e975
2014-08-27 17:37:20 +00:00
drh
9bd038f12e In the sqlite3_context object, keep a pointer to the result value rather
than storing the result value in the sqlite3_context object and using
memcpy() to move the value back into its register
after the function returns.  This runs faster and saves over 500 bytes
of code space.

FossilOrigin-Name: 6c1ee3e388eb110de815270467b1e50592c0ba6c
2014-08-27 14:14:06 +00:00
drh
6c9f8e67de Factor out the exception paths from sqlite3ValueToText() into a separate
function so that the main routine is much faster for the common case of
no required type or encoding conversions.

FossilOrigin-Name: 1624916c6e9bc5dbcfa146b316a99ac8fecb13a9
2014-08-27 03:28:50 +00:00
drh
b63388b6a4 Performance enhancement in sqlite3VdbeMemNulTerminate().
FossilOrigin-Name: f94cacc393e895522b92c9717c53357afc918d60
2014-08-27 00:50:11 +00:00
drh
c3031c61ef Change the page cache so that a new sqlite3_pcache object is allocated as
soon as the page cache is opened, not delayed until the first fetch request.
This give a noticable performance boost.  The interface between pager and
the page cache has changed slightly, which might break ZIPVFS.

FossilOrigin-Name: f1f94a971e031e784f8c30a6faf829df58709329
2014-08-26 15:06:49 +00:00
drh
028696c4cc Remove the SQLITE_CONFIG_WORKER_THREADS configuration parameter. The number
of worker threads in the sorter is now determined only by the
PRAGMA threads=N setting.

FossilOrigin-Name: e3305d4b4efcbe06945ce7f6ec0f2e864244aaf9
2014-08-25 23:44:44 +00:00
drh
6c4ec84256 Merge the CAST operator enhancements from trunk.
FossilOrigin-Name: 6c8f86e4e08d5d57e21496277613e0f9dcc06514
2014-08-25 22:43:17 +00:00
drh
05bbb2e824 Add an assert() and five testcase() macros to the OP_Cast opcode implementation
to help verify that it is fully tested.

FossilOrigin-Name: af364cce9da0961593ef876b646197f82df08ad5
2014-08-25 22:37:19 +00:00
drh
ec3e4f753b Minor changes to the CAST logic to make it more testable.
FossilOrigin-Name: 1ad70ec550c004160d9c0c57e6c416812cdead5e
2014-08-25 21:11:01 +00:00
drh
21b0e73354 Test cases added for using unary "+" and CAST operators on the RHS of range
constraints and verifying that STAT3/4 can use those constraints.

FossilOrigin-Name: 42505e5a810832442699ca54a46637c50e7f9e71
2014-08-25 20:21:07 +00:00
drh
4169e430a2 Allow CAST expressions and unary "+" operators to be used in the DEFAULT
argument of an ALTER TABLE ADD COLUMN and to be understand on the RHS of
range constraints interpreted by STAT3/4.  This involves a rewrite of the
implementation of the CAST operator.

FossilOrigin-Name: 91d8a8d0b792ea5c4fe68fd9caaf3345eddea486
2014-08-25 20:11:52 +00:00
dan
f741e0491e In cases where stat4 data is available but cannot be used because the rhs of a range constraint is too complex a expression, fall back to using the default estimates for number of rows scanned.
FossilOrigin-Name: e06dc6f0c35f87c44292c71677111b74f073a5c4
2014-08-25 18:29:38 +00:00
drh
034596153d Query or change the maximum number of worker threads allowed on each
database connection separately using the "PRAGMA threads" command.

FossilOrigin-Name: 29c5e8a7c9d7ce349a1e1d72082d23450e877b45
2014-08-25 15:13:22 +00:00
drh
4d015c6902 Merge the recent performance enhancements implemented on trunk into the
threads branch.

FossilOrigin-Name: dfdc900f5d1a31ee5c5f35a630c4a8253e69093b
2014-08-25 13:27:02 +00:00
drh
c137807a87 Remove the pager_lookup() function since it is redundant with
sqlite3PagerLookup().

FossilOrigin-Name: 54164ce47cfc3ad5dd8797114e4ba78811f23bef
2014-08-25 11:33:41 +00:00
drh
12b7c7d8c3 Change the name of the VdbeMemRelease() macro to VdbeMemReleaseExtern() to
more accurately reflect what it does.  Performance enhancement to the
sqlite3VdbeMemRelease() function.

FossilOrigin-Name: 3ca5846da7da5e08192a4c96288197be3b7ab6f7
2014-08-25 11:20:27 +00:00
drh
4274dae9e9 The sqlite3VdbeChangeEncoding() routine goes about 3x faster if the
sqlite3VdbeMemTranslate() subroutine is not inlined.

FossilOrigin-Name: 0c7e1b875a14ff9d71af7bb125a0272a23d57353
2014-08-24 02:53:23 +00:00
drh
f063e08fd9 Patch the sqlite3PagerWrite() method in the Pager to run a bit faster.
FossilOrigin-Name: c63311e2f3344363a5ed99838fb5850004eaee30
2014-08-24 01:32:43 +00:00
drh
efbf044583 Faster implementation of pcache1Fetch()
FossilOrigin-Name: 0371cc3bb07448bcd64fd671f3e71bb7f30deb4d
2014-08-23 23:15:31 +00:00
drh
b50c65d561 Faster implementation of the sqlite3ApiExit() routine.
FossilOrigin-Name: bd41d394d48516eb7d8ddc46abdcb427aa80173e
2014-08-23 20:25:53 +00:00
drh
b4586f1254 Another memory allocator performance optimization.
FossilOrigin-Name: 6da6f46d0c43e3b68c21f514ddf8ee663c20f249
2014-08-23 19:42:06 +00:00
drh
3bdffddc41 Fix a variable-declaration after code problem in btree.c. Harmless in
GCC and CLANG but unacceptable for MSVC.

FossilOrigin-Name: 45abd5c0bad2847861f3b26a7040490aa9bb1332
2014-08-23 19:08:09 +00:00
drh
3ccd5bf89e Changes to sqlite3ScratchMalloc() that make the entire memory allocation
interface a little faster and about 100 bytes smaller.

FossilOrigin-Name: f83daa16f65ef35062412e88c214852a4aeb3da2
2014-08-23 19:04:55 +00:00
drh
9de4a17185 Make the implementation of the sqlite3_aggregate_context() interface faster
for second an subsequent invocations.  This helps all aggregate functions to
perform better.

FossilOrigin-Name: 802148f3110462eac939d53ce08eb9a2f6aac739
2014-08-23 18:17:19 +00:00
drh
f1a89ede4a Improved performance in the type handling of arithmetic operators in the VDBE.
FossilOrigin-Name: 0c0a603950c97837442d82886f947aab0acbd805
2014-08-23 17:41:15 +00:00
drh
bd9507c8da Performance optimization in the applyAffinity() logic inside the VDBE.
FossilOrigin-Name: 25f2246be404f38b4f8dd70397cd1454d46358c4
2014-08-23 17:21:37 +00:00
drh
6848dad894 Another performance tweak: Split the sqlite3BtreeCursorHasMoved() routine
into two with the second routine named sqlite3BtreeCursorRestore().  The first
now only reports whether or not the cursor has moved and the second tries to
restore the cursor.  This allows the sqlite3VdbeCursorMoveto() routine to be
refactored to avoid stack pointer movements, for a noticable performance gain.

FossilOrigin-Name: ce123b5c592556a8cd38b01fcc91ba76231d3098
2014-08-22 23:33:03 +00:00
drh
637f3d83b9 Factor the saveAllCursors() routine of btree.c into two separate routines,
for a noticable performance improvement.

FossilOrigin-Name: 3eb084390382c108e9b0ff0b29dede58ebb149bc
2014-08-22 22:26:07 +00:00
drh
75e2a2d362 Performance enhancements in the b-tree mutex logic.
FossilOrigin-Name: 8914530644f938a7a98e25ea1fb0bca1f9d79101
2014-08-22 21:58:10 +00:00
drh
a8dcba9199 Combine the pcacheAddToDirtyList() and pcacheRemoveFromDirtyList() routines
into a single pcacheManageDirtyList() routine.  The resulting binary code is
slightly faster and a few bytes smaller.

FossilOrigin-Name: 6bcf1af6a48dbda5ac6f6b3b02810bdfc4730000
2014-08-22 20:35:29 +00:00
mistachkin
31753c833d Revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available.
FossilOrigin-Name: 9fe0f0754c063c17fffa9d4814b7180397cf5226
2014-08-22 19:12:16 +00:00
drh
2f2b2b8580 Performance enhancement in sqlite3PutVarint().
FossilOrigin-Name: a929be551924144c9bc7aab608404d59e479abb5
2014-08-22 18:48:25 +00:00
drh
13f40da31d Split the sqlite3Error() routine into sqlite3Error() and
sqlite3ErrorWithMsg(), for a slight size reduction and performance increase.

FossilOrigin-Name: cf561d1f0bb60b3d638632d20bd686dda4fa4a04
2014-08-22 18:00:11 +00:00
drh
172087fb73 Performance improvement in the printf() logic by avoiding unnecessary stack
pointer movement.

FossilOrigin-Name: f7f2160db014f0ae11ad13c8ad70ad3444124e3e
2014-08-22 15:40:20 +00:00
drh
738d190dd8 Improve the performance and reduce the size of the sqlite3VdbeSerialGet()
routine by avoiding the use of stack.

FossilOrigin-Name: ebc10e46c15017d7cd232b5f4f3ef67ef740d87f
2014-08-22 15:19:59 +00:00
drh
8932becbef Handle the 4-byte integer case in the stackless routine.
FossilOrigin-Name: 3f55484e81000c75e231f5580632a68e782ded4f
2014-08-22 14:56:13 +00:00
drh
14a924a5cd Get the sqlite3VdbeSerialGet() routine to run faster by avoiding the use
of local variables.

FossilOrigin-Name: 8267d82174099e548a4f78d06af0c6324c89b83d
2014-08-22 14:34:05 +00:00
drh
3f5b199eb5 Change a while-loop into a do-loop in sqlite3VdbeSerialPut() for a small
size reduction and performance improvement.

FossilOrigin-Name: 750bb0a0960606ab24037e0992e9f7a17524cc3e
2014-08-22 13:22:32 +00:00
drh
5ab567078a Enhance the spellfix extension with the ability to specify a rowid when
inserting new rows.

FossilOrigin-Name: 369c480cda6fa66394b995346bbf51f3298446e1
2014-08-22 11:11:30 +00:00
drh
acbcb7e013 Simplify the interface to the symbol table, saving 600 bytes of code space.
FossilOrigin-Name: 14b0f561fe15622b61c6676c9c455dca6b9ba5f0
2014-08-21 20:26:37 +00:00
mistachkin
cf4200a170 For sqlite3_win32_is_nt(), assume WinRT is NT-based.
FossilOrigin-Name: 2f59e71fbf31d2bd788d11197943b2ff3f4046e1
2014-08-21 19:11:17 +00:00
drh
b6b4b79f34 Fix a faulty assert() statement. Add comments to clarify the behavior of
the sqlite3OpenTableAndIndices() routine in insert.c.  Add test cases to
verify that the assert() statement is not firing inappropriately.
Ticket [369d57fb8e5ccdff06f1].

FossilOrigin-Name: 7029b3404d3f5f698a496934f3a3f2972051b257
2014-08-21 14:10:23 +00:00
drh
b614eab3d2 Increase the version number to 3.8.7
FossilOrigin-Name: 91594aae0725388765070c80039dfe1bf126392d
2014-08-20 23:42:50 +00:00
drh
f3f69ac942 Enhancements to skip-scan such that it is operable when a middle column of
an index is skipped while the left-most column is constrained in the WHERE
clause.

FossilOrigin-Name: bc985caa7816f1f873ad8e4467c5278399f315ce
2014-08-20 23:38:07 +00:00
drh
7bc4c454da A small performance improvement in freeSpace() by special-casing the
relatively common case of an empty freelist.

FossilOrigin-Name: 49f44d355ff70744e4951baca2481c7c2b6c02b3
2014-08-20 18:43:44 +00:00
drh
5f5c753efb Reimplement the freeSpace() routine in btree.c so that it runs faster.
FossilOrigin-Name: fe4fd014b42b7b158ca968f1535b5636c67769f6
2014-08-20 17:56:27 +00:00
drh
7fb91646b5 Refactor local variable names in the freeSpace() routine of btree.c for
improved understandability.

FossilOrigin-Name: 7e63089a191f29aefde05e89bb612f3036cfa034
2014-08-20 14:37:09 +00:00
drh
a13d5072c4 Size reduction and performance improvements in btree.c and the
allocateSpace() routine.  Also fix an assert() in freeSpace().

FossilOrigin-Name: 121308fa869ad490a6924798d276c0ff32759acc
2014-08-20 13:35:45 +00:00
drh
fb90841adf Add SQLITE_API macros in front of interface routines in the test_intarray.c
extension.

FossilOrigin-Name: eea0661798e10018615854c871f24be0f8bb2ff9
2014-08-20 13:25:06 +00:00
drh
905552628c Change an assert() added by the previous commit into a testcase().
Fix a separate assert() in btree.c:freeSpace().

FossilOrigin-Name: fe51d3aa0ce7021213293a0647e31164073e78f7
2014-08-20 13:17:43 +00:00
drh
4c04f3c8bd Further size reduction and performance improvement in btree.c:allocateSpace().
FossilOrigin-Name: 1cb1cd64930a6bc371143f7d2e77eb1c51498cb0
2014-08-20 11:56:14 +00:00
dan
53d89cdfe9 Fix a typo in the showdb usage message.
FossilOrigin-Name: 6c66beae97ba1799c908d3a33371dedbc7f3f58c
2014-08-20 10:42:16 +00:00
drh
75b31dc9ad Minor performance improvement and size reduction for the btree-page space
allocator.

FossilOrigin-Name: 73637d12e31f5489efe37d8cf4ab50a1911d4c75
2014-08-20 00:54:46 +00:00
drh
dfd1547b48 Modify the memsubsys1-3.1.4 test so that it does not fail arbitrarily due
to variations in the behavior of system malloc().

FossilOrigin-Name: d280157da0b5275f3e3c875d2dcfb9998d374ac0
2014-08-19 23:04:49 +00:00
drh
5f58ae75c9 A better fix for the sqlite3_trace() problem.
Ticket [11d5aa455e0d98f3c1e6a]

FossilOrigin-Name: 44d5bd4cc3f76e9a151ba0abae1092bd184af264
2014-08-19 20:41:36 +00:00
drh
2c7946a485 Make sure the sqlite3_trace() callback is invoked, even if the prepared
statement was marked "expired" before it ever entered sqlite3_step().
Ticket [11d5aa455e0d98f3c1e6a08].

FossilOrigin-Name: 0d4d3df4bc5e75ce1543b5539a1e9e279d2a062f
2014-08-19 20:27:40 +00:00
drh
4b2590e44b Improvements to output formatting with the ".trace" command in the
command-line shell.

FossilOrigin-Name: d09d63c07748839e9b778a769b183bdd614c6c13
2014-08-19 19:28:00 +00:00
dan
edf5b1657d Minor changes to do with the Tcl tea extension package autoconf system.
FossilOrigin-Name: f10a6111262ce6ee6984c64fa0e0023642eca27d
2014-08-19 09:15:41 +00:00
drh
dcd87a9dd3 Refactor the names of state objects in the command-line shell implementation..
FossilOrigin-Name: 11a70e1ae7f05d06e4e09c9d20db0444b8881584
2014-08-18 13:45:42 +00:00
drh
ef1d614b90 Fix compiler warnings on WinCE.
FossilOrigin-Name: 28a379fcd43389ad3249eff51a621d0bb7c81640
2014-08-15 16:13:07 +00:00
drh
8d09dfe8f3 Merge the 3.8.6 release into the threads branch.
FossilOrigin-Name: 05807c4122505567ec64fb2d142077f48a0a10b1
2014-08-15 15:46:21 +00:00
drh
932de71e39 Version 3.8.6
FossilOrigin-Name: 9491ba7d738528f168657adb43a198238abde19e
2014-08-15 11:46:33 +00:00
dan
f216e324f9 Fix an assert that can fail if the database file is corrupted.
FossilOrigin-Name: 3f45b8192dad7fb1f027cbaa694046e3c1b3e278
2014-08-14 19:53:37 +00:00
mistachkin
ce64d61050 Fix compiler warnings on WinCE.
FossilOrigin-Name: cc910b8e0c45e7387024f3a729003e2fef08b198
2014-08-14 18:31:56 +00:00
drh
83b25d32d7 Merge the pre-3.8.6 changes into the threads branch.
FossilOrigin-Name: a608fd1d52606a009c3acc7f1d184b86a7df3c82
2014-08-14 14:02:48 +00:00
drh
4ed2fb9d84 Fix typos in comments used to help generate documentation. No changes to code.
FossilOrigin-Name: 13a2d90a2869c53b79754de39045bbbdbc7688e3
2014-08-14 13:06:25 +00:00
mistachkin
cf4312c9ad Add icon to the Windows shell executable. This is a resource change only, no changes to code.
FossilOrigin-Name: f5cce9db109a2bbe9a05b4c01b076a51d5fad8ba
2014-08-14 02:59:51 +00:00
drh
bd9455457a Minor change to unixDelete for VxWorks with a DOS filesystem.
FossilOrigin-Name: f01d42cc8b00d2b7c4f14defcb05fdc493cf1bfd
2014-08-13 11:39:42 +00:00
dan
299b24688a Fix where9.test so that it works with the "no_optimization" permutation.
FossilOrigin-Name: d46adf9d8f741838b9c30f915231d6a3986c3591
2014-08-12 20:13:22 +00:00
mistachkin
4eb4fefe2d Fix compilation issue in the Win32 VFS when manually defining SQLITE_WIN32_NO_ANSI.
FossilOrigin-Name: 6715991296886c2a02b9a285a1e61189ad1f79c0
2014-08-12 16:13:37 +00:00
drh
81e069eee5 Improve the comments associated with SQLITE_TEST_REALLOC_STRESS and add
an extra assert() to prove an assumption.

FossilOrigin-Name: 35c454616321d480ecbc4efdf6869bbcdf0d3aa2
2014-08-12 14:29:20 +00:00
dan
d79d27aeda Run a test with TEST_REALLOC_STRESS and OMIT_LOOKASIDE defined as part of releasetest.tcl on Linux/x86-64.
FossilOrigin-Name: a1baf3a7b177728cdfcd6d9345a0d6bf0a8887c0
2014-08-12 14:06:13 +00:00
dan
76ccd89d13 If SQLITE_TEST_REALLOC_STRESS is defined, extend the op-code array used by virtual-machine programs by one element at a time, instead of doubling its size with each realloc().
FossilOrigin-Name: 4c291827224b84487a38e7ccba2edabc0f15b5ba
2014-08-12 13:38:52 +00:00
drh
61ffea5490 Fix typos in the VxWorks code of os_unix.c.
FossilOrigin-Name: 19682e8fdc4a3b7884dba3e4387763e435ec16e6
2014-08-12 12:19:25 +00:00
dan
793bd861fe Add a test to ensure that the problem fixed by [a179e41e40] does not recur.
FossilOrigin-Name: 31356f2cae26278660e6bd360ad35e57261d977c
2014-08-12 09:36:08 +00:00
drh
fcf2a7757e Fix an assert() statement in the SELECT code generator that was
incorrect following an OOM error.

FossilOrigin-Name: a179e41e40dba4c19a488985f77777acd27b689d
2014-08-12 01:23:07 +00:00
mistachkin
f0740a947d Modify GetVersionEx Win32 VFS fix for use with the test suite.
FossilOrigin-Name: fd2221768b45d9006bbb2919a4977cf2791826d6
2014-08-11 17:51:23 +00:00
drh
e5e20d354d Further clarification and typo fixes for the previous comment change.
FossilOrigin-Name: 87ef9e2f293afd89901fed6be45b0f0052df6846
2014-08-11 17:41:53 +00:00
drh
c96c7e3c15 Clarify the comment explaining the meaning of the SQLITE_WIN32_GETVERSIONEX
macro in the Windows VFS.

FossilOrigin-Name: 69714287dbbdbf4ef2a2c5e99ed740ae7d27e051
2014-08-11 17:40:30 +00:00
mistachkin
91d1249748 Fix for #ifdef issue with GetVersionEx in the Win32 VFS.
FossilOrigin-Name: 1a0d466dd48163c86de4774035fe4a30c1c55311
2014-08-11 17:38:38 +00:00
drh
9f959b07de Add a few more requirements tests.
FossilOrigin-Name: b5652439d5d770f0edeb80c8f55fa7cc515482e3
2014-08-11 17:37:27 +00:00
drh
ddb17cae38 Updates to evidence marks and requirements. No changes to code.
FossilOrigin-Name: 62d38308b519a5362f559b296a0cf1acccf8f673
2014-08-11 15:54:11 +00:00
drh
490fe86f1a Fix harmless compiler warnings.
FossilOrigin-Name: 52b03f045edf6fc29f9ba9a5cac53a59f0feb0eb
2014-08-11 14:21:32 +00:00
drh
91be7dc320 Changes that will perhaps enable SQLite to work better on VxWorks.
FossilOrigin-Name: de27c742c0dcda20b51339598bf6094a8dcf5fb9
2014-08-11 13:53:30 +00:00
drh
e8a537eea7 Update requirements marks. No changes to code.
FossilOrigin-Name: 7556bd9aa5db1b9cd92d0e48effcda9fe96f3128
2014-08-08 18:26:20 +00:00
drh
ee5141de47 Improvements to the way the query planner handles sorting costs, so that
very large sorting costs do not overwhelm the loop costs.

FossilOrigin-Name: bdaa6947371a60a31b6a13267b0ba6e46df2a8ce
2014-08-08 17:49:55 +00:00
dan
e2c278513d Fix a buffer overrun in the previous commit.
FossilOrigin-Name: 43c59c85436dc8001c81f4aac7f5231b13d741cb
2014-08-08 17:25:33 +00:00
dan
50ae31e6f6 Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the same problem as addressed by [2af630c572].
FossilOrigin-Name: 299b9570279ded7158d22349ef93384286a5c755
2014-08-08 16:52:28 +00:00
drh
3c19bbea0a The SQLITE_IOERR_BLOCKED extended error code is not longer used, so remove
assert() statements and documentation for that error code.  Also make other
documentation improvements.

FossilOrigin-Name: 36b7c5cefcad6bad044806092593c84876fee8bc
2014-08-08 15:38:11 +00:00
drh
1d8ba02445 Reworking the documentation on integer result codes. This is a comment
and documentation change only.  There are no changes to code.

FossilOrigin-Name: 54f1df7b63166f14b2f0d5955c546820e5cbdec9
2014-08-08 12:51:42 +00:00
drh
b562f63c1b When the estimated sorting cost overwhelms the estimated lookup cost, ensure
that lookup costs are still taken into account when selecting a lookup
algorithm.

FossilOrigin-Name: 2af630c5720a4d71f22a952af29346a09bd8dfd0
2014-08-07 20:42:33 +00:00
drh
f2a90306ca Clarify the computation of compatible isOrdered by in the plan solver of
the query planner.

FossilOrigin-Name: b5e8fd575a80334160de0aac8084ed5cd28816a5
2014-08-07 20:37:01 +00:00
drh
b28ce65f45 Remove the extraneous debugging printf() from the previous check-in.
FossilOrigin-Name: 8f04d2c0084afa6381e78847c9aa296498d448cb
2014-08-07 20:25:37 +00:00
drh
ddef5dc044 When the estimated cost to do a sort overwhelms the estimated cost to do
individual table lookups, make sure that the table lookup costs are still
taken into consideration when selecting the lookup algorithm.

FossilOrigin-Name: ec5d84ba69c100d9565425ed74040a49e410ea03
2014-08-07 16:50:00 +00:00
drh
858b638d1f A couple more harmless compiler warnings eliminated.
FossilOrigin-Name: bcf6d775f90f4d1ba018a1b965f2f710df130f01
2014-08-06 18:50:51 +00:00
drh
e8f2c9dc71 Fix two more harmless compiler warnings. Make sure the fts3_unicode2.c file
is in sync with mkunicode.tcl.

FossilOrigin-Name: a2a60307ea68a3230952a56cb65369ba0a208967
2014-08-06 17:49:13 +00:00
drh
5402710b0b Fix harmless compiler warnings. In the command-line shell, report if the
".system" command returns a non-zero result.

FossilOrigin-Name: 1202e9771f6d699dbf5268368108a3527d06d799
2014-08-06 14:36:53 +00:00
drh
ede7ae31f1 Fix an obsolete comment in the func.c source file. No changes to code.
FossilOrigin-Name: 5c6bb57d90bad32785d6d9cdf110a825bbc5ec73
2014-08-06 11:58:40 +00:00
drh
2abe6a281c On the windows VFS, do not try to make InterlockedCompareExchange an
overloadable function, since sometimes it is a macro.

FossilOrigin-Name: ab1a751e1304749bef5bc5c833f9abed8950f7d0
2014-08-06 11:57:54 +00:00
mistachkin
17835a5443 In the Win32 VFS, work around InterlockedCompareExchange() being a macro on some platforms (e.g. x64).
FossilOrigin-Name: 7be244ce129d6502f3a3e3f3e8a1dd61ef71d878
2014-08-06 03:06:01 +00:00
drh
da2e5862d1 Merge all recent changes from trunk.
FossilOrigin-Name: a353a8515fb2eff86042d0c33e39772f4d04e0b3
2014-08-06 02:03:35 +00:00
drh
bc5cf3813e Fix typos in the opcode documentation. Comment changes only. No changes
to code.

FossilOrigin-Name: 717245d48714c08156c9b7636aaa6c3a402bad66
2014-08-06 01:08:07 +00:00
drh
0c4de2d96d A simpler fix for ticket [3a88d85f36704eebe1] - one that uses less code.
The error message is not quite as good, but as this error has apparently
not previously occurred in over 8 years of heavy use, that is not seen as
a serious problem.

FossilOrigin-Name: 0ad1ed8ef0b5fb5d8db44479373b2b93d8fcfd66
2014-08-06 00:29:06 +00:00
drh
1cfc9aa993 Ensure that aggregate functions are not used when evaluating a default
value for a table column.
Candidate fix for ticket [3a88d85f36704eebe134f7].

FossilOrigin-Name: 29ba812825bf06ef230f2480bba0579653f0a52d
2014-08-05 21:31:08 +00:00
drh
42191f6248 Add the ability to evaluate IN operators as a sequence of comparisons as
an alternative to the long-standing algorithm of building a lookup table.
Use the new implementation in circumstances where it is likely to be faster,
such as when the RHS of the IN changes between successive evaluations.

FossilOrigin-Name: 952868216854e8355edf57af62bd1a6bcb70ce61
2014-08-05 19:16:22 +00:00
drh
2c5e35ffd1 Rename the internal Schema.flags field to Schema.schemaFlags.
FossilOrigin-Name: 5ae80b3c8f032528359c8c762505ce24da8db96f
2014-08-05 11:04:21 +00:00
drh
4336b0e64a Improved VdbeCoverage() macros. A few minor simplifications to generated
VDBE code.

FossilOrigin-Name: 01f60027ad1841051fa493a646141445f8971357
2014-08-05 00:53:51 +00:00
drh
2c3ea0694f Part of the change in the previous check-in was incorrect and can result
in an incorrect UPDATE for WITHOUT ROWID tables.  This check-in fixes the
problem.

FossilOrigin-Name: ee5f6eae57a656d09a4b3f7fbef664b2c696ddb4
2014-08-04 21:26:58 +00:00
drh
7248a8b2b9 Further enhancements to IN-operator processing.
FossilOrigin-Name: 7fdf26da1d2f40b80f9e44ff6f5af22ace8f95f3
2014-08-04 18:50:54 +00:00
drh
a976979b6e Refinements to the enhanced IN-operator logic.
FossilOrigin-Name: 92ba2821468ecbfac2469161d81c873de67b2243
2014-08-04 16:39:39 +00:00
drh
bb53ecb1db Enhancements to the code generator for the IN operator that result in much
faster queries in some cases, for example when the RHS of the IN operator
changes for each row of a large table scan.

FossilOrigin-Name: 436e884215e2b33ca3fbb555362237b12827c07a
2014-08-02 21:03:33 +00:00
mistachkin
16d511a664 Remove (newly) incorrect preprocessor check to fix build on WinRT.
FossilOrigin-Name: ba7826542908eac2e14789d183d0b3e35b143fed
2014-08-02 20:44:13 +00:00
drh
4c259e9f40 A better comment on the generated code for the NULL-in-RHS-of-IN detection
logic.

FossilOrigin-Name: 9bc1c730a366e75b760b58e7a343d39165b2a469
2014-08-01 21:12:35 +00:00
drh
6be515ebe0 Improved detection and handling of NULL values on the RHS of a IN operator.
FossilOrigin-Name: 468e730036edac22cfeb9ea3515aa16e6bcd6650
2014-08-01 21:00:53 +00:00
drh
e21a6e1dfe Remove an unnecessary OP_Null in the IN-operator logic. Attempt to clarify
comments explaining the IN-operator code, though it is not clear that the
comments are correct even yet - more work to be done.

FossilOrigin-Name: c11e55fabbc718cb324ecd3540453c25db98f50c
2014-08-01 18:00:24 +00:00
drh
5c3e9cf9de Clean up the IN operator code generation logic to make it easier to reason
about.  In the process, improve code generation to omit some unused OP_Null
operations.

FossilOrigin-Name: 7c6fbcfe6ed5739e8e4639b7b123fbf9828cbfc0
2014-08-01 15:51:36 +00:00
drh
e80c9b9ad5 The idea of coding IN operator with a short list on the RHS as an OR expression
turns out to be helpful.  If the list is of length 1 or 2, the OR expression
is very slightly faster, but the ephemeral table approach is clearly better for
all list lengths greater than 2.  Better to keep the code simple.

FossilOrigin-Name: e13175d3579e1045165bab091b3b28951d691704
2014-08-01 15:34:36 +00:00
drh
3a85625d87 Begin making changes to the IN operator in an attempt to make it run faster
and to make the code easier to understand.

FossilOrigin-Name: ee0fd6aaf94cda1dce3fe752bfe3b0f83e0043f1
2014-08-01 14:46:57 +00:00
drh
cefc87fca5 Enhance the PRAGMA integrity_check command to detect UNIQUE and NOT NULL
constraint violations.

FossilOrigin-Name: 9abcf2698c09f4f6a44a68e74f9f6b538f3253d6
2014-08-01 01:40:33 +00:00
drh
5f1d1d9c87 Refactoring: Change "pIndex->onError!=OE_None" to use a macro:
"IsUniqueIndex(pIndex)".  Easier to understand that way.

FossilOrigin-Name: e75b26ee357bb3d3c1a539b05d633ebf314726d7
2014-07-31 22:59:04 +00:00
drh
37e08081f3 Omit a pointless OP_Null when processing a value-list RHS of an IN operator
where the LHS is a rowid.

FossilOrigin-Name: 1361450a9dfe9476e8df98f370a3695752252245
2014-07-31 20:16:08 +00:00
mistachkin
202cb64189 Optimizations to the OS sub-type checking in the Win32 VFS.
FossilOrigin-Name: 1e5489faff093d6a8e538061e45532f9050e9459
2014-07-31 18:54:01 +00:00
dan
f6296cafc5 Add a missing call to "test_sqlite3_log" to multiplex.test.
FossilOrigin-Name: 0708f9df23a325349f658741358c5994b5c4c873
2014-07-31 18:14:37 +00:00
dan
e8559837e6 Fix a leaked statement handle in pager2.test.
FossilOrigin-Name: 47457b0488abcbec2137abf706c1d677563b9ea5
2014-07-31 17:35:40 +00:00
drh
4387006c18 Deactivate the DISTINCT in a SELECT on the right-hand side of an IN operator,
since it should not make any difference in the output but dues consume extra
memory and CPU time.

FossilOrigin-Name: f4cb53651b1e352fae7378878b830a902bcd9248
2014-07-31 15:44:44 +00:00
mistachkin
0174ffa976 Re-integrate the recent changes from the 'winMutex' branch back into the Win32 mutex subsystem.
FossilOrigin-Name: 5360ecb0b8891d0c27f3f02d81b6c7b548361a10
2014-07-30 23:11:16 +00:00
drh
d42d0bed94 Add three new static mutexes for use by the application. This is a partial
import of changes from the threads branch.

FossilOrigin-Name: 3aad01960f92c5e77dba64ac1a6c6b063378fb97
2014-07-30 21:10:12 +00:00
drh
c0fea3cf53 Add a new sqlite3FaultSim() call to vdbePmaReaderSeek() to facilitate
tests of error handling in the sorter.

FossilOrigin-Name: 655d8cfc752b3f5f63521a57f2155f8e14aaf7c4
2014-07-30 18:47:12 +00:00
drh
c690461ea1 Mark some invariants in the vdbesort.c logic when SQLITE_MAX_WORKER_THREADS==0.
FossilOrigin-Name: 721cd965859c9ccc24d2a1d2851c914229e584b3
2014-07-30 17:21:37 +00:00
drh
a1a8298c2e Add the "eForce" parameter to the sqlite3_multiplex_shutdown() entry point
in test_multiplex.c.  Shutdown is forced if true.  Shutdown is not done if
there are pending database connections and eForce is false, but an error log
entry is made instead.

FossilOrigin-Name: c7303d0139f7e7f4fa7060b52942e6c6c6d4b622
2014-07-30 15:43:05 +00:00
drh
bd1c881a91 Merge recent trunk changes, and especially the fix for the CREATE UNIQUE INDEX
problem of ticket [9a6daf340df99ba9].

FossilOrigin-Name: 5b50a8380b2b678c1646ff303e3696efc1d7d92c
2014-07-30 14:44:24 +00:00
drh
ac50232d0f Ensure that the correct number of columns in a UNIQUE index are checked for
uniqueness, regardless of whether or not the original table has a ROWID or
if the columns are NOT NULL, etc.  Ticket [9a6daf340df99ba93c].

FossilOrigin-Name: 6b785e92f279cb65746834d5cd25594fd3333342
2014-07-30 13:56:48 +00:00
mistachkin
0479c6ab9b Disable an assert that is sometimes generated spuriously.
FossilOrigin-Name: bd9ee0ea69181526cfc3cadac33a5ec5190112b0
2014-07-29 21:44:13 +00:00
mistachkin
a7f37491a7 Enhancements and updates to the Win32 mutex subsystem.
FossilOrigin-Name: ca9868cdae19045dc522490b34dee0f14d928ebe
2014-07-29 19:54:03 +00:00
mistachkin
acd57ea0c2 Update return value checking to conform to the beginthreadex() specs.
FossilOrigin-Name: 3144a16f91364b455e54e6030714e1c12ab0bdb7
2014-07-29 19:00:43 +00:00
mistachkin
7c2231cf3b Add a couple more assert statements.
FossilOrigin-Name: 4e816db235025c7998c649fddabfd807290a08b9
2014-07-29 18:53:01 +00:00
drh
b92284de11 Fix unreachable branches in the threads.c module.
FossilOrigin-Name: 3175e366bbf7579ec9ab27214b0a4e5cd27ea204
2014-07-29 18:46:30 +00:00
mistachkin
edd93c3349 Merge updates from trunk.
FossilOrigin-Name: 08c9a4ea6353900095a471365a8611a443f5f399
2014-07-29 18:03:36 +00:00
drh
cd4b637760 Fix a harmless compiler warning.
FossilOrigin-Name: 216d21d0e62b3c0ad49f3cb395c845bf4f17ac61
2014-07-29 17:22:12 +00:00
mistachkin
b1ac2bc8da Make the Win32 thread handles are available after the threads exit.
FossilOrigin-Name: 565c5af7a75ad5c759ce1a61dab3a61c42819644
2014-07-29 16:37:53 +00:00
drh
19f30dc171 Fix the threads build on Windows when SQLITE_MAX_WORKER_THREADS is greater
than 0.

FossilOrigin-Name: f37db3a03d95b508066745613029b7dd1240b31c
2014-07-29 15:18:00 +00:00
drh
011b2e5dd3 Merge the R-Tree fix and the new SQLITE_TESTCTRL_ISINIT test control from
trunk.

FossilOrigin-Name: b2f7eb3cc27ecf9a6a88907991148bca1a7d54b3
2014-07-29 14:16:42 +00:00
drh
43cfc230ab Add the SQLITE_TESTCTRL_ISINIT file control.
FossilOrigin-Name: 8b651d4d6cde7efbc0cc7155948f477477be100e
2014-07-29 14:09:21 +00:00
dan
57ff60b19b Have calls to the xFilter() method of rtree virtual tables ensure that cursor is initialized before proceeding. Fix for [d2889096e7bdeac].
FossilOrigin-Name: 8cc41b0bf365af47c2061ffe44c86018945dd239
2014-07-29 11:54:18 +00:00
mistachkin
d6918657d8 Enhancements and updates to the Win32 mutex subsystem.
FossilOrigin-Name: 18984c321049a759f6619cfa17fb3f4e7b3e08ea
2014-07-29 05:49:02 +00:00
mistachkin
fc129698e0 Add some asserts to the Win32 mutex subsystem.
FossilOrigin-Name: e8f2dc5fadae96252649875c234fcdef1108bd48
2014-07-29 00:42:39 +00:00
drh
2b49327d08 Fix the build on windows.
FossilOrigin-Name: 2773a5f9879a106a89a3d0bc3c5bfdcb2fe43c7c
2014-07-29 00:23:08 +00:00
drh
bde27aaa5a Remove an unnecessary parameter from vdbeMergeEngineStep(). Rename a couple
other routines to be more descriptive of what they do.

FossilOrigin-Name: f2407a40f339fa6c2cec194f78ae7c93655b1ec1
2014-07-28 20:16:41 +00:00
drh
d906514d98 Rename vdbeIncrMergerInit() to vdbeMergeEngineInit() - a much more accurate
name.

FossilOrigin-Name: 5b084a2dd581141b2d0cd9d1a5975625f65ec34d
2014-07-28 19:58:41 +00:00
drh
8a4865f139 In vdbesort.c, rename vdbeSorterDoCompare() to vdbeMergeEngineCompare() and
move it closer to the one place where it is called.  Other minor comment
changes.

FossilOrigin-Name: 09d50d9f0fe7df26dadb0a332731683a07a89fde
2014-07-28 18:57:40 +00:00
drh
a4c8ca049e In vdbesort.c, rename all pointers to sqlite3_file objects "pFd" and use the
name "pFile" only for pointers to SortFile objects.  Other comment enhancements.

FossilOrigin-Name: 518290a7fc0994f9593c5c3ba5b2610a1b86dae1
2014-07-28 17:18:28 +00:00
drh
966d9f267f Merge recent trunk changes into the threads branch.
FossilOrigin-Name: 163c247bd8280ab14fe577329c631c8bd884707f
2014-07-28 15:01:37 +00:00
drh
ac65196e4d Improvements to comments in the multi-threaded sorter. Also include a
function name change for clarity.  And add a test to help show that the
MergeEngine object is only used by a single thread.

FossilOrigin-Name: 9af50a878f67c1c2a4f1520160cc989650d7196a
2014-07-28 14:54:50 +00:00
drh
e6bc1ef68f Remove an unreachable branch from the sqlite3_value_numeric_type() interface.
FossilOrigin-Name: 5350229b52b18a4961858a30538c5c75e5bd3048
2014-07-26 20:12:56 +00:00
drh
975b4c6e8b Avoid unnecessary no-op calls to applyNumericAffinity() for a small
performance improvement.

FossilOrigin-Name: 413d7287977702fa651c0140bd5cf29021fe3e79
2014-07-26 16:47:23 +00:00
drh
eac5bd7870 Try to fix harmless compiler warnings reported by Fortify.
FossilOrigin-Name: e0fa6fdc14ac5458f9200cbae124f8025ea534ea
2014-07-25 21:35:39 +00:00
drh
5dad9a3497 Improved comments on VDBE opcodes, for better documentation. No code
or logic changes.

FossilOrigin-Name: 2d32e4876e0b162730f81e5c2658be12d64a9a99
2014-07-25 18:37:42 +00:00
drh
8af3f772c1 Add constraints (enforced only when SQLITE_DEBUG is enabled) on the use of
OP_Next and OP_Prev.

FossilOrigin-Name: 2230c74f1efa591770176c9b40e920724a3c39e1
2014-07-25 18:01:06 +00:00
drh
f8c7e053ed Improve the performance of the ANALYZE command by taking advantage of
UNIQUE constraints on indices.

FossilOrigin-Name: 114dcf33670fd98a1ebbac0e44f66b2d8bcccddf
2014-07-24 23:23:26 +00:00
drh
d15f87ecfd Fix a bug in the whereRangeSkipScanEst() procedure (added by
check-in [d09ca6d5efad3e4cfa]) where it fails to consider the possibility
of a ROWID column when computing the affinity of a table column.

FossilOrigin-Name: 6aea2258dd7d3967900cefe4cd0af48a7ee7e169
2014-07-24 22:41:20 +00:00
drh
b12879fd1a Avoid trying to allocation zero bytes when analyzing a unique non-null index.
FossilOrigin-Name: 85e2badeeb7f7599eb6fd35512f9bd524f0b1b3f
2014-07-24 20:25:16 +00:00
drh
9d793325b0 Avoid change tests when analyzing single-column unique indexes after
getting past the initial NULL entries.

FossilOrigin-Name: 4690e99c07024f40fafba1db8e4487b287b788a9
2014-07-24 19:54:20 +00:00
drh
2bd2c29a95 Merge all recent trunk changes into the threads branch.
FossilOrigin-Name: 770685892c8f09b9cddb2fbb2877cfb291e19425
2014-07-24 16:54:28 +00:00
drh
ba5b09319e Add the readfile(FILENAME) and writefile(FILENAME,CONTENT) SQL functions to
the command-line shell.

FossilOrigin-Name: fb1048cb2b613a0dbfe625a5df05e9dcd736a433
2014-07-24 12:39:59 +00:00
drh
c4747f2314 Add support for hexadecimal integer literals in the parser.
FossilOrigin-Name: f8f79f28785db716b10c3bc9d6652b98253fd125
2014-07-24 12:19:41 +00:00
drh
6976c2123b In the command-line shell, in CSV output mode, terminate rows with CRNL but
do not expand NL characters in data into CRNL.  Provide the extra -newline
command-line option and the extra argument to .separator to designate an
alternative newline character sequence for CSV output.

FossilOrigin-Name: 16c8ce10e1530731441e6c4538691b71564684ed
2014-07-24 12:09:47 +00:00
drh
dbd9486d5b Add experimental "costmult" logic. Only enabled when compiled with
-DSQLITE_ENABLE_COSTMULT.

FossilOrigin-Name: 729ece40885ed7f52c5981364833fc62281a388b
2014-07-23 23:57:42 +00:00
drh
6861b8a13f Ugh. Consecutive UNIQUE index entries are only distinct if the index is
on NOT NULL columns.  So the previous version was not quite right.  This
check-in fixes the problem.

FossilOrigin-Name: 30033f965030a015fad15e532bcaba1314c8cc0f
2014-07-23 19:37:21 +00:00
mistachkin
3b9fab1cb9 Enhancements to the hex literal tests.
FossilOrigin-Name: a3cc027fa7ca41da23ecd0770a075a48416af020
2014-07-23 19:04:25 +00:00
drh
553818a0aa Improve the performance of the ANALYZE command by taking advantage of the
fact that every row of a UNIQUE index is distinct.

FossilOrigin-Name: 3e1e79e1335f7ad33cd35f384f2a063c4aa2253b
2014-07-23 18:36:55 +00:00
drh
11d451eb8a Updated documentation on sqlite3_temp_directory. No changes to code.
FossilOrigin-Name: e6225a7bf77a700b318563b1a854b4b3a9e031e1
2014-07-23 15:51:29 +00:00
drh
1b7ddc5915 Remove a surplus function prototype. #ifdef code that is not used when
hex integers are omitted at compile time.

FossilOrigin-Name: a5b383e077e4b277a65920f7cc202f32f07aa9ee
2014-07-23 14:52:05 +00:00
drh
9296c18a50 Change the hex literal processing so that only the SQL parser understands
hex literals.  Casting and coercing string literals into numeric values does
not understand hexadecimal integers.  This preserves backwards compatibility.
Also:  Throw an error on any hex literal that is too big to fit into 64 bits.

FossilOrigin-Name: 6c6f0de59bf96b79c8ace8c9bfe48c7a6a306a50
2014-07-23 13:40:49 +00:00
drh
5ec659cfcb Casting hex literals directly from string to float always results in a
positive number.

FossilOrigin-Name: 4b86ccdf4f4eb4339a5706e10ad24f01b6c3939e
2014-07-23 02:07:11 +00:00
drh
d35588dc21 Reformatting a few test cases for clarity.
FossilOrigin-Name: 7e1bbacb11a4689b69856450125cae3d045307af
2014-07-23 01:59:47 +00:00
drh
fce4da1b73 Test cases for hex literals.
FossilOrigin-Name: 19054339c47448bcdfd1f7be35daa3826c409077
2014-07-23 01:56:32 +00:00
drh
28e048c618 Add support for parsing C-style hexadecimal literals.
FossilOrigin-Name: 34a1f38b7a23c64f5c6e5b34c19a20480be53961
2014-07-23 01:26:51 +00:00
drh
0f65cce825 When running ANALYZE, it is not necessary to check the right-most key column
for changes since that column will always change if none of the previous
columns have.

FossilOrigin-Name: 48f40861db4fbd10725a2b8b606d44fe16d5bd27
2014-07-22 22:46:54 +00:00
drh
3526319b48 Add the OP_ReopenIdx opcode that works like OP_OpenRead except that it becomes
a no-op if the cursor is already open on the same index.  Update the
OR-optimization logic to make use of OP_ReopenIdx in order to avoid
unnecessary cursor open requests sent to the B-Tree layer.

FossilOrigin-Name: 77f412caf0192d3e7fecb377d6d72123d8b64424
2014-07-22 20:02:19 +00:00
drh
a45fdc7b1e The optimization of check-in [b67a6e33f2] does not work (it generates
incorrect VDBE code) if an OR term is AND-ed with a constant expression.
So back that optimization out and add a test case to make sure it does not
get added back in.

FossilOrigin-Name: eed754fe93644f4df082eac0c0a7ffc5c78ccd10
2014-07-22 19:14:42 +00:00
drh
f5d87f77e2 Fix the index name for the shadow tables in the spellfix1 extension so that
multiple instances of the spellfix1 virtual table can each have their own
index.

FossilOrigin-Name: 438c348a40383796a710499e4e1b7a6b08f75778
2014-07-22 16:00:49 +00:00
drh
d08b27988c Correction: The maximum SQLITE_MAX_ATTACHED value to avoid overflowing a
signed 8-bit integer is 125, not 127.

FossilOrigin-Name: 48e378029528dac33d29866016128d236a7995d9
2014-07-22 15:33:31 +00:00
drh
25df48d967 Enhance the sqlite_stat1.stat parsing to allow additional text parameters
at the end.  Unrecognized parameters are silently ignored.

FossilOrigin-Name: ca2a5a2c770fa94cd8db1b1b241ede058a7c58e2
2014-07-22 14:58:12 +00:00
drh
358406fc57 Expire prepared statements after running ANALYZE.
FossilOrigin-Name: b083a961f8ac3a6158e822574d73cd63e3103b09
2014-07-22 14:42:16 +00:00
drh
83a305f20e Enhance the comment on whereLoopAddBtree(). No changes to code.
FossilOrigin-Name: b22dd165da227a52d88b17a91e80a1701dce61ad
2014-07-22 12:05:32 +00:00
drh
53ad7e48ab For the OR-optimization, avoid generating OP_OpenRead opcodes that reopen
exactly the same index.

FossilOrigin-Name: b67a6e33f23ce5f5d9a545fa9d6700a7ed636901
2014-07-22 00:40:45 +00:00
drh
215c0c82fa Limit the maximum SQLITE_MAX_ATTACHED to 127, since a signed character
is sometimes used to store the database index.

FossilOrigin-Name: f1c76c7c4c7d16855db60d16e23ecdf8d7ca862a
2014-07-21 20:07:17 +00:00
drh
a7ab6d8165 Allow the SQLITE_MAX_ATTACHED compile-time option to be larger than 62. The
default limit on the number of attached databases remains 10.

FossilOrigin-Name: 1a817ae2f35fa0396148dda2782cd4f919bf5c6f
2014-07-21 15:44:39 +00:00
dan
857745c089 Update the sqlite3_stmt_busy() function so that it correctly returns true for "ROLLBACK" statements that have been stepped but not yet reset.
FossilOrigin-Name: 61cee3c0678f5abd9131a29ab946a5e71f55643e
2014-07-19 17:57:10 +00:00
drh
33af1a6faa Fix harmless compiler warnings in the showdb and showwal tools and in
the unicode tokenizer of FTS3.

FossilOrigin-Name: 574cc8eb1448cff67390f2e16cc9b7c3ddd4658b
2014-07-19 17:49:40 +00:00
mistachkin
86ac612e8a Fix some harmess compiler warnings in the FTS3 Unicode module.
FossilOrigin-Name: c01caea5d6ad7a570628b85fb3056ac955ff03dd
2014-07-19 15:44:29 +00:00
mistachkin
ef60703e8f Fix warnings related to having a 64-bit size_t.
FossilOrigin-Name: 29ac9336dba2b62d13315cecfc5c4a74cc54087a
2014-07-19 15:40:39 +00:00
mistachkin
35683976a4 Fix warnings caused by the previous commit.
FossilOrigin-Name: 89634a419d0c1ef899d0591c7c6ab9290bf665d2
2014-07-19 15:30:01 +00:00
mistachkin
0461cc4795 Fix harmless compiler warnings for MSVC in the showdb/showwal command line tools.
FossilOrigin-Name: 6dc7b2f119eb92da17c9e914bdad30a9ceaebdb5
2014-07-18 21:16:37 +00:00
mistachkin
3a046c6c31 Update clean targets with the recently added command-line tools.
FossilOrigin-Name: 2beefa68c0c53f663321bebf0ac06f6c936be63f
2014-07-18 21:02:54 +00:00
drh
a6f5972c75 Improved documentation for checkpoints and the busy handler. No changes
to code.

FossilOrigin-Name: ca92c0240681b199c4b8ecc557792b8aea71692d
2014-07-18 19:06:39 +00:00
drh
71607c77c8 SQLite has long accepted some unadvertised and non-standard join syntax.
Add a test to ensure that future versions continue to accept this non-standard
syntax, to avoid breaking legacy applications that use the undefined syntax.

FossilOrigin-Name: 824dde7fc48dbca6d6c956c4eb79bbfa2d139ee5
2014-07-18 17:39:48 +00:00
drh
56f674c8a0 Improvements to the ".fullschema" command in the command-line shell.
FossilOrigin-Name: fa80c64caa573297bf43cb5b11d9e7db58567200
2014-07-18 14:43:29 +00:00
mistachkin
166c373779 Fix harmless compiler warnings in the fts3view utility program that can occur with MSVC.
FossilOrigin-Name: 1cec1e030035e5253fb7ebbdfe5c1a3029e4e29b
2014-07-07 18:03:38 +00:00
mistachkin
de54527fb2 Add the fts3view utility program to the MSVC makefile.
FossilOrigin-Name: b04751bd59fed513ab615e7f368fe25c64b3607c
2014-07-07 17:57:50 +00:00
drh
42d3d37ad1 Fix a division-by-zero error in the fts3view utility program. Add the
fts3view utility program to the "main.mk" makefile.

FossilOrigin-Name: 64f02699b4bd747e4c2f0debf72d37ec275137d8
2014-07-07 16:07:43 +00:00
dan
2eaf03d72b Change fts3/4 so that the "unicode61" is included in builds by default. It may now be excluded by defining SQLITE_DISABLE_FTS3_UNICODE.
FossilOrigin-Name: 0cc0230ae9cfc9760fd8ef2c25e82576b052dbeb
2014-07-03 12:18:22 +00:00
dan
43fbe5e2c9 Add another test to verify that SQLite is using stat4 data for composite primary keys on WITHOUT ROWID tables.
FossilOrigin-Name: 0df1fe72f8271abc86cd552027d938c910f90967
2014-07-01 15:22:11 +00:00
dan
39caccf83d Ensure that all fields are loaded from the stat4 table for records that correspond to indexes on WITHOUT ROWID tables with composite primary keys.
FossilOrigin-Name: 21981e35062cc6b30e9576786cbf55265a7a4d41
2014-07-01 11:54:02 +00:00
drh
6614181610 Merge the latest trunk changes into the threads branch.
FossilOrigin-Name: ae23a65eb1547fbe8b86ab71477071990a22d31d
2014-06-30 20:25:03 +00:00
drh
49e77b1925 Bump the version number to 3.8.6.
FossilOrigin-Name: f925e9baafea625f63105f8013abb3807b418379
2014-06-30 19:28:57 +00:00
drh
855f63908f Attempt to use STAT4 information to estimate the selectivity of WHERE clause
terms when using the skip-scan optimization.

FossilOrigin-Name: d09ca6d5efad3e4cfa93a4dc711e6ba6079d4b4b
2014-06-30 19:07:58 +00:00
drh
c7de8267a8 Fix for ticket [b2fa5424e6fcb15]: Better define the format of the sqlite_stat4
file for WITHOUT ROWID tables and make sure the ANALYZE command generates a
file in the appropriate format.  Use the sqlite_stat4 data to enable the use
of WHERE terms that cover all indexed columns plus some prefix of columns
in the primary key.

FossilOrigin-Name: bc2de8095fa9c385db0adf22ca55b0298a33c284
2014-06-30 18:57:53 +00:00
dan
fd984b8114 Fix a problem in where.c with using the stat4 sample data of an index on a WITHOUT ROWID table.
FossilOrigin-Name: 053a210e3169732c58f84cb54c9b6f6df3a8f4ea
2014-06-30 18:02:20 +00:00
drh
ec9e55d358 Fix the STAT4 information for WITHOUT ROWID tables.
FossilOrigin-Name: 5d8628fdffbcf837313958f0ee1ed8a2043d384e
2014-06-30 17:07:39 +00:00
dan
39129ce8d9 Fix where.c so that the primary key values appended to every index entry on a WITHOUT ROWID table may be used when useful.
FossilOrigin-Name: 6624a61d16e47ad691c4195ca8a1d68b7348118d
2014-06-30 15:23:57 +00:00
drh
971fd07135 Omit non-primary-key columns from the STAT4 samples for WITHOUT ROWID tables.
Indexes, both rowid and without-rowid, still hold an exact copy
of the index entry.

FossilOrigin-Name: de826c31589258f0906f87d65796944103e36d5b
2014-06-30 13:56:34 +00:00
drh
48be0c51d4 Generate complete samples for sqlite_stat4 on WITHOUT ROWID tables.
Ticket [b2fa5424e6fcb15b5]

FossilOrigin-Name: 8cb43eddab83c68b2163441df70e0e9496d5fa33
2014-06-30 13:32:39 +00:00
drh
4bb77ecaa8 Add makefile targets for various diagnostic tools, such as showstat4.
Fix harmless compiler warnings in diagnostic tools.

FossilOrigin-Name: 6f86d89b8800c50035da7809bff941d08a33a6a2
2014-06-30 11:14:26 +00:00
dan
6696ba3eab Add an OOM fault injection test for the new code on this branch.
FossilOrigin-Name: c96de490ac77dd23c108004b95152cce4922fe27
2014-06-28 19:06:49 +00:00
dan
8e9028d0f8 Add further tests to skipscan5.test.
FossilOrigin-Name: 4b8230e8fe93e73a615a46708aed5fa3557b6228
2014-06-28 17:35:15 +00:00
drh
0288b21e54 Add header comments on new routines. Rework the sqlite3Stat4Column() routine
so that is (in theory) able to deal with corrupt samples.

FossilOrigin-Name: ef5cdf949bb53a2958fa34e176b4b9eeda269de5
2014-06-28 16:06:44 +00:00
dan
fa8874542c Fix a problem with using stat4 samples of type text when estimating the rows visited by a range-query/skip-scan loop.
FossilOrigin-Name: dfb09db6d412f3bc2a71bda393813783580dbad1
2014-06-28 15:26:10 +00:00