]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
11 years agoFix some problems to do with WITH clauses and name resolution. common-table-expr
dan [Fri, 17 Jan 2014 14:59:27 +0000 (14:59 +0000)] 
Fix some problems to do with WITH clauses and name resolution.

FossilOrigin-Name: 6a549187ed8b5ed50daefa676ff666ae2ed43346

11 years agoRemove some code from resolve.c that was only required for recursive cte references...
dan [Fri, 17 Jan 2014 11:48:24 +0000 (11:48 +0000)] 
Remove some code from resolve.c that was only required for recursive cte references in sub-queries. Also a stray "finish_test" command in pagerfault.test.

FossilOrigin-Name: f68c6c4d36481526a9348244adc571ea282dc9eb

11 years agoAdd the ability for the authorizer callback to disallow recursive
drh [Thu, 16 Jan 2014 22:40:02 +0000 (22:40 +0000)] 
Add the ability for the authorizer callback to disallow recursive
queries.

FossilOrigin-Name: 9efc120a1548c03f3d8aabbadf1050ff2a119c31

11 years agoTweaks to error message text.
drh [Thu, 16 Jan 2014 21:59:51 +0000 (21:59 +0000)] 
Tweaks to error message text.

FossilOrigin-Name: 090a77d97808b86d1e9f5c63c743a2b159a15f5d

11 years agoImprove the error messages used to report illegal recursive cte references.
dan [Thu, 16 Jan 2014 21:02:02 +0000 (21:02 +0000)] 
Improve the error messages used to report illegal recursive cte references.

FossilOrigin-Name: 54eee9fe99290e59469bd3e1a66bb749887d37ee

11 years agoAllow only a single recursive reference in a recursive CTE. Also require that this...
dan [Thu, 16 Jan 2014 18:34:33 +0000 (18:34 +0000)] 
Allow only a single recursive reference in a recursive CTE. Also require that this reference is not part of a sub-query.

FossilOrigin-Name: a296b73360d34c9364eceb2cc09a9a92adc4abb8

11 years agoDisable the flattening optimization if the parent query is the recursive part of...
dan [Thu, 16 Jan 2014 10:58:39 +0000 (10:58 +0000)] 
Disable the flattening optimization if the parent query is the recursive part of a recursive CTE and the sub-query is a compound query.

FossilOrigin-Name: 6bfa387e82de47ca1f40225fe28d873e29d6f481

11 years agoMerge trunk changes. Fix a possible NULL-pointer deference in WITH clause
drh [Thu, 16 Jan 2014 04:37:13 +0000 (04:37 +0000)] 
Merge trunk changes.  Fix a possible NULL-pointer deference in WITH clause
name resolution.

FossilOrigin-Name: 7f953b568baa3eede0b9c144be0b9bc86496341a

11 years agoRemove an ALWAYS() that is no longer always true.
drh [Wed, 15 Jan 2014 20:10:15 +0000 (20:10 +0000)] 
Remove an ALWAYS() that is no longer always true.

FossilOrigin-Name: c95823cd451f7721174393817a801403647467db

11 years agoFixes so that SQLITE_OMIT_CTE builds work.
dan [Wed, 15 Jan 2014 19:42:23 +0000 (19:42 +0000)] 
Fixes so that SQLITE_OMIT_CTE builds work.

FossilOrigin-Name: 3908e2ea2e7e5f466cbbbffdc27e0fe8dc9751ac

11 years agoFurther comments on WITH-clause processing routines in select.c.
drh [Wed, 15 Jan 2014 18:35:52 +0000 (18:35 +0000)] 
Further comments on WITH-clause processing routines in select.c.

FossilOrigin-Name: c948384dfdd9f68a832d5a452af44f35337f66e7

11 years agoAdd a header comment to the searchWith() routine.
drh [Wed, 15 Jan 2014 18:23:00 +0000 (18:23 +0000)] 
Add a header comment to the searchWith() routine.

FossilOrigin-Name: d9ae0f5d9f8230ca7ca10ebed300e2f6635a0614

11 years agoDisable automatic indices on recursive CTE references.
dan [Wed, 15 Jan 2014 18:21:41 +0000 (18:21 +0000)] 
Disable automatic indices on recursive CTE references.

FossilOrigin-Name: 28aa6db8c878655255dbfb618f8d65be78e3d7e5

11 years agoWhen resolving names, consider a reference to a recursive CTE column as equivalent...
dan [Wed, 15 Jan 2014 18:12:00 +0000 (18:12 +0000)] 
When resolving names, consider a reference to a recursive CTE column as equivalent to a reference to the outermost name-context. This ensures that correlated sub-queries are correctly identified as such.

FossilOrigin-Name: 61be2da0ae623c1572819481508b044e9d32f294

