]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
10 years agoOnly enable HAVE_STRCHRNUL by default on linux, as that is the only place sqliteIntMacros
drh [Sat, 20 Sep 2014 00:29:20 +0000 (00:29 +0000)] 
Only enable HAVE_STRCHRNUL by default on linux, as that is the only place
it appears to work by default.

FossilOrigin-Name: 0fac2c045f47c7735af4eb68ced81d8b43622a1f

10 years agoRevise macro usage in 'sqliteInt.h'.
mistachkin [Sat, 20 Sep 2014 00:02:23 +0000 (00:02 +0000)] 
Revise macro usage in 'sqliteInt.h'.

FossilOrigin-Name: 35db3e2f350ca2bc6bb9e1a647aec7f93bfb7065

10 years agoSimplify two conditionals and add testcase() macros to the affinity transform
drh [Fri, 19 Sep 2014 22:44:20 +0000 (22:44 +0000)] 
Simplify two conditionals and add testcase() macros to the affinity transform
logic in the comparison operators.

FossilOrigin-Name: 544664cadfb4e504bc0b321c865d1ecb8a831e20

10 years agoRecognize the invariant that a Mem object cannot be MEM_Dyn and have
drh [Fri, 19 Sep 2014 22:30:49 +0000 (22:30 +0000)] 
Recognize the invariant that a Mem object cannot be MEM_Dyn and have
a non-zero szMalloc at the same time.  Enforce this with assert()s and
exploit it in the sqlite3VdbeMemClearAndResize() routine for a performance
increase.

FossilOrigin-Name: 3b21cf2b284048da4b728a5d6ec89e5c330144d4

10 years agoTighten the conditions under which applyNumericAffinity() be called and add
drh [Fri, 19 Sep 2014 22:01:54 +0000 (22:01 +0000)] 
Tighten the conditions under which applyNumericAffinity() be called and add
assert() statements to prove that it is never called otherwise.

FossilOrigin-Name: e996ca32cb643c558b616c0dd872f3351b6aa3ef

10 years agoFix the affinity on inserts into the ANALYZE tables. Change the affinity
drh [Fri, 19 Sep 2014 20:13:25 +0000 (20:13 +0000)] 
Fix the affinity on inserts into the ANALYZE tables.  Change the affinity
characters to be upper case, to make the P5 parameter of comparison operators
easier to read.

FossilOrigin-Name: 3f3ca76aea38d566a574f4403b375bdac32854ed

10 years agoDo not attempt to extend the temp file if VFS version 3 is not supported and
drh [Fri, 19 Sep 2014 19:43:20 +0000 (19:43 +0000)] 
Do not attempt to extend the temp file if VFS version 3 is not supported and
hence memory mapped I/O is unavailable.

FossilOrigin-Name: 3ab20ba14f0204efeec62c7dbb87cb3f60e2497f

10 years agoMake the "nolock" VFS on unix a version-3 VFS so that the sorter can
drh [Fri, 19 Sep 2014 19:00:48 +0000 (19:00 +0000)] 
Make the "nolock" VFS on unix a version-3 VFS so that the sorter can
use memory-mapped I/O.

FossilOrigin-Name: 3db78d6100a1ecf58c18eec3abefa7d1250c649c

10 years agoRemove a local variable from the OP_Column implementation, resulting in a
drh [Fri, 19 Sep 2014 16:56:45 +0000 (16:56 +0000)] 
Remove a local variable from the OP_Column implementation, resulting in a
modest size reduction and a performance increase.

FossilOrigin-Name: 6199760d1340858d97c845177986b783da915d9e

10 years agoSmall size reduction and performance increase for releaseMemArray().
drh [Fri, 19 Sep 2014 16:13:12 +0000 (16:13 +0000)] 
Small size reduction and performance increase for releaseMemArray().

FossilOrigin-Name: 24cd32d681df58f687b2afbe4b13d579e3efdd4b

10 years agoUpdates to comments. No code changes.
drh [Fri, 19 Sep 2014 16:02:06 +0000 (16:02 +0000)] 
Updates to comments.  No code changes.

FossilOrigin-Name: 9b42c3da6b2593a10b8fe4b2fcc3d650132625c1

10 years agoThe OP_Column opcode runs faster and is smaller by manually in-lining the
drh [Fri, 19 Sep 2014 15:28:33 +0000 (15:28 +0000)] 
The OP_Column opcode runs faster and is smaller by manually in-lining the
code that persists string values in the output register.