11 years agoReturn an error if a CTE specifies a different number of columns than its SELECT...
dan [Wed, 15 Jan 2014 15:27:51 +0000 (15:27 +0000)] 
Return an error if a CTE specifies a different number of columns than its SELECT statement returns.

FossilOrigin-Name: 9a514b50e4b01f109fbdb0aabcbfe1ddab129b44

11 years agoDon't try to verify the schema of transient table (such as generated inside
drh [Wed, 15 Jan 2014 14:40:41 +0000 (14:40 +0000)] 
Don't try to verify the schema of transient table (such as generated inside
a WITH clause) when generating code for "IN table" operators.

FossilOrigin-Name: 860aa936634a60d68e3954fc408a96a9260394e0

11 years agoDisable the flattening optimization if the sub-query is a recursive CTE.
dan [Wed, 15 Jan 2014 14:17:31 +0000 (14:17 +0000)] 
Disable the flattening optimization if the sub-query is a recursive CTE.

FossilOrigin-Name: 9472f6d820a7fb233936d9b8f7a39c9d4c4d6d73

11 years agoUse the user-supplied table name in WITH RECURSIVE tables as the internal
drh [Wed, 15 Jan 2014 02:40:11 +0000 (02:40 +0000)] 
Use the user-supplied table name in WITH RECURSIVE tables as the internal
name of the table and the name of the table in VDBE comments.

FossilOrigin-Name: a29330238be6366444269a0b1b328475b2d01ae2

11 years agoAdd code to handle recursive CTEs.
dan [Tue, 14 Jan 2014 20:14:09 +0000 (20:14 +0000)] 
Add code to handle recursive CTEs.

FossilOrigin-Name: a5c2a54a07d35166911abc792008c05dea897742

11 years agoFix harmless compiler warning in LEMON.
mistachkin [Tue, 14 Jan 2014 10:17:21 +0000 (10:17 +0000)] 
Fix harmless compiler warning in LEMON.

FossilOrigin-Name: f61a70589ac7e05008a362bd9d5b7bde5d07a758

11 years agoFor the Win32 VFS, defining winShmMutexHeld should be controlled by NDEBUG, not SQLIT...
mistachkin [Tue, 14 Jan 2014 10:17:02 +0000 (10:17 +0000)] 
For the Win32 VFS, defining winShmMutexHeld should be controlled by NDEBUG, not SQLITE_DEBUG.

FossilOrigin-Name: 1e131094b522103a0829f72193b067b04e42ce82

11 years agoIn the command-line shell, defend against a NULL-pointer dereference in the
drh [Mon, 13 Jan 2014 20:38:35 +0000 (20:38 +0000)] 
In the command-line shell, defend against a NULL-pointer dereference in the
case where sqlite3_column_name() returns NULL (as might happen following an
OOM error).

FossilOrigin-Name: ac15455abcb9bdb88b53129348668a1442f6899f

11 years agoFor statements of just an unadorned VALUES clause, assign column names
drh [Mon, 13 Jan 2014 20:32:18 +0000 (20:32 +0000)] 
For statements of just an unadorned VALUES clause, assign column names
as "columnN" for increasing whole numbers N.

FossilOrigin-Name: 260587d2727f66d7fd65ef672ee46c92024f1d30

11 years agoFix some memory leaks and crashes that could follow an OOM condition during WITH...
dan [Mon, 13 Jan 2014 16:36:40 +0000 (16:36 +0000)] 
Fix some memory leaks and crashes that could follow an OOM condition during WITH clause parsing.

FossilOrigin-Name: 8839850c44a8938883e493eacd752fa686e542df

11 years agoAdd code to handle non-recursive CTEs in the same way as SQL views.
dan [Mon, 13 Jan 2014 15:12:23 +0000 (15:12 +0000)] 
Add code to handle non-recursive CTEs in the same way as SQL views.

FossilOrigin-Name: a26f399ba485e8127c276c5f103ec6c555e11734

11 years agoUpdate the parser so that sub-queries and CTEs may have WITH clauses.
dan [Sat, 11 Jan 2014 19:19:36 +0000 (19:19 +0000)] 
Update the parser so that sub-queries and CTEs may have WITH clauses.

FossilOrigin-Name: 704d3931b855562a619769955969d439c42ca406

11 years agoParse common table expressions. But do not do anything with them (yet).
drh [Sat, 11 Jan 2014 13:22:17 +0000 (13:22 +0000)] 
Parse common table expressions.  But do not do anything with them (yet).

FossilOrigin-Name: da98b7205eb3d7ec2ddbf8a8e24eee0b2ff499a5

11 years agoIn LEMON, limit the size of the grammar file to 100MB. This ensures that
drh [Sat, 11 Jan 2014 12:52:25 +0000 (12:52 +0000)] 
In LEMON, limit the size of the grammar file to 100MB.  This ensures that
the program will never experience integer overflow.  To be doubly sure,
use calloc() instead of malloc() when allocating arrays.

FossilOrigin-Name: 29ba458d849ad8864711cbe59fb10447a947e06a

11 years agoOptimizations to the SQL language grammar that result in a small size
drh [Sat, 11 Jan 2014 03:54:05 +0000 (03:54 +0000)] 
Optimizations to the SQL language grammar that result in a small size
reduction and speed increase.

FossilOrigin-Name: cb5d1f83e0a33d546d4c0cb817ef1f8440d1f738

11 years agoAdd the "%token_class" directive to the LEMON parser generator. This opens up
drh [Sat, 11 Jan 2014 03:27:37 +0000 (03:27 +0000)] 
Add the "%token_class" directive to the LEMON parser generator.  This opens up
the possibility of simplifying the parser.  Also remove all calls to
sprintf(), strcpy(), and strcat() from LEMON to avoid compiler warnings
on OpenBSD.  (Aside:  It is this change to avoid harmless compiler warnings
that was the cause of the reason spat of bugs.)

FossilOrigin-Name: 8eb48c04bd0a14031488b3160fde67307eb8b35d

11 years agoIn LEMON, fix a bug in the text formatter introduced by the previous lemon-updates
drh [Sat, 11 Jan 2014 03:06:18 +0000 (03:06 +0000)] 
In LEMON, fix a bug in the text formatter introduced by the previous
commit.  Also add the new "%token_class" directive for defining symbolic
names that stand any one of a collection of tokens.

FossilOrigin-Name: da7890ca6b1d8e511377a469047120220e8c3b2d

11 years agoDo not use sprintf(), strcpy() or strcat() in the implementation of the
drh [Fri, 10 Jan 2014 23:21:00 +0000 (23:21 +0000)] 
Do not use sprintf(), strcpy() or strcat() in the implementation of the
lemon parser generator tool, to avoid compiler warnings in OpenBSD.

FossilOrigin-Name: e43c522dde01e134f1adc94f534d2b3eda74afc2

11 years agoRemove unused structure definition from parse.y.
drh [Fri, 10 Jan 2014 20:51:16 +0000 (20:51 +0000)] 
Remove unused structure definition from parse.y.

FossilOrigin-Name: 7f1e7ae313c7625ef2623d78883dce776eecca30

11 years agoAllow a VALUES clause to be used any place that a SELECT statement can be
drh [Fri, 10 Jan 2014 20:46:55 +0000 (20:46 +0000)] 
Allow a VALUES clause to be used any place that a SELECT statement can be
used.

FossilOrigin-Name: c9ea7d199f06a7801ab639e7ac98ebeb98706f24

11 years agoFix CREATE TABLE ... AS so that it works with column names that are empty
drh [Fri, 10 Jan 2014 20:38:12 +0000 (20:38 +0000)] 
Fix CREATE TABLE ... AS so that it works with column names that are empty
strings.

FossilOrigin-Name: 632045f21c553e10f59a14c772d50d7824ca0c2c

11 years agoFix another harmless compiler warning in unixUnfetch().
dan [Fri, 10 Jan 2014 16:40:21 +0000 (16:40 +0000)] 
Fix another harmless compiler warning in unixUnfetch().

FossilOrigin-Name: 0484549bb82ca5246488330c8d266e429ccd19b9

11 years agoFix harmless compiler warning in unixUnfetch().
drh [Thu, 9 Jan 2014 13:39:07 +0000 (13:39 +0000)] 
Fix harmless compiler warning in unixUnfetch().

FossilOrigin-Name: 618f248f4ea9fb0b6ff019a4c2cd72857389301f

11 years agoFix an typo that breaks the build when SQLITE_ENABLE_TREE_EXPLAIN is defined.
drh [Sat, 4 Jan 2014 20:00:14 +0000 (20:00 +0000)] 
Fix an typo that breaks the build when SQLITE_ENABLE_TREE_EXPLAIN is defined.

FossilOrigin-Name: f461e2b3973d0fe6a7b8cb7a3aaab8a30b3e16c0

11 years agoAdd the usual "fts3" prefix to new static method setEstimatedRows() in fts3.c. This...
dan [Sat, 4 Jan 2014 19:58:29 +0000 (19:58 +0000)] 
Add the usual "fts3" prefix to new static method setEstimatedRows() in fts3.c. This fixes a problem when compiling the amalgamation, as the r-tree module also contains a static method named setEstimatedRows.

FossilOrigin-Name: d6fcfc8890489b942e5b3f1bc271835d77c5ef96