FossilOrigin-Name: 36b613ccf0ddb764af90841994da91b7fcaa8f00

10 years agoAdd the sqlite3VdbeMemClearAndResize() function. Fix a sorting-index
drh [Fri, 19 Sep 2014 04:42:38 +0000 (04:42 +0000)] 
Add the sqlite3VdbeMemClearAndResize() function.  Fix a sorting-index
prefilter problem.

FossilOrigin-Name: 987a7a211913b3949da20e43423af376f72a28ba

10 years agoMake sure that the sorting-index pre-filter recognizes that a rowid reference Cplusplus-comment
drh [Fri, 19 Sep 2014 02:01:37 +0000 (02:01 +0000)] 
Make sure that the sorting-index pre-filter recognizes that a rowid reference
might be sortable.  This fixes a performance regression.

FossilOrigin-Name: 72727b68cd07969165f1f0943cc7e1a265436653

10 years agoAdd the sqlite3VdbeMemClearAndResize() interface to be used in place of
drh [Fri, 19 Sep 2014 00:43:39 +0000 (00:43 +0000)] 
Add the sqlite3VdbeMemClearAndResize() interface to be used in place of
sqlite3VdbeMemGrow().

FossilOrigin-Name: 5b9b8987797abf7c68d2c3154f6657be9b8b1c8f

10 years agoAdd the Mem.szMalloc element to the Mem object and use it to keep track of
drh [Thu, 18 Sep 2014 21:25:33 +0000 (21:25 +0000)] 
Add the Mem.szMalloc element to the Mem object and use it to keep track of
the size of the Mem.zMalloc allocation.

FossilOrigin-Name: 9c09ac353df6041808cace41880f4729ee73f5e1

10 years agoCorrect typos in comments. No changes to code.
mistachkin [Thu, 18 Sep 2014 18:55:47 +0000 (18:55 +0000)] 
Correct typos in comments.  No changes to code.

FossilOrigin-Name: 55879932116d373c95a5f32ec44b53a9c3f4db24

10 years agoMerge the Mem.r value into the MemValue union as Mem.u.r. Hence, a Mem can
drh [Thu, 18 Sep 2014 17:52:15 +0000 (17:52 +0000)] 
Merge the Mem.r value into the MemValue union as Mem.u.r.  Hence, a Mem can
now store an integer or a real but not both at the same time.  Strings are
still stored in a separate element Mem.z, for now.

FossilOrigin-Name: 4c8c89d7e62aecfe2eb735f7bb114aed6b452847

10 years agoPerformance improvement for affinity transformations on comparison operators.
drh [Thu, 18 Sep 2014 16:28:59 +0000 (16:28 +0000)] 
Performance improvement for affinity transformations on comparison operators.

FossilOrigin-Name: d7afdcbac24350b73a30c06c45cf0f2122820e4f

10 years agoSince numeric affinity is the most common case, check it first. Interchange
drh [Thu, 18 Sep 2014 14:36:00 +0000 (14:36 +0000)] 
Since numeric affinity is the most common case, check it first.  Interchange
the NONE and TEXT affinity codes for easier checking of no affinity.

FossilOrigin-Name: 4ef4c9a7c8510203bce0941dda2f76ded8da1de2

10 years agoModify an assert() within sqlite3PagerWalFramesize(), a function only ever used by...
dan [Thu, 18 Sep 2014 09:59:28 +0000 (09:59 +0000)] 
Modify an assert() within sqlite3PagerWalFramesize(), a function only ever used by zipvfs, to account for recent zipvfs changes.

FossilOrigin-Name: 3bd7c1b2faa2d4cc95b255633204006849bfd5e0

10 years agoFix harmless warnings on 32-bit MSVC builds.
drh [Thu, 18 Sep 2014 02:20:54 +0000 (02:20 +0000)] 
Fix harmless warnings on 32-bit MSVC builds.

FossilOrigin-Name: 5192f964b2a85459553f1cea741b9791606ccc4e

10 years agoMake sure of the strchrnul() library function on platforms where it is
drh [Thu, 18 Sep 2014 01:50:09 +0000 (01:50 +0000)] 
Make sure of the strchrnul() library function on platforms where it is
available.

FossilOrigin-Name: ef1aa10b7f54912cba71cd0a98c5055d501de54f