11 years agoAvoid redundant register loads during index key generation when doing a
drh [Sat, 4 Jan 2014 19:27:05 +0000 (19:27 +0000)] 
Avoid redundant register loads during index key generation when doing a
DELETE or INTEGRITY_CHECK on a table with multiple indices.

FossilOrigin-Name: 8f6e6149a165f516be6395fd753e163d52ffd52e

11 years agoOmit OP_Close operations that occur immediately prior to OP_Halt and which
drh [Sat, 4 Jan 2014 16:49:02 +0000 (16:49 +0000)] 
Omit OP_Close operations that occur immediately prior to OP_Halt and which
cannot be jumped over.

FossilOrigin-Name: 874b7e9999811c288ad41d07709f88e458d2d497

11 years agoImprovements to the column-cache for nested AND/OR operators.
drh [Sat, 4 Jan 2014 15:17:04 +0000 (15:17 +0000)] 
Improvements to the column-cache for nested AND/OR operators.

FossilOrigin-Name: 4e725f53131d3584319c710c8710a068989543c6

11 years agoHave FTS assign extremely high costs to plans that feature unusable MATCH constraints...
dan [Sat, 4 Jan 2014 14:46:39 +0000 (14:46 +0000)] 
Have FTS assign extremely high costs to plans that feature unusable MATCH constraints. This discourages the planner from choosing such plans, which lead to "unable to use function MATCH in the requested context" errors.

FossilOrigin-Name: fa8be488a3ad290722dae7a1a7396c77277b2149

11 years agoInstead of having the planner ignore plans with unusable MATCH constraints, have... avoid-unusable-match
dan [Sat, 4 Jan 2014 14:42:14 +0000 (14:42 +0000)] 
Instead of having the planner ignore plans with unusable MATCH constraints, have FTS assign extremely high costs to such plans in order to discourage the planner from using them.

FossilOrigin-Name: 24f84b38131866f7b435ffe641bb2f6991a70db2

11 years agoHave the planner detect cases where a MATCH constraint is applied to a virtual table...
dan [Sat, 4 Jan 2014 14:16:06 +0000 (14:16 +0000)] 
Have the planner detect cases where a MATCH constraint is applied to a virtual table, and ignore any plans that do not allow the virtual table implementation to implement the MATCH filtering.

FossilOrigin-Name: 19f3208b26597625728d1ef716d4e44407cf96ac

11 years agoAvoid some unnecessary OP_SCopy operations when inserting into a table
drh [Fri, 3 Jan 2014 16:03:43 +0000 (16:03 +0000)] 
Avoid some unnecessary OP_SCopy operations when inserting into a table
with multiple indices.

FossilOrigin-Name: 429018b19cb525a4bb0843d20955457b53900d4b

11 years agoTry to factor constant subcomponents of the WHERE clause out of the loop.
drh [Thu, 2 Jan 2014 21:05:10 +0000 (21:05 +0000)] 
Try to factor constant subcomponents of the WHERE clause out of the loop.

FossilOrigin-Name: 9d05777fe24e1a5ce71762de38db840931ef0bc8

11 years agoAvoid unnecessary affinity transformations when building indices using
drh [Thu, 2 Jan 2014 19:35:30 +0000 (19:35 +0000)] 
Avoid unnecessary affinity transformations when building indices using
data from a table.

FossilOrigin-Name: 10d851353c2abeadbd2852c210a7ff9f7f513e5d

11 years agoBe more aggressive in optimizing constant conditional expressions.
drh [Thu, 2 Jan 2014 17:57:16 +0000 (17:57 +0000)] 
Be more aggressive in optimizing constant conditional expressions.

FossilOrigin-Name: b7e39851a75b87ebca747b26a39989560fd6362b

11 years agoTry to detect process ID changes due to fork() calls in os_unix.c and
drh [Wed, 1 Jan 2014 15:18:36 +0000 (15:18 +0000)] 
Try to detect process ID changes due to fork() calls in os_unix.c and
reset the PRNG when a process ID change is detected.

FossilOrigin-Name: e1eba1fb09d7db49d77928bd115b27b8002ae640

11 years agoEnhance sqlite3_randomness(N,P) such that it resets the internal PRNG
drh [Wed, 1 Jan 2014 14:00:13 +0000 (14:00 +0000)] 
Enhance sqlite3_randomness(N,P) such that it resets the internal PRNG
if N is less than 1.  Subsequent calls to sqlite3_randomness() will reinitialize
the internal PRNG by calling the xRandomness() method of the default VFS.

FossilOrigin-Name: a221aa82bb5496885fd0bf76e4601443799511de

11 years agoAdd -I. to the main.mk makefile for building sqlite3.o and speedtest1.
drh [Tue, 24 Dec 2013 12:04:24 +0000 (12:04 +0000)] 
Add -I. to the main.mk makefile for building sqlite3.o and speedtest1.