10 years agoMerge micro-optimizations into trunk after fixing the build on MSVC.
drh [Thu, 18 Sep 2014 01:29:11 +0000 (01:29 +0000)] 
Merge micro-optimizations into trunk after fixing the build on MSVC.
Performance now shows 7.58% faster than the 3.8.6 release on x64 with
gcc 4.8.1 and -Os.

FossilOrigin-Name: 1de558bcb13edc4e9a42a0b05e4b0ed6b14286a4

10 years agoFix compiler warnings and change the nullMem structure initializer into a
drh [Thu, 18 Sep 2014 01:21:43 +0000 (01:21 +0000)] 
Fix compiler warnings and change the nullMem structure initializer into a
format that MSVC can understand.

FossilOrigin-Name: 163bfae8583b2d3002a3a43d6bf8a66fefd73acb

10 years agoPerformance improvement and slight size reduction to the comparison operators
drh [Wed, 17 Sep 2014 23:37:38 +0000 (23:37 +0000)] 
Performance improvement and slight size reduction to the comparison operators
in the VDBE.

FossilOrigin-Name: 14052a7d088bed8196d90a3361ce717a5193bdc8

10 years agoIn the Mem object, stop requiring that Mem.xDel be NULL when the MEM_Dyn
drh [Wed, 17 Sep 2014 16:41:15 +0000 (16:41 +0000)] 
In the Mem object, stop requiring that Mem.xDel be NULL when the MEM_Dyn
bit is clear.  Also reduce the amount of initialization of Mem objects.
All for a small size reduction and performance increase.

FossilOrigin-Name: fdddb477c89dabb9f7bf2d5ccb32534868df3a03

10 years agoImproved interface to the Mem object handling. Small size reduction and
drh [Wed, 17 Sep 2014 14:52:46 +0000 (14:52 +0000)] 
Improved interface to the Mem object handling.  Small size reduction and
performance increase.

FossilOrigin-Name: 4e437844322cc20eef92928b53fa6b37eded586e

10 years agoContinuing cleanup of memory register memory allocation handling.
drh [Tue, 16 Sep 2014 21:54:11 +0000 (21:54 +0000)] 
Continuing cleanup of memory register memory allocation handling.

FossilOrigin-Name: 2598aedc5dd2bac67e2e518a31f2803e469c2ba6

10 years agoMake sure registers are cleared properly prior to being used to store
drh [Tue, 16 Sep 2014 20:05:21 +0000 (20:05 +0000)] 
Make sure registers are cleared properly prior to being used to store
the result of an OP_Column operator.

FossilOrigin-Name: 78fb8838d80b229418c347c63579989432e1af7d

10 years agoSimplification of the OP_Column logic for the case of rows with overflow.
drh [Tue, 16 Sep 2014 18:22:44 +0000 (18:22 +0000)] 
Simplification of the OP_Column logic for the case of rows with overflow.

FossilOrigin-Name: f73678038d8fc399c1ca55230ae45962007c909c

10 years agoRemove an unused parameter from sqlite3VdbeIdxRowid(). This is cosmetic
drh [Tue, 16 Sep 2014 14:55:08 +0000 (14:55 +0000)] 
Remove an unused parameter from sqlite3VdbeIdxRowid().  This is cosmetic
only as the C-compiler optimizers were already omitting this parameter on
amalgamation builds.

FossilOrigin-Name: a10a6bba4963761b490b7243b388dcc920c4cfed

10 years agoReduce the number of arguments to RecordCompare functions from 4 to 3,
drh [Tue, 16 Sep 2014 14:37:35 +0000 (14:37 +0000)] 
Reduce the number of arguments to RecordCompare functions from 4 to 3,
resulting in a small performance increase.

FossilOrigin-Name: 8239c35aedd583af79505378bb7dbb78346a3f45

10 years agoReorder the elements of the Mem object for a small size reduction and
drh [Tue, 16 Sep 2014 14:16:31 +0000 (14:16 +0000)] 
Reorder the elements of the Mem object for a small size reduction and
performance improvement.

FossilOrigin-Name: 0be3019ed794c10de67dfd645ceea7d45815bc4b

10 years agoChanges to sqlite3VdbeRecordUnpack() to make it slightly smaller and faster.
drh [Tue, 16 Sep 2014 13:30:05 +0000 (13:30 +0000)] 
Changes to sqlite3VdbeRecordUnpack() to make it slightly smaller and faster.

FossilOrigin-Name: 8fb90da77ce0e662c1ef1ae0d854e5164494b7af

10 years agoPerformance improvement to the sqlite3MemCompare() routine by factoring out
drh [Tue, 16 Sep 2014 03:24:43 +0000 (03:24 +0000)] 
Performance improvement to the sqlite3MemCompare() routine by factoring out
sqlite3BlobCompare().

FossilOrigin-Name: 20ed2321b09ba076e50f9fc2f42c135b25746d72

10 years agoFix tool/showwal.c so that it handles WAL files that contain 64KiB pages.
dan [Mon, 15 Sep 2014 16:53:23 +0000 (16:53 +0000)] 
Fix tool/showwal.c so that it handles WAL files that contain 64KiB pages.

FossilOrigin-Name: 4060efb646c873c4abde7ab9ddf330489a44f274

10 years agoAvoid attempting to call the xFetch() method of an sqlite3_io_methods object with...
dan [Mon, 15 Sep 2014 16:50:34 +0000 (16:50 +0000)] 
Avoid attempting to call the xFetch() method of an sqlite3_io_methods object with a version number less than 3.

FossilOrigin-Name: dedaa6fb3d2e6e697d4a48649af5f42d9a11c333

10 years agoRemove the EXPENSIVE_ASSERTS in pcache.c having to do with the pSynced field
drh [Mon, 15 Sep 2014 14:59:12 +0000 (14:59 +0000)] 
Remove the EXPENSIVE_ASSERTS in pcache.c having to do with the pSynced field
of the Pcache object, as they are incorrect, as revealed by recent pcache
enhancements.

FossilOrigin-Name: 69a64560777f85b47349b4b2aab01dc99298592e

10 years agoDo not flatten aggregate subqueries that contain min() or max() functions
drh [Mon, 15 Sep 2014 14:46:02 +0000 (14:46 +0000)] 
Do not flatten aggregate subqueries that contain min() or max() functions
so that if the min()/max() are discarded by the outer query, they still
function and cause non-aggregate expression to be evaluated on the minimal
or maximal row.

FossilOrigin-Name: 0bdf1a086b3946722f4d4b328e25917f61c14713

10 years agoAdjust comments to show that subquery flattening restriction (10) was
drh [Mon, 15 Sep 2014 11:14:50 +0000 (11:14 +0000)] 
Adjust comments to show that subquery flattening restriction (10) was
removed from the code back in 2005.  This is a comment change only.

FossilOrigin-Name: 4ff0eb96bc364baed2d8005c69291ca9240b99dd

10 years agoSmall performance improvement to the dirty list handling in the pager.
drh [Fri, 12 Sep 2014 20:30:59 +0000 (20:30 +0000)] 
Small performance improvement to the dirty list handling in the pager.

FossilOrigin-Name: b332a84d5154f70f3197537df4af243eaebbb011

10 years agoSimplify the way the column cache is managed around OP_Move instructions.
drh [Fri, 12 Sep 2014 17:41:30 +0000 (17:41 +0000)] 
Simplify the way the column cache is managed around OP_Move instructions.

FossilOrigin-Name: 320556233e19cdd9d590a09655c3465754700d39

10 years agoFix a problem with parser memory allocation on 32-bit systems.
drh [Fri, 12 Sep 2014 04:28:33 +0000 (04:28 +0000)] 
Fix a problem with parser memory allocation on 32-bit systems.

FossilOrigin-Name: 2f69a1fa6adc9377149ae7faa586a5d30b6a631b

10 years agoFix an issue with sqlite3_bind_text64() with the SQLITE_UTF16 encoding
drh [Thu, 11 Sep 2014 23:34:55 +0000 (23:34 +0000)] 
Fix an issue with sqlite3_bind_text64() with the SQLITE_UTF16 encoding
parameter.  Remove some unreachable code from the text64() and blob64()
implementation.

FossilOrigin-Name: 34292b084ef48cd6e9ca5704f6b072a29733b4c2

10 years agoAdd new APIs that take 64-bit length parameters: sqlite3_malloc64(),
drh [Thu, 11 Sep 2014 18:44:04 +0000 (18:44 +0000)] 
Add new APIs that take 64-bit length parameters: sqlite3_malloc64(),
sqlite3_realloc64(), sqlite3_bind_blob64(), sqlite3_bind_text64(),
sqlite3_result_blob64(), and sqlite3_result_text64().
Add the sqlite3_msize() interface.
Internal memory allocation routines now use 64-bit unsigned
length parameters for safety.
Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid
a integer overflow problem.