FossilOrigin-Name: cc72c5aec7fe93d4a1368517aab949dc98d33003

11 years agoMove elements of the Vdbe object that are only used during statement
drh [Mon, 23 Dec 2013 19:09:07 +0000 (19:09 +0000)] 
Move elements of the Vdbe object that are only used during statement
preparation out into the Parse object.

FossilOrigin-Name: c289a253c0c053ac8fc344efe138262c327d8096

11 years agoRemove a stray tab character.
drh [Mon, 23 Dec 2013 11:33:32 +0000 (11:33 +0000)] 
Remove a stray tab character.

FossilOrigin-Name: 25b8a1c9ba77df3b7c78cbce922cb593d661696d

11 years agoRemove a condition that is always in the logic that handles reading
drh [Sun, 22 Dec 2013 22:45:14 +0000 (22:45 +0000)] 
Remove a condition that is always in the logic that handles reading
default values for columns.

FossilOrigin-Name: 895af097e71749f423b63ece17c5a4b4dfcd164d

11 years agoMake sure the WhereLoop.aLTerm[] array is large enough when processing
drh [Sun, 22 Dec 2013 20:44:10 +0000 (20:44 +0000)] 
Make sure the WhereLoop.aLTerm[] array is large enough when processing
the skip-scan optimization.  Fix for ticket [520070ec7fbaac].

FossilOrigin-Name: 46d040591f27be01b1860344f8a268797fe344f4

11 years agoFix speedtest1.c so that in --explain mode it only outputs non-explain text
drh [Sat, 21 Dec 2013 17:14:58 +0000 (17:14 +0000)] 
Fix speedtest1.c so that in --explain mode it only outputs non-explain text
for DDL statements.

FossilOrigin-Name: 2d2b3c4951dc2b8317d5ba8b5cf72b1f4a6668f6

11 years agoAvoid compiler warnings by only enabling sqlite3ErrName() when
drh [Sat, 21 Dec 2013 17:07:13 +0000 (17:07 +0000)] 
Avoid compiler warnings by only enabling sqlite3ErrName() when
SQLITE_TEST is defined.

FossilOrigin-Name: 862228e50534a6b89c9498c4db664610db11485e

11 years agoFix harmless compiler warnings in FTS4. This involved corrupting
drh [Sat, 21 Dec 2013 16:06:47 +0000 (16:06 +0000)] 
Fix harmless compiler warnings in FTS4.  This involved corrupting
Martin Porter's beautifully written and elegant stemmer code, making it
a little less beautiful and a little less elegant.  Today is a sad
day.  But the warnings from GCC grow increasingly verbose and irksome
with each new release and so something had to be done.

FossilOrigin-Name: df05679838b571c16a7ab7e135f9564cd2d9647c

11 years agoFix the ".echo on" dot-command of the shell so that it echos comments in
drh [Sat, 21 Dec 2013 15:46:06 +0000 (15:46 +0000)] 
Fix the ".echo on" dot-command of the shell so that it echos comments in
addition to SQL statements and dot-commands.  Add the --explain option
to speedtest1 so that the output can be piped into the command-line shell
to show nicely-formated VDBE code for the entire test.

FossilOrigin-Name: 96397263f94256e284aae9506de1fc48fea89193

11 years agoAdd a case to speedtest1.c that demonstrates the need to factor OP_Column
drh [Sat, 21 Dec 2013 00:04:37 +0000 (00:04 +0000)] 
Add a case to speedtest1.c that demonstrates the need to factor OP_Column
operators out of inner loops.

FossilOrigin-Name: 69a17336fdf4ae891e815914be8942f7222230c2

11 years agoFix compiler harmless warnings in tclsqlite.c that appeared with GCC 4.8.x.
drh [Fri, 20 Dec 2013 18:57:44 +0000 (18:57 +0000)] 
Fix compiler harmless warnings in tclsqlite.c that appeared with GCC 4.8.x.

FossilOrigin-Name: d93ae6833a7fca0672caf902a7b48846e54242cd

11 years agoCode simplification in sqlite3GenerateIndexKey() by making use of a subroutine
drh [Fri, 20 Dec 2013 18:44:35 +0000 (18:44 +0000)] 
Code simplification in sqlite3GenerateIndexKey() by making use of a subroutine
found over in expr.c.

FossilOrigin-Name: 0026d3355340d66687a3fd4cbece28811ef1b505

11 years agoCombine adjacent single-register OP_Copy instructions into a single
drh [Fri, 20 Dec 2013 15:59:20 +0000 (15:59 +0000)] 
Combine adjacent single-register OP_Copy instructions into a single
multi-register OP_Copy, where possible.  Fix the Synopsis comment for
multi-register OP_Copy instructions to show the correct register ranges.

FossilOrigin-Name: 2ae22dc0cbed2feca4baf89d02aaace0331971d6

11 years agoAllow any arbitrary expression as the filename in an ATTACH statement,
drh [Fri, 20 Dec 2013 14:48:12 +0000 (14:48 +0000)] 
Allow any arbitrary expression as the filename in an ATTACH statement,
including functions and subqueries.

FossilOrigin-Name: df70a1f30393b34146d6b8bf1df5a76aaf362efe

11 years agoSimplify the accumulator reset for aggregate query processing so that it
drh [Fri, 20 Dec 2013 13:11:45 +0000 (13:11 +0000)] 
Simplify the accumulator reset for aggregate query processing so that it
uses a single multi-register OP_Null rather than a separate OP_Null for each
register.

FossilOrigin-Name: 2c7fd9b043f5f3d9d8e22dbefa84a9770ca951d0

11 years agoDo not inject OOM faults into SQLITE_FCNTL_COMMIT_PHASE_TWO file-control invocations...
dan [Thu, 19 Dec 2013 17:04:58 +0000 (17:04 +0000)] 
Do not inject OOM faults into SQLITE_FCNTL_COMMIT_PHASE_TWO file-control invocations. It causes problems for test scripts.

FossilOrigin-Name: 8eb28d23e353139d24a8af78309d39249ab9eaf0

11 years agoMake sure errors encountered while initializing extensions such as FTS4
drh [Thu, 19 Dec 2013 16:26:05 +0000 (16:26 +0000)] 
Make sure errors encountered while initializing extensions such as FTS4
get reported out from sqlite3_open().  This fixes a bug introduced by
check-in [9d347f547e7ba9].  Also remove lots of forgotten "breakpoint"
commands left in test scripts over the years.

FossilOrigin-Name: ca3fdfd41961d8d3d1e39d20dc628e8a95dabb2f

11 years agoRemove an unneeded column-cache flush in aggregate SELECT
drh [Thu, 19 Dec 2013 14:34:34 +0000 (14:34 +0000)] 
Remove an unneeded column-cache flush in aggregate SELECT
and an unreachable branch in the INSERT logic.

FossilOrigin-Name: ffa092e13b3781677b18418cca40e3dd1e388aed

11 years agoOmit an unnecessary OP_Null opcode from UPDATE.
drh [Thu, 19 Dec 2013 02:56:01 +0000 (02:56 +0000)] 
Omit an unnecessary OP_Null opcode from UPDATE.

FossilOrigin-Name: 72d111336c5016e5b5092dfebcd01253266a7685

11 years agoOmit one or more pointless instructions that occur in between OP_NoConflict
drh [Thu, 19 Dec 2013 02:23:45 +0000 (02:23 +0000)] 
Omit one or more pointless instructions that occur in between OP_NoConflict
and OP_Halt.

FossilOrigin-Name: 61e2f3575c4a94f9571c28fb2bd19da84b0edceb

11 years agoRemove an unnecessary column-cache flush operation. Add code to trace the
drh [Wed, 18 Dec 2013 18:44:43 +0000 (18:44 +0000)] 
Remove an unnecessary column-cache flush operation.  Add code to trace the
column cache when compiled with SQLITE_DEBUG and using
PRAGMA vdbe_addoptrace=ON.

FossilOrigin-Name: 58704ed1f4cd78bb3b0c095ffd1626906a95a413

11 years agoRemove an unnecessary column-cache flush. Add another test case to the column-cache-debug
drh [Wed, 18 Dec 2013 16:27:48 +0000 (16:27 +0000)] 
Remove an unnecessary column-cache flush.  Add another test case to the
speedtest1.c program to accentuate the benefit of not flushing the cache at
that point.

FossilOrigin-Name: 97fdfc6b79833011fc0c506fe5e0985c0fb1906c

11 years agoShow changes to the column cache when PRAGMA vdbe_addoptrace=ON is set.
drh [Wed, 18 Dec 2013 15:11:47 +0000 (15:11 +0000)] 
Show changes to the column cache when PRAGMA vdbe_addoptrace=ON is set.

FossilOrigin-Name: 4c6a659c432e4f7c0285f58675a67f967b07bb0d

11 years agoAdd evidence marks and additional test cases for the printf() SQL function.
drh [Tue, 17 Dec 2013 16:32:56 +0000 (16:32 +0000)] 
Add evidence marks and additional test cases for the printf() SQL function.

FossilOrigin-Name: 93121d3097a43997af3c0de65bd9bd7663845fa2

11 years agoAdd the printf() SQL function.
drh [Tue, 17 Dec 2013 16:10:57 +0000 (16:10 +0000)] 
Add the printf() SQL function.