FossilOrigin-Name: 7e4978c003867d1b532b69221013dda75ca61953

10 years agoAdd the SQLITE_USER_AUTHENTICATION extension to the trunk. This extension
drh [Thu, 11 Sep 2014 17:27:54 +0000 (17:27 +0000)] 
Add the SQLITE_USER_AUTHENTICATION extension to the trunk.  This extension
is disabled by default.  Special compilation procedures are need to enable
it.

FossilOrigin-Name: 65884d4f81a4705b0356b6cb8ec4909945ff5c19

10 years agoClean up some #includes in the extension API implementation. user-auth
drh [Thu, 11 Sep 2014 17:14:54 +0000 (17:14 +0000)] 
Clean up some #includes in the extension API implementation.

FossilOrigin-Name: b149ef5c639e6bcff7bd1c7866353e7f7f468070

10 years agoSuppress the potential schema error that occurs when a non-user-auth
drh [Thu, 11 Sep 2014 16:36:43 +0000 (16:36 +0000)] 
Suppress the potential schema error that occurs when a non-user-auth
SQLite library tries to parse the sqlite_user table definition in a
user-auth database.

FossilOrigin-Name: cda33c1ef35416a155af602c0b4e9d42ccf8633f

10 years agoEnhance the sqlite3_user_add() interface to initialize the user
drh [Thu, 11 Sep 2014 16:19:31 +0000 (16:19 +0000)] 
Enhance the sqlite3_user_add() interface to initialize the user
authentication logic.  Add test cases for the extra argument on the
end of the authorizer callback.

FossilOrigin-Name: 842c6da8f1a62bd13a1b4089a98b0835a46a2285

10 years agoAll interfaces working and tested.
drh [Thu, 11 Sep 2014 15:25:02 +0000 (15:25 +0000)] 
All interfaces working and tested.

FossilOrigin-Name: 96ea5c0b3cd1dec81d490f2f958ebd2e47a24921

10 years agoGet the sqlite3_user_delete() interface working.
drh [Thu, 11 Sep 2014 14:56:45 +0000 (14:56 +0000)] 
Get the sqlite3_user_delete() interface working.

FossilOrigin-Name: 974a9c65583f7ab438d5673dc00c347ab8322855

10 years agoFix the sqlite3_user_change() interface so that it does allow a
drh [Thu, 11 Sep 2014 14:40:27 +0000 (14:40 +0000)] 
Fix the sqlite3_user_change() interface so that it does allow a
non-admin user to change their own password.

FossilOrigin-Name: 52d440c7e1b07fc03f14ed5fa4cc4c89a75cd430

10 years agoMove user authentication blocking from sqlite3_prepare() over to the
drh [Thu, 11 Sep 2014 14:01:41 +0000 (14:01 +0000)] 
Move user authentication blocking from sqlite3_prepare() over to the
table lock generator, thus allowing SQL statements (like
"PRAGMA locking_mode") that do not touch database content to run
prior to authentication.

FossilOrigin-Name: 70121e7cf868b7d6d19bf98794ddc3809a901456

10 years agoAdd support for the extra parameter on the sqlite3_set_authorizer() callback
drh [Thu, 11 Sep 2014 13:44:52 +0000 (13:44 +0000)] 
Add support for the extra parameter on the sqlite3_set_authorizer() callback
and support for failing an ATTACH with an authentication-required database
using bad credentials.  The extension is now feature complete, but much
testing and bug-fixing remains.

FossilOrigin-Name: 596e728b0eb19a34c888e33d4d37978ca2bf1e00

10 years agoReorder parameters on the sqlite3_user_*() interfaces for consistency.
drh [Thu, 11 Sep 2014 00:27:53 +0000 (00:27 +0000)] 
Reorder parameters on the sqlite3_user_*() interfaces for consistency.
Add the first TCL test cases.

FossilOrigin-Name: 2f6d8f32eef526b5912f42ab467e3c7812480d8b

10 years agoComplete the implementation of the various APIs. Fix several problems.
drh [Wed, 10 Sep 2014 22:46:46 +0000 (22:46 +0000)] 
Complete the implementation of the various APIs.  Fix several problems.
This is another incremental check-in that does not completely work.