FossilOrigin-Name: a1bb62f91a85af0584100c3ad77877a949c30cca

11 years agoFix the formatting of %c in the printf() SQL function. printf-sql-function
drh [Tue, 17 Dec 2013 15:58:42 +0000 (15:58 +0000)] 
Fix the formatting of %c in the printf() SQL function.

FossilOrigin-Name: 3375571a5e267744c19a7c310840256cec57a242

11 years agoAdd the printf() SQL function.
drh [Tue, 17 Dec 2013 15:03:06 +0000 (15:03 +0000)] 
Add the printf() SQL function.

FossilOrigin-Name: 6db7052eeefafdbf26b3153bc38600fecfb53ae6

11 years agoAllow the SQLITE_DETERMINISTIC flag to be ORed into the preferred text encoding
drh [Sat, 14 Dec 2013 13:44:22 +0000 (13:44 +0000)] 
Allow the SQLITE_DETERMINISTIC flag to be ORed into the preferred text encoding
of application-defined functions, to mark the function as deterministic.

FossilOrigin-Name: 5716fc2341ddd8cf64139e7168597f864da4e10b

11 years agoPerformance optimizations in the pager_write() routine of pager.c.
drh [Fri, 13 Dec 2013 20:45:50 +0000 (20:45 +0000)] 
Performance optimizations in the pager_write() routine of pager.c.

FossilOrigin-Name: bc5febef921bd12ca7760e9d07d3be0e67140320

11 years agoReduce the number of calls to the subjRequiresPage() routine inside of pager.
drh [Fri, 13 Dec 2013 19:48:04 +0000 (19:48 +0000)] 
Reduce the number of calls to the subjRequiresPage() routine inside of pager.

FossilOrigin-Name: e50ff39a93a51b5a5be4f0e82a76104b81c9e2a4

11 years agoCreate and use a new pager interface sqlite3PagerUnrefNotNull() that works
drh [Fri, 13 Dec 2013 19:35:21 +0000 (19:35 +0000)] 
Create and use a new pager interface sqlite3PagerUnrefNotNull() that works
just like sqlite3PagerUnref() but guarantees that its argument is not a
NULL pointer.

FossilOrigin-Name: e00f37e2333cac5b53e17cf764ab56c4fcd5f617

11 years agoEnhance the pcache1PinPage() routine so that it called much less often and
drh [Fri, 13 Dec 2013 18:50:40 +0000 (18:50 +0000)] 
Enhance the pcache1PinPage() routine so that it called much less often and
runs much faster in the cases when it is actually called.

FossilOrigin-Name: a845779cd31aec3204a6a9c776bd9c9f7d47dd24

11 years agoAvoid unnecessary calls to sqlite3_free() from within sqlite3VXPrintf().
drh [Fri, 13 Dec 2013 16:42:18 +0000 (16:42 +0000)] 
Avoid unnecessary calls to sqlite3_free() from within sqlite3VXPrintf().

FossilOrigin-Name: e2a8b280e84c1f8fd6106d9427e1ad6cbcfccd10

11 years agoSimplication and optimization of error message handling.
drh [Fri, 13 Dec 2013 16:23:55 +0000 (16:23 +0000)] 
Simplication and optimization of error message handling.

FossilOrigin-Name: 9d347f547e7ba9590b0c68edf50a14ad94a2bb92

11 years agoAdd the SQLITE_FCNTL_SYNC and SQLITE_FCNTL_COMMIT_PHASETWO file-controls
drh [Wed, 11 Dec 2013 15:47:39 +0000 (15:47 +0000)] 
Add the SQLITE_FCNTL_SYNC and SQLITE_FCNTL_COMMIT_PHASETWO file-controls
and have the pager call them at appropriate times.  This is needed in order
to enable ZIPVFS to do multi-file atomic commits.

FossilOrigin-Name: 552f94d50f08cf11f33205730fde52bc2f06cff6

11 years agoMerge in the latest trunk changes. zipvfs-multifile-commit
drh [Wed, 11 Dec 2013 14:17:06 +0000 (14:17 +0000)] 
Merge in the latest trunk changes.

FossilOrigin-Name: 9ff4dfe1e36b40e386858b03f36cfab8f6806fdd

11 years agoFix a bug in the shell ".import" command: Do not end the field
drh [Wed, 11 Dec 2013 14:00:04 +0000 (14:00 +0000)] 
Fix a bug in the shell ".import" command:  Do not end the field
when an escaped double-quote occurs at the end of a CRNL line.

FossilOrigin-Name: 5e239ecda0f7835ce037b38b04627a574b5854cd