FossilOrigin-Name: 4eaaa7fa87aa912d24f8b35440ab60310dc08310

10 years agoAdd the ".user" shell command and implement the sqlite3_user_add()
drh [Wed, 10 Sep 2014 19:01:14 +0000 (19:01 +0000)] 
Add the ".user" shell command and implement the sqlite3_user_add()
routine.  Incremental check-in.  The code compiles but does not work.

FossilOrigin-Name: a0455f9deb603bf91684158d911269622720fc1a

10 years agoFurther ideas on user authentication. Not yet working code.
drh [Wed, 10 Sep 2014 17:34:28 +0000 (17:34 +0000)] 
Further ideas on user authentication.  Not yet working code.

FossilOrigin-Name: c8171ecd0d6f097c9e95d5f6643bae8d67f44750

10 years agoChange the name of the _texte64() interfaces to just _test64(), without the "e". 64-bit-lengths
drh [Tue, 9 Sep 2014 20:30:24 +0000 (20:30 +0000)] 
Change the name of the _texte64() interfaces to just _test64(), without the "e".

FossilOrigin-Name: 6ab76c5fedfe568b0f0f34a600f9135bf6558148

10 years agoAdd new interfaces to the loadable extension mechanism.
drh [Tue, 9 Sep 2014 18:41:32 +0000 (18:41 +0000)] 
Add new interfaces to the loadable extension mechanism.

FossilOrigin-Name: 18d80cbc590165913d82056aa69ddaeea07b76ec

10 years agoAdd new APIs that take 64-bit length parameters:
drh [Tue, 9 Sep 2014 17:27:35 +0000 (17:27 +0000)] 
Add new APIs that take 64-bit length parameters:
sqlite3_malloc64(),
sqlite3_realloc64(),
sqlite3_bind_blob64(),
sqlite3_bind_texte64(),
sqlite3_result_blob64(),
and sqlite3_result_texte64().
Internal memory allocation routines also now use 64-bit unsigned length
parameters for safety.
Also add the sqlite3_msize() interface.
Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid a
integer overflow problem.

FossilOrigin-Name: 94954850cf2e1ec0b7f590c7f46cdc54c72558ce

10 years agoNon-working preliminary implementation attempts on user authentication.
drh [Tue, 9 Sep 2014 14:47:53 +0000 (14:47 +0000)] 
Non-working preliminary implementation attempts on user authentication.

FossilOrigin-Name: 8440f093bac19a41d44ee352744354eab897fe4e

10 years agoFixes to os_unix.c to support database (and other) files larger than 2GiB on Android.
dan [Sat, 6 Sep 2014 17:06:13 +0000 (17:06 +0000)] 
Fixes to os_unix.c to support database (and other) files larger than 2GiB on Android.

FossilOrigin-Name: ad7063aa1a0db32cdbe71815545b2edca57d3bcc

10 years agoMerge latest trunk changes with this branch. android-large-filles
dan [Sat, 6 Sep 2014 16:52:18 +0000 (16:52 +0000)] 
Merge latest trunk changes with this branch.

FossilOrigin-Name: 9dca7ce55797b3eb617859f6189c1a2ec6f66566

10 years agoFixes to os_unix.c to support database (and other) files larger than 2GiB.
dan [Sat, 6 Sep 2014 16:49:40 +0000 (16:49 +0000)] 
Fixes to os_unix.c to support database (and other) files larger than 2GiB.

FossilOrigin-Name: e7fae33c0754488336ce093189a83dfe1b818d89

10 years agoFix typos in comments. No code changes.
peter.d.reid [Sat, 6 Sep 2014 16:39:46 +0000 (16:39 +0000)] 
Fix typos in comments. No code changes.

FossilOrigin-Name: e62aab5e9290503869e1f4d5e0fefd2b4dee0a69

10 years agoDo not require a page-size change if the attempt to change the page size
drh [Sat, 6 Sep 2014 03:38:51 +0000 (03:38 +0000)] 
Do not require a page-size change if the attempt to change the page size
failed due to an OOM error.

FossilOrigin-Name: 4d4fb197dc438a486cf5d967cf435f1132902c63

10 years agoAdd the sqlite3_memdebug_title_count global variable, used during debugging
drh [Sat, 6 Sep 2014 03:16:28 +0000 (03:16 +0000)] 
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

10 years agoFix a couple of typos in comments. No changes to code.
mistachkin [Sat, 6 Sep 2014 02:00:41 +0000 (02:00 +0000)] 
Fix a couple of typos in comments.  No changes to code.

FossilOrigin-Name: a758465e3cfa7e0cb8749d097cd6fb5f86b60955

10 years agoQuery planner heuristic update:
drh [Sat, 6 Sep 2014 01:35:57 +0000 (01:35 +0000)] 
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

10 years agoFix harmless compiler warning.
mistachkin [Fri, 5 Sep 2014 05:58:37 +0000 (05:58 +0000)] 
Fix harmless compiler warning.

FossilOrigin-Name: 733119067757814609a9cea6b975818607bee4e3

10 years agoUpdate comments in the ANALYZE command that describe how the Stat4Accum
drh [Mon, 1 Sep 2014 23:06:44 +0000 (23:06 +0000)] 
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

10 years agoAvoid a confusing (though correct) argument to the sqlite3_result_blob()
drh [Mon, 1 Sep 2014 22:34:54 +0000 (22:34 +0000)] 
Avoid a confusing (though correct) argument to the sqlite3_result_blob()
function in the implementation of ANALYZE.

FossilOrigin-Name: 4cae93f8ae8fb3fe38fd5dc7d3a5ea0d11552841

10 years agoFor sqlite3_win32_is_nt(), assume WinRT is NT-based and revise #ifdef ordering to...
mistachkin [Mon, 1 Sep 2014 19:29:19 +0000 (19:29 +0000)] 
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

10 years agoTweak the documentation for SQLITE_LIMIT_WORKER_THREADS. No changes to
drh [Mon, 1 Sep 2014 18:21:27 +0000 (18:21 +0000)] 
Tweak the documentation for SQLITE_LIMIT_WORKER_THREADS.  No changes to
executable code.

FossilOrigin-Name: 672e7387b1bda8d007da7de4244226577d7ab2dc

10 years agoAdd support for using separate worker threads to speed large sorts.
drh [Mon, 1 Sep 2014 17:36:46 +0000 (17:36 +0000)] 
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

10 years agoAttempt to make the xDelete method of the unix VFS more robust on VxWorks.
drh [Mon, 1 Sep 2014 13:37:55 +0000 (13:37 +0000)] 
Attempt to make the xDelete method of the unix VFS more robust on VxWorks.

FossilOrigin-Name: b0f6b91f36b503d8ba8d5257bb194f8c1afb4833

10 years agoMicro-optimizations in sqlite3BtreeNext() and sqlite3BtreePrevious().
drh [Mon, 1 Sep 2014 13:29:32 +0000 (13:29 +0000)] 
Micro-optimizations in sqlite3BtreeNext() and sqlite3BtreePrevious().

FossilOrigin-Name: 839c7996eecd5480152c514555b9aa1121a69ce0

10 years agoFix harmless compiler warnings for MSVC.
mistachkin [Mon, 1 Sep 2014 01:16:49 +0000 (01:16 +0000)] 
Fix harmless compiler warnings for MSVC.

FossilOrigin-Name: 3ef3246120d72dffe469733bb21667a548af0a44

10 years agoIn the command-line shell, added options --lookaside, --pagecache, and
drh [Sat, 30 Aug 2014 15:49:25 +0000 (15:49 +0000)] 
In the command-line shell, added options --lookaside, --pagecache, and
--scratch used to configure auxiliary memories.

FossilOrigin-Name: f61db04be4d7fb21b7f721647c37c45e283ffbea

10 years agoDisable worker threads when SQLITE_THREADSAFE=0. Set the default compile-time threads
drh [Fri, 29 Aug 2014 19:06:07 +0000 (19:06 +0000)] 
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

10 years agoFix the speedtest1.c test program to set the worker thread count using
drh [Fri, 29 Aug 2014 18:06:33 +0000 (18:06 +0000)] 
Fix the speedtest1.c test program to set the worker thread count using
the threads pragma.

FossilOrigin-Name: 2ab4b5adc60b52bf2d2b79968d226b8dd7d2ab3b

10 years agoAdd SQLITE_LIMIT_WORKER_THREADS for controlling the maximum number of
drh [Fri, 29 Aug 2014 16:20:47 +0000 (16:20 +0000)] 
Add SQLITE_LIMIT_WORKER_THREADS for controlling the maximum number of
worker threads.