11 years agoRemove an unreachable conditional inserted by the previous check-in.
drh [Wed, 11 Dec 2013 12:02:55 +0000 (12:02 +0000)] 
Remove an unreachable conditional inserted by the previous check-in.

FossilOrigin-Name: 3e1d55f0bd84810a035bd6c54583eb373784a9a3

11 years agoHave the crash-test infrastructure code in test6.c read and write the 512-byte block...
dan [Wed, 11 Dec 2013 11:03:19 +0000 (11:03 +0000)] 
Have the crash-test infrastructure code in test6.c read and write the 512-byte block containing the pending-byte lock as normal. Earlier versions did not access this part of the file in order to avoid triggering an assert in os_unix.c. But the assert() has since been removed. And not reading/writing this part of the file causes problems for multiplexor tests.

FossilOrigin-Name: fdc3f3fa3de1481860e1e2a819db2d6c4eb05658

11 years agoFix harmless compiler warnings.
drh [Wed, 11 Dec 2013 11:00:44 +0000 (11:00 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: a7e5fcd66659750eb2f4675082df324e7cf35427

11 years agoFix harmless compiler warning.
mistachkin [Wed, 11 Dec 2013 02:21:19 +0000 (02:21 +0000)] 
Fix harmless compiler warning.

FossilOrigin-Name: 2525296d919245ebb01077aad541e4ae6eab7940

11 years agoDo not run the tool/vdbe-compress.tcl script that generates the
drh [Wed, 11 Dec 2013 00:59:10 +0000 (00:59 +0000)] 
Do not run the tool/vdbe-compress.tcl script that generates the
vdbeExecUnion object that reduces the size of the sqlite3VdbeExec()
stack frame unless the SQLITE_SMALL_STACK compile-time option is
specified as on of the OPTS in the makefile.  The vdbeExecUnion object
gets in the way of C-compiler optimizer and results in slightly slower code.

FossilOrigin-Name: 4d0781473a465b4ab0a307914014f3d2ddd0ce33

11 years agoAvoid unnecessary calls to sqlite3VdbeSerialType() from within
drh [Tue, 10 Dec 2013 21:38:08 +0000 (21:38 +0000)] 
Avoid unnecessary calls to sqlite3VdbeSerialType() from within
sqlite3VdbeSerialPut().

FossilOrigin-Name: 079c04a5013074b68f7d90f1ce8bf8e7092ad8a2

11 years agoIn the OP_MakeRecord opcode, factor out affinity changes into separate loop,
drh [Tue, 10 Dec 2013 20:53:01 +0000 (20:53 +0000)] 
In the OP_MakeRecord opcode, factor out affinity changes into separate loop,
for a slight performance advantage.

FossilOrigin-Name: 1c6ee9b85f61e5cdb5d9b7815cddf526dc78aaa7

11 years agoSimplify and improve the performance of the sqlite3VdbeMemGrow() routine.
drh [Tue, 10 Dec 2013 19:49:00 +0000 (19:49 +0000)] 
Simplify and improve the performance of the sqlite3VdbeMemGrow() routine.

FossilOrigin-Name: 48ecf18774ba9572d86696c60d87007a619d9f53

11 years agoUse SQLITE_FCNTL_SYNC instead of SQLITE_FCNTL_SYNC_OMITTED. Add documentation in...
dan [Tue, 10 Dec 2013 17:34:53 +0000 (17:34 +0000)] 
Use SQLITE_FCNTL_SYNC instead of SQLITE_FCNTL_SYNC_OMITTED. Add documentation in for FCNTL_SYNC and FCNTL_COMMIT_PHASETWO.

FossilOrigin-Name: 46231af985a1a872d1dc3418591cbaacb0b7c249

11 years agoMerge changes from the trunk.
dan [Tue, 10 Dec 2013 16:35:42 +0000 (16:35 +0000)] 
Merge changes from the trunk.

FossilOrigin-Name: 3ee736a39d1fc175a297c5fdd0d2e1c5a9b5b18e

11 years agoFix handling of errors returned by the SQLITE_FCNTL_OMIT_SYNCED file-control.
dan [Tue, 10 Dec 2013 16:27:59 +0000 (16:27 +0000)] 
Fix handling of errors returned by the SQLITE_FCNTL_OMIT_SYNCED file-control.

FossilOrigin-Name: d9a5f44f4a27336d41e60b6c3791bd018fbbff6f

11 years agoSimplifications to the OP_MakeRecord opcode and the sqlite3VdbeSerialPut()
drh [Mon, 9 Dec 2013 23:17:22 +0000 (23:17 +0000)] 
Simplifications to the OP_MakeRecord opcode and the sqlite3VdbeSerialPut()
helper function.

FossilOrigin-Name: 7277a769694787e0332d1a4efc02041834661e2a