FossilOrigin-Name: 1b598c68f32db635d1cea1373bedc434aa60cf08

10 years agoMerge recent performance enhancements from trunk onto the threads branch.
drh [Fri, 29 Aug 2014 14:40:07 +0000 (14:40 +0000)] 
Merge recent performance enhancements from trunk onto the threads branch.

FossilOrigin-Name: 35c44a3c73e2e8b14ff194c41986f4bdb9dfe737

10 years agoNote a fault after all, rather a testing mistake.
drh [Fri, 29 Aug 2014 14:20:46 +0000 (14:20 +0000)] 
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

10 years agoAvoid an unnecessary OP_Move operation for expression subqueries.
drh [Fri, 29 Aug 2014 12:29:39 +0000 (12:29 +0000)] 
Avoid an unnecessary OP_Move operation for expression subqueries.

FossilOrigin-Name: 462f42af52f146fd328ddcbbe78c8444ef7bd2c3

10 years agoImproved WHERETRACE messages for the estimated output row reductions from
drh [Thu, 28 Aug 2014 19:38:22 +0000 (19:38 +0000)] 
Improved WHERETRACE messages for the estimated output row reductions from
range scans.

FossilOrigin-Name: fdd478bb11eb9e244a7a1fb628ac27c53830fb24

10 years agoFix a problem causing an inaccurate stat4-based estimate for the
drh [Thu, 28 Aug 2014 17:30:28 +0000 (17:30 +0000)] 
Fix a problem causing an inaccurate stat4-based estimate for the
number of rows visited by a range scan.

FossilOrigin-Name: a9daf3ac444b896013f4054051937d49a597624a

10 years agoAdd a testcase() macro to help verfity the row estimation logic. stat4-experimental
drh [Thu, 28 Aug 2014 17:20:37 +0000 (17:20 +0000)] 
Add a testcase() macro to help verfity the row estimation logic.

FossilOrigin-Name: 6ba609522ea7325341fad93bdb5f869c6506dea4

10 years agoFix a problem causing an inaccurate stat4-based estimate for the number of rows visit...
dan [Thu, 28 Aug 2014 16:01:31 +0000 (16:01 +0000)] 
Fix a problem causing an inaccurate stat4-based estimate for the number of rows visited by a range scan.

FossilOrigin-Name: 052d89b554a947b7e420b7feb6650f5069b7cefa

10 years agoFix a formatting error ("%d" needed in place of "%g") on a WHERETRACE
drh [Thu, 28 Aug 2014 13:42:13 +0000 (13:42 +0000)] 
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

10 years agoRefactor the sqlite3PcacheFetch() routine into three separate routines,
drh [Wed, 27 Aug 2014 23:18:01 +0000 (23:18 +0000)] 
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

10 years agoAdd a VDBE synopsis comment for clarification.
mistachkin [Wed, 27 Aug 2014 17:53:40 +0000 (17:53 +0000)] 
Add a VDBE synopsis comment for clarification.

FossilOrigin-Name: 029a6dc744c24e7be482298c678af8a115d6a87b

10 years agoAdd a missing ticket number to a comment in index7.test.
dan [Wed, 27 Aug 2014 17:48:15 +0000 (17:48 +0000)] 
Add a missing ticket number to a comment in index7.test.

FossilOrigin-Name: d8b1c4336145d436241863c3525530e24a24799b

10 years agoWhen determining whether or not a partial index is usable, do not assume that the...
dan [Wed, 27 Aug 2014 17:37:20 +0000 (17:37 +0000)] 
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

10 years agoIn the sqlite3_context object, keep a pointer to the result value rather
drh [Wed, 27 Aug 2014 14:14:06 +0000 (14:14 +0000)] 
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

10 years agoFactor out the exception paths from sqlite3ValueToText() into a separate
drh [Wed, 27 Aug 2014 03:28:50 +0000 (03:28 +0000)] 
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

10 years agoPerformance enhancement in sqlite3VdbeMemNulTerminate().
drh [Wed, 27 Aug 2014 00:50:11 +0000 (00:50 +0000)] 
Performance enhancement in sqlite3VdbeMemNulTerminate().

FossilOrigin-Name: f94cacc393e895522b92c9717c53357afc918d60

10 years agoChange the page cache so that a new sqlite3_pcache object is allocated as
drh [Tue, 26 Aug 2014 15:06:49 +0000 (15:06 +0000)] 
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