]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
7 years agoStricter test cases. location-function
drh [Fri, 29 Dec 2017 16:37:33 +0000 (16:37 +0000)] 
Stricter test cases.

FossilOrigin-Name: 9406c0a685fd5ff3516a66402b0514a1440652822a5eecf0b7af85929f3079e8

7 years agoFix a typo in the MSVC makefile.
drh [Fri, 29 Dec 2017 15:19:03 +0000 (15:19 +0000)] 
Fix a typo in the MSVC makefile.

FossilOrigin-Name: 89e5720a8d8d46d4e2f16f15678e91336117e64abc977174e2b345a30308d0d2

7 years agoChange the function name to sqlite_unsupported_offset(X). Only enable the
drh [Fri, 29 Dec 2017 15:04:49 +0000 (15:04 +0000)] 
Change the function name to sqlite_unsupported_offset(X).  Only enable the
function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC.  The makefiles add
that definition to shell builds.

FossilOrigin-Name: 7a7f826e324b1a2c332e2f1d0740fd0babffcaca6275a798572f02ad367b99ab

7 years agoEnhance location(X) so that it works with indexes and WITHOUT ROWID tables.
drh [Fri, 29 Dec 2017 14:33:54 +0000 (14:33 +0000)] 
Enhance location(X) so that it works with indexes and WITHOUT ROWID tables.
The function might return an offset to the main table or to an index,
depending on whether the column X would be loaded from the main table or
from the index.

FossilOrigin-Name: dd94d6a880dfec4bddd247239b815b84964f804d24841e25f33f1d46a4b5274d

7 years agoMerge recent enhancements from trunk.
drh [Fri, 29 Dec 2017 13:35:09 +0000 (13:35 +0000)] 
Merge recent enhancements from trunk.

FossilOrigin-Name: 6251e438f2a76170fd1e95aa512a46086ed88ab93b9b97a1dba97c4558689305

7 years agoAdd test cases for the undocumented behavior of duplicate columns on an
drh [Fri, 29 Dec 2017 12:50:43 +0000 (12:50 +0000)] 
Add test cases for the undocumented behavior of duplicate columns on an
INSERT or UPDATE.

FossilOrigin-Name: f4349c0c26611de8a7d5beb99431a575cf531cdeb0ca2413efabcf0a61e6f424

7 years agoThe output of sqlite3_trace() now shows each command of a trigger as it is
drh [Wed, 27 Dec 2017 22:09:53 +0000 (22:09 +0000)] 
The output of sqlite3_trace() now shows each command of a trigger as it is
evaluated.  This feature involved major changes to the parser, such as
removing the ExprSpan object and replacing it with a new mechanism for
capturing the original SQL text of phrases in the input SQL.

FossilOrigin-Name: 0fdf97efe5df745510c6b4b377a8ee5683a3a237630bfbd0f56e57c7c6e5b246

7 years agoOmit all sqlite3_trace() output from the triggers associated with span-refactor
drh [Wed, 27 Dec 2017 21:30:34 +0000 (21:30 +0000)] 
Omit all sqlite3_trace() output from the triggers associated with
foreign key constraints.

FossilOrigin-Name: fda08e3d10cc850664a356efdafcfc68187053849e1b00991b0b35d892a6776b

7 years agoShow the text of individual statements within a trigger, as they
drh [Wed, 27 Dec 2017 20:38:35 +0000 (20:38 +0000)] 
Show the text of individual statements within a trigger, as they
execute, as comments in the output from sqlite3_trace() and sqlite3_trace_v2().

FossilOrigin-Name: fe3d2b97d8945e6a9636472f77bcdc92cc5dda8b3e6e3a4fcbdd0a212ea5b9aa

7 years agoAdd and use the internal sqlite3DbSpanDup() interface.
drh [Wed, 27 Dec 2017 19:43:22 +0000 (19:43 +0000)] 
Add and use the internal sqlite3DbSpanDup() interface.

FossilOrigin-Name: a8e1545cb7aacb6a26a8c92a3ad4a3d584d150c3a00d2828c8adbb1ee19fcb6d

7 years agoMerge recent enhancements from trunk.
drh [Wed, 27 Dec 2017 19:27:26 +0000 (19:27 +0000)] 
Merge recent enhancements from trunk.

FossilOrigin-Name: 76373091354f27577e5235e96cfaa4b31429a38d1e0e1d6e094c4cc323b92a0a

7 years agoEnhance the Lemon parser generator so that it creates a faster parser at the
drh [Wed, 27 Dec 2017 18:19:06 +0000 (18:19 +0000)] 
Enhance the Lemon parser generator so that it creates a faster parser at the
cost of slightly larger parser tables.  Add the ability to measure coverage
of the generated state machine when compiling with the -DYYCONVERGE option.
In SQLite, add the SQLITE_TESTCTRL_PARSER_COVERAGE test-control to query the
new parser coverage feature.

FossilOrigin-Name: 1b22b42e59793af19c69a2e5f6822883cc2687d4a0d9b9280bbff885276c6baa

7 years agoThe previous check-in had an error in the coverage reporting logic. lemon-improvements
drh [Wed, 27 Dec 2017 17:36:58 +0000 (17:36 +0000)] 
The previous check-in had an error in the coverage reporting logic.

FossilOrigin-Name: ec9b19eb652e81cd3c8a5595eb39aac3aca4abe72136c4b65c9cc257594a9c92

7 years agoChange the coverage measurement logic in the lemon-generated parser so that
drh [Wed, 27 Dec 2017 17:14:50 +0000 (17:14 +0000)] 
Change the coverage measurement logic in the lemon-generated parser so that
it only checks for coverage of state/lookahead pairs that are valid syntax.
It turns out that some states are unreachable if the lookahead is not valid
syntax, because the states are only reachable through a shift following a
reduce, and the reduce does not happen if the lookahead is a syntax error.

FossilOrigin-Name: 9dce46508772bd0f9e940c4d44933154044bb58c1b3511dd0143287bf795dd6b

7 years agoIn the lemon-generated parser, do not report the End-of-input character and
drh [Wed, 27 Dec 2017 16:13:22 +0000 (16:13 +0000)] 
In the lemon-generated parser, do not report the End-of-input character and
the wildcard character as missed coverage.

FossilOrigin-Name: 3fe964873da16c0e0b1c4f1945f965d4137df7a307acd6a3eb6585ffbaa2afd1

7 years agoIn LEMON, fix an off-by-one error that can make the lookahead table one
drh [Wed, 27 Dec 2017 15:21:16 +0000 (15:21 +0000)] 
In LEMON, fix an off-by-one error that can make the lookahead table one
byte too smal.

FossilOrigin-Name: 93792bc58a2eccc7e07b14307388350bb376db32c5055b79a44e4fa8ff91d58e

7 years agoChange the lemon-parser coverage report format to report all state/lookahead
drh [Tue, 26 Dec 2017 18:32:06 +0000 (18:32 +0000)] 
Change the lemon-parser coverage report format to report all state/lookahead
pairs and indicate on each whether it is hit or missed.

FossilOrigin-Name: 86e30fc284c740b55f75884b67988fe837b28878f586f6ec8850ecf80164e700

7 years agoMerge bug fixes from trunk.
drh [Tue, 26 Dec 2017 18:14:53 +0000 (18:14 +0000)] 
Merge bug fixes from trunk.

FossilOrigin-Name: d76e12066fa6950f877cbe33b1892e2b0afa948978815d5b9a90cde1fff8ec98

7 years agoAdd support for measuring and reporting coverage of the parser state machine
drh [Tue, 26 Dec 2017 18:04:23 +0000 (18:04 +0000)] 
Add support for measuring and reporting coverage of the parser state machine
using the SQLITE_TESTCTRL_PARSER_COVERAGE test-control.

FossilOrigin-Name: 1253a872dbf48656d4efd588ab61223a5ac550d9b2b932249d6ba585276ba573

7 years agoFaster and smaller implementation of sqlite3AtoF() based on a suggestion
drh [Tue, 26 Dec 2017 14:46:20 +0000 (14:46 +0000)] 
Faster and smaller implementation of sqlite3AtoF() based on a suggestion
from Cezary H. Noweta.

FossilOrigin-Name: fd2e0e7a770c2ce9355068aad1024c3d2861c104fd3be304a91c55ca742155fa

7 years agoFix crashes that could occur if SQL NULL values were passed to the built-in
dan [Tue, 26 Dec 2017 14:32:25 +0000 (14:32 +0000)] 
Fix crashes that could occur if SQL NULL values were passed to the built-in
FTS5 snippet function. Edit: breaks amalgamation builds.

FossilOrigin-Name: 6a790b67a0a5c698526db16ea262b13ecdd1b6ca74e80bdccfcad88ddbdc933a

7 years agoAdd options to speedtest1.c and speed-check.sh for testing performance of
dan [Tue, 26 Dec 2017 14:30:44 +0000 (14:30 +0000)] 
Add options to speedtest1.c and speed-check.sh for testing performance of
floating-point computatations.

FossilOrigin-Name: ebfea8728fec955b1d74b1d0a3de498fd1a32e8b39572a8fdab606ed87b169b4

7 years agoFix an assertion fault on a syntax error input caused by check-in
drh [Mon, 25 Dec 2017 13:43:54 +0000 (13:43 +0000)] 
Fix an assertion fault on a syntax error input caused by check-in
[6b2ff26c25bb9da3].  Problem discovered by OSSFuzz.

FossilOrigin-Name: 90d6e4f10d3055a776d24854c442a2a68e726af8fc382cdb6241a834082e4c4c

7 years agoEnhance LEMON so that it generates the action table in such a way that no
drh [Mon, 25 Dec 2017 04:15:38 +0000 (04:15 +0000)] 
Enhance LEMON so that it generates the action table in such a way that no
range check is needed on the lookahead table to verify that the next input
token is valid.  This makes the lookahead table slightly larger (about 120
bytes) but helps the parser to run faster.

FossilOrigin-Name: 7eb0198d0102e97e4b7ad9e359d95985e55e09c510ea4b360265ac8feb9ed814

7 years agoIn the LEMON-generated parser, avoid unnecessary tests for the acceptance
drh [Mon, 25 Dec 2017 00:10:05 +0000 (00:10 +0000)] 
In the LEMON-generated parser, avoid unnecessary tests for the acceptance
state.

FossilOrigin-Name: fdbb35c54f2b6cb65d04ac295f207ff3e69360e0558348c77eb5e62691807046

7 years agoIn the LEMON-generated parser, rearrange the meanings of integer action codes
drh [Sun, 24 Dec 2017 23:38:10 +0000 (23:38 +0000)] 
In the LEMON-generated parser, rearrange the meanings of integer action codes
so that reduce actions occur last.  This means that the most common case
(reduce actions) can be recognized with a single comparison operation, thus
speeding up the main parser loop, slightly.

FossilOrigin-Name: 7bfe7a360261ac7227840db49487c2f0fe338a2f1b868fcaada1e04a8d2b8f7a

7 years agoFix a NULL pointer dereference after a syntax error that can occur as a
drh [Sun, 24 Dec 2017 18:56:28 +0000 (18:56 +0000)] 
Fix a NULL pointer dereference after a syntax error that can occur as a
result of check-in [6b2ff26c25bb9da3] yesterday.  This problem was
discovered by the OSSFuzz.

FossilOrigin-Name: d49afb8f9804e96662d1e3cadc4c6643908706d848a53d5ed019919c98f2ccba

7 years agoImproved parser tracing output.
drh [Sun, 24 Dec 2017 17:06:41 +0000 (17:06 +0000)] 
Improved parser tracing output.

FossilOrigin-Name: 25be5750545b7b0ed9e1a1baca31611b354519688f875aa1590b21bb6ff42f1b

7 years agoGrammar changes: the sclp non-terminal should always be followed by a scanpt.
drh [Sun, 24 Dec 2017 17:01:54 +0000 (17:01 +0000)] 
Grammar changes:  the sclp non-terminal should always be followed by a scanpt.

FossilOrigin-Name: 74a0181fc016fb0b7934188cfcc2ec26c689f0d33cc42453875f4392b7240d3a

7 years agoImproved parser tracing output.
drh [Sun, 24 Dec 2017 14:14:21 +0000 (14:14 +0000)] 
Improved parser tracing output.

FossilOrigin-Name: c4951833c2b976223c2393d82fd2606068c71cd19612ca9df4e26debab980e32

7 years agoRemove the ExprSpan object. Instead, keep track of the test of subphrases in
drh [Sun, 24 Dec 2017 00:18:47 +0000 (00:18 +0000)] 
Remove the ExprSpan object. Instead, keep track of the test of subphrases in
the parse using the "scanpt" non-terminal.

FossilOrigin-Name: 3eab7bdc44e0878b83dc86f27058a40c2ffafeacadc566f03693f6dc7e40a504

7 years agoSimplification to the error handling logic in the extension loader.
drh [Sat, 23 Dec 2017 14:39:36 +0000 (14:39 +0000)] 
Simplification to the error handling logic in the extension loader.

FossilOrigin-Name: 07c773148d8db185fa54991df09298b64f4fef28879e6c9395759265e8183977

7 years agoImprove the error message that comes back when sqlite3_load_extension()
drh [Sat, 23 Dec 2017 13:55:43 +0000 (13:55 +0000)] 
Improve the error message that comes back when sqlite3_load_extension()
fails because the named file exists but is not a valid shared library.

FossilOrigin-Name: 05fee1a21ea398f1e4d6f1cf361657eff25ed6cd8f85ab398262dcfd30da57e9

7 years agoMove the generation of output column names earlier in the case of a
drh [Sat, 23 Dec 2017 12:33:40 +0000 (12:33 +0000)] 
Move the generation of output column names earlier in the case of a
CREATE TABLE AS.  This is a fix for ticket [3b4450072511e62] and a
continuation of check-in [ade7ddf1998190b2b63] that fixes cases of
ticket [de3403bf5ae5f72ed6] that were missed previously.

FossilOrigin-Name: 6b2ff26c25bb9da344add79c93fb3e49fa034a89b38ef56e08e18d21de61f707

7 years agoAdd a SELECTTRACE() macro to indicate when column names are assigned to
drh [Sat, 23 Dec 2017 11:51:40 +0000 (11:51 +0000)] 
Add a SELECTTRACE() macro to indicate when column names are assigned to
a SELECT statement.  This helps with debugging for tickets like
[de3403bf5ae5f72e] and [3b4450072511e621].

FossilOrigin-Name: 8f194008c3aaa4ef287200e37bc5278ba9c377a7091ee3f95bad66513226b083

7 years agoIn the sqlite3TreeViewExprList() routine, show the "AS" alias name for
drh [Fri, 22 Dec 2017 19:53:02 +0000 (19:53 +0000)] 
In the sqlite3TreeViewExprList() routine, show the "AS" alias name for
each expression in the list, if it exists.

FossilOrigin-Name: 5efd854fe21470336ba4140294b6c90ef39af32e103b92c664438d7485c50f9a

7 years agoModify the new sqlite3_vtab_collation() interface so that it takes a
drh [Fri, 22 Dec 2017 00:52:50 +0000 (00:52 +0000)] 
Modify the new sqlite3_vtab_collation() interface so that it takes a
pointer to the sqlite3_index_info object passed into xBestIndex rather than
an sqlite3 connection pointer, which the xBestIndex method might not have
access to.

FossilOrigin-Name: 5c1fe6666019147a26480b5db1bf2f474a5d072c234c736f16ed5d2a9a040b3f

7 years agoFix SQLITE_DBCONFIG_TRIGGER_EQP so that it works even if SQLITE_DEBUG is
drh [Thu, 21 Dec 2017 21:41:13 +0000 (21:41 +0000)] 
Fix SQLITE_DBCONFIG_TRIGGER_EQP so that it works even if SQLITE_DEBUG is
not defined.

FossilOrigin-Name: afbbfff72002089fa73b5473cc98360df14288d489e93e667332d6e884ef60da

7 years agoAdd the ".eqp trigger" option to the ".eqp" command in the command-line
drh [Thu, 21 Dec 2017 21:02:27 +0000 (21:02 +0000)] 
Add the ".eqp trigger" option to the ".eqp" command in the command-line
shell.  Implemented using the new SQLITE_DBCONFIG_TRIGGER_EQP control.

FossilOrigin-Name: 2c51644a12a638d89e4f7cc3fd561236ce424f2d4e1db31f1e8388f77add02b8

7 years agoAdd the ".expert" command to the shell tool's ".help" output.
dan [Thu, 21 Dec 2017 18:55:24 +0000 (18:55 +0000)] 
Add the ".expert" command to the shell tool's ".help" output.

FossilOrigin-Name: fc6193af5d216b4066fbc47e75a7d0538fd5fda40b94ee15e2ff4037ea89221b

7 years agoChange the name of SQLITE_DBCONFIG_FULL_EQP to be SQLITE_DBCONFIG_TRIGGER_EQP
drh [Thu, 21 Dec 2017 18:23:26 +0000 (18:23 +0000)] 
Change the name of SQLITE_DBCONFIG_FULL_EQP to be SQLITE_DBCONFIG_TRIGGER_EQP
(which we can do without breaking compatibility because the former name has
not yet appeared in an official release) and streamline its implementation.

FossilOrigin-Name: fffc7685d19f78ec322a4e834ad727af20a17e2e1c35680e4b1c4162c4786f60

7 years agoAdd the SQLITE_DBCONFIG_MAX preprocessor macro which will always be equal to
drh [Thu, 21 Dec 2017 14:46:11 +0000 (14:46 +0000)] 
Add the SQLITE_DBCONFIG_MAX preprocessor macro which will always be equal to
the largest SQLITE_DECONFIG value.

FossilOrigin-Name: 95d4103348d14f9d4c3fee30bd1d882f717b047b2b92f8fef52bec4878281907

7 years agoAdd the experimental ".expert" command to the sqlite3.exe shell.
drh [Thu, 21 Dec 2017 02:17:02 +0000 (02:17 +0000)] 
Add the experimental ".expert" command to the sqlite3.exe shell.

FossilOrigin-Name: 0821bae7afefed98102c81104b4a477e81816bb1f43353c80865411771e3c5a7

7 years agoLowercase local variable names in the SHA3 extension in order to avoid
drh [Wed, 20 Dec 2017 23:46:29 +0000 (23:46 +0000)] 
Lowercase local variable names in the SHA3 extension in order to avoid
collisions with macros in termios.h.

FossilOrigin-Name: 3ec7371161bd617e40328aa015b09acc2b37b0b5d269a87050a0c57163f92801

7 years agoFix crash in sqlite3_vtab_collation() when called for an IS NOT NULL
dan [Tue, 19 Dec 2017 18:56:28 +0000 (18:56 +0000)] 
Fix crash in sqlite3_vtab_collation() when called for an IS NOT NULL
constraint.

FossilOrigin-Name: ad38d2c4f073705c02c7b38675e8ae86fe4a794d54eb796e7ed51a905824d5f5

7 years agoExperimentally add the SQLite expert functionality to the shell tool. expert-in-shell
dan [Tue, 19 Dec 2017 17:42:13 +0000 (17:42 +0000)] 
Experimentally add the SQLite expert functionality to the shell tool.

FossilOrigin-Name: 51068dbaeaef13bb80af8126b8c4f3a454dee63de5127d706db50bf789533e60

7 years agoAdd an experimental location(X) SQL function that attempt to return the
drh [Sat, 16 Dec 2017 20:20:37 +0000 (20:20 +0000)] 
Add an experimental location(X) SQL function that attempt to return the
location of the payload within the database for the record that contains
column X.  location(X) returns NULL if X is not an ordinary table column or
if SQLite cannot figure out the location because it is using a covering index.

FossilOrigin-Name: 51be9558164301c5dd4df23ab8b3e67de0b522f8d36f79f3d84d45d3dc2a83a4

7 years agoAdd the sqlite3_vtab_collation() function, which allows an xBestIndex callback
dan [Sat, 16 Dec 2017 19:36:52 +0000 (19:36 +0000)] 
Add the sqlite3_vtab_collation() function, which allows an xBestIndex callback
to determine the collation sequence that SQLite will use for a comparison. And
the SQLITE_DBCONFIG_FULL_EQP configuration option, which enhances the output
of "EXPLAIN QUERY PLAN" so that it includes statements run by triggers. And
the code for the sqlite3_expert extension and command line application.

FossilOrigin-Name: 4c782c950204c09c1d8f857c39c4cf476539ec4e7eee6fd86419d47cf0f8b9e0

7 years agoMerge latest trunk changes into this branch. schemalint
dan [Sat, 16 Dec 2017 19:16:24 +0000 (19:16 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: d5b597b52a1213cdf382d96f4df3535727be0852b25bafd12bbef54da946c5f2

7 years agoAdd unnecessary initializations to some local variables in the rtree module
drh [Sat, 16 Dec 2017 04:37:15 +0000 (04:37 +0000)] 
Add unnecessary initializations to some local variables in the rtree module
to suppress false-positive compiler warnings coming out of MSVC.

FossilOrigin-Name: 64487d658cb3b6c8c67f1e198c70813c963de52599f3ea974bdc2aa432e74de9

7 years agoEnhance the "swarmvtab" extension. See header comments in ext/misc/unionvtab.c
dan [Fri, 15 Dec 2017 20:21:17 +0000 (20:21 +0000)] 
Enhance the "swarmvtab" extension. See header comments in ext/misc/unionvtab.c
for details.

FossilOrigin-Name: 01c173651ab22b7b0c139eded6f2ad8504efd09088df8ae6a3471230ebf2306f

7 years agoIn the LEMON parser generator, provide reduce actions with access to the
drh [Fri, 15 Dec 2017 12:22:21 +0000 (12:22 +0000)] 
In the LEMON parser generator, provide reduce actions with access to the
lookahead token.

FossilOrigin-Name: 42af190f4f86ad60de02800054010fafd484ac86ca41e2a13799b2e583eea98c

7 years agoIn valueFromExpr() only generate a OOM fault if there have been now prior
drh [Wed, 13 Dec 2017 23:47:55 +0000 (23:47 +0000)] 
In valueFromExpr() only generate a OOM fault if there have been now prior
faults.

FossilOrigin-Name: 3765aaf712998af5ffb6bc680a0c1419f2b5deb47ecbc1835ba5879127c4dbe3

7 years agoAdd support for the 'lsm1.c' target in the MSVC makefile.
mistachkin [Wed, 13 Dec 2017 22:42:55 +0000 (22:42 +0000)] 
Add support for the 'lsm1.c' target in the MSVC makefile.

FossilOrigin-Name: 6de21deac469ab25378656f6f58115a92f5892428c6f2f3545c9bafac37e4a41

7 years agoAn improved way of generating the SQLITE_READONLY_DIRECTORY error.
drh [Wed, 13 Dec 2017 20:35:34 +0000 (20:35 +0000)] 
An improved way of generating the SQLITE_READONLY_DIRECTORY error.
The error message submitted to sqlite3_log() is still correct this way.

FossilOrigin-Name: 1c0aa919ee429cd194820ec9c54084563f39e63fd399b23f859fc6703b429b15

7 years agoNew result code SQLITE_READONLY_DIRECTORY is returned when an attempt is
drh [Wed, 13 Dec 2017 20:02:29 +0000 (20:02 +0000)] 
New result code SQLITE_READONLY_DIRECTORY is returned when an attempt is
made to write on a database file that is in a read-only directory and hence
the journal file could not be created.  This situation formerly returned
SQLITE_CANTOPEN, which less helpful.

FossilOrigin-Name: 3ec73c38f878d73d278fce99ba10c708dcc475835774f1e17769ff7315be6d7c

7 years agoCorrectly invalidate a column cache line when it is overwritten with NULL.
drh [Wed, 13 Dec 2017 18:01:52 +0000 (18:01 +0000)] 
Correctly invalidate a column cache line when it is overwritten with NULL.
Fix for ticket [123c9ba32130a6c9d432].

FossilOrigin-Name: 65754dc3b830ef9482655d2e93c2cd4acaa7a8715a58d8309955d04378541f89

7 years agoChange some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob"
dan [Wed, 13 Dec 2017 15:32:33 +0000 (15:32 +0000)] 
Change some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob"
and "LsmPgno". This allows the LSM code to be compiled as a single unit with
sqlite3.c.

FossilOrigin-Name: 30bf38d589adf0b2eb613e184ffb03ed7e625736cb04fd5c341328f72bc5ef4d

7 years agoAdd script to amalgamate all LSM files into "lsm1.c".
dan [Wed, 13 Dec 2017 14:22:48 +0000 (14:22 +0000)] 
Add script to amalgamate all LSM files into "lsm1.c".

FossilOrigin-Name: e32b69d73062e233b0ac853611d10b24546a346a603289ab0e339a3604ae2af4

7 years agoMinor enhancement to two assert() statements in the default VFSes.
drh [Wed, 13 Dec 2017 10:11:09 +0000 (10:11 +0000)] 
Minor enhancement to two assert() statements in the default VFSes.

FossilOrigin-Name: 9cede8a83ca4cd88d504050115e1e89e7b3d3cd3cb2ffb5b8961e311a23ff5e2

7 years agoFix a buffer overwrite in fts5 that could occur when processing a prefix
dan [Mon, 11 Dec 2017 17:20:37 +0000 (17:20 +0000)] 
Fix a buffer overwrite in fts5 that could occur when processing a prefix
query.

FossilOrigin-Name: 92fc146bc2b781e7e2d7138b00e5ea649c6fee1c2b8449420460a1b3e5c9661b

7 years agoFix a harmless API signature mismatch in the unix VFS.
drh [Sat, 9 Dec 2017 01:02:33 +0000 (01:02 +0000)] 
Fix a harmless API signature mismatch in the unix VFS.

FossilOrigin-Name: bab9de7fdda20a724f7c21ec2c25b488ece08b685f1e4fd15c9e73b6b4a0133a

7 years agoThe query planner tries to avoids using indexes that use unknown collating
drh [Fri, 8 Dec 2017 19:37:04 +0000 (19:37 +0000)] 
The query planner tries to avoids using indexes that use unknown collating
functions.

FossilOrigin-Name: 02013fc120bf71a8be3550c696a588af8c92f2209f8e5db530624878ddc8aa7e

7 years agoAdd compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
dan [Fri, 8 Dec 2017 16:23:38 +0000 (16:23 +0000)] 
Add compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
collations without also enabling the tokenizer, the LIKE operator, the
REGEXP operator, or the unicode aware upper()/lower() scalar functions.

FossilOrigin-Name: a079f914522d7bc4b3d27d70114eb09adedfac936a64883e6ed8d382c428dd0e

7 years agoMake sure the bComplex variable in sqlite3DeleteFrom() is initialized when
drh [Fri, 8 Dec 2017 14:07:14 +0000 (14:07 +0000)] 
Make sure the bComplex variable in sqlite3DeleteFrom() is initialized when
compiling with -DSQLITE_OMIT_TRIGGER.

FossilOrigin-Name: e526d0c40b971d970367a52a57d3920cb64e6a98920114bfac46ba009f0b1eb5

7 years agoWhen doing a table scan using an index, do not error out if collating
drh [Thu, 7 Dec 2017 22:10:16 +0000 (22:10 +0000)] 
When doing a table scan using an index, do not error out if collating
functions used by that index are unavailable, since they will not be used.

FossilOrigin-Name: bbd69fa6fa7f3c86fb5cd1b69e1abbe1bbad61aa281e6c073a402d1b202e42ec

7 years agoFix typo in comment. No changes to code.
mistachkin [Thu, 7 Dec 2017 22:04:53 +0000 (22:04 +0000)] 
Fix typo in comment.  No changes to code.

FossilOrigin-Name: 95958b60f9282384cac8f29c519d0fa1c32d7c0366c01ce681f6691e5bbf8438

7 years agoFix harmless compiler warnings in the rot13 extension.
drh [Thu, 7 Dec 2017 16:51:25 +0000 (16:51 +0000)] 
Fix harmless compiler warnings in the rot13 extension.

FossilOrigin-Name: 113470772b04210b9300803124c06af2c0b33278313b311fefe6f80594b24e4a

7 years agoUpdates to the main README.md file.
drh [Thu, 7 Dec 2017 13:15:48 +0000 (13:15 +0000)] 
Updates to the main README.md file.

FossilOrigin-Name: 6bfafc35d1fa0415dcc85edbbd1b273f84b7a6ab75f979b01d90b18ce6aa5703

7 years agoFix an unreachable branch in cases when SQLITE_ENABLE_STAT4 is not defined.
drh [Wed, 6 Dec 2017 20:50:08 +0000 (20:50 +0000)] 
Fix an unreachable branch in cases when SQLITE_ENABLE_STAT4 is not defined.

FossilOrigin-Name: 6a55bd67720451cdf316155cf348103bfce1056a78bcddf0029b45ff0fdbcc71

7 years agoFix a compilation problem when both SQLITE_ENABLE_MULTITHREADED_CHECKS and
dan [Tue, 5 Dec 2017 14:58:59 +0000 (14:58 +0000)] 
Fix a compilation problem when both SQLITE_ENABLE_MULTITHREADED_CHECKS and
SQLITE_ENABLE_API_ARMOUR are defined.

FossilOrigin-Name: 0342ce510d2063a63839399a2cfa25b7fc02f4fde17764082676b332d6136241

7 years agoFix the ".lint fkey-indexes" shell command so that it works with WITHOUT ROWID
dan [Fri, 1 Dec 2017 18:40:18 +0000 (18:40 +0000)] 
Fix the ".lint fkey-indexes" shell command so that it works with WITHOUT ROWID
tables.

FossilOrigin-Name: 5771b1d611b3562ea6c040f3f893073c4d0ee58c35b37ae211520d9aee8ed547

7 years agoFix some minor problems in test scripts.
dan [Thu, 30 Nov 2017 11:21:59 +0000 (11:21 +0000)] 
Fix some minor problems in test scripts.

FossilOrigin-Name: 4c551fdebc7feda3dcfeec719387d879cd5e2cbe213c0c1aac0a965b3f9e882d

7 years agoUpdate test file walprotocol.test to account for the changes in the wal
dan [Thu, 30 Nov 2017 07:55:15 +0000 (07:55 +0000)] 
Update test file walprotocol.test to account for the changes in the wal
locking protocol.

FossilOrigin-Name: 64e567009dd56ef595850fe460925bc15fa875163541527638b654aa2b2cf785

7 years agoMerge latest trunk changes into this branch.
dan [Wed, 29 Nov 2017 16:16:29 +0000 (16:16 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 373fa21bffd37053bb1a741d3ace2f003a5639bf373c20ea7bb24a31080888b3

7 years agoFix an assertion fault found by OSSFuzz.
dan [Tue, 28 Nov 2017 20:43:40 +0000 (20:43 +0000)] 
Fix an assertion fault found by OSSFuzz.

FossilOrigin-Name: 75d699877fa7d06d30285ecf008fbedfdf68cc7965bb328c96f5a931d1f13f04

7 years agoLock the wal file for all snapshot transactions, even if they would not
dan [Tue, 28 Nov 2017 13:39:41 +0000 (13:39 +0000)] 
Lock the wal file for all snapshot transactions, even if they would not
otherwise require this, preventing checkpointers and writers from wrapping the
wal file. This means that if one connection has an open snapshot transaction
it is guaranteed that a second connection can open a transaction on the same
snapshot.

FossilOrigin-Name: b81a31495bd27c1d96f7df653da3502054240cb5acf66b860da7f0f9b422a524

7 years agoAdd experimental feature to detect threading bugs in apps that use
dan [Tue, 28 Nov 2017 07:52:00 +0000 (07:52 +0000)] 
Add experimental feature to detect threading bugs in apps that use
SQLITE_CONFIG_MULTITHREADED. Enabled at compile time using
SQLITE_ENABLE_MULTITHREADED_CHECKS.

FossilOrigin-Name: 40b598c8392f030f6ed8c63ce81cb0426bb3984397c19c756215f6a569a40164

7 years agoUse a symbolic constant instead of a literal (-1) to identify a multithreaded-checks
dan [Tue, 28 Nov 2017 07:47:57 +0000 (07:47 +0000)] 
Use a symbolic constant instead of a literal (-1) to identify a
warn-on-contention mutex.

FossilOrigin-Name: 12a23c0a66fac5c9674120b390f6abaeaba3f7ff04693b281af1eefb93d6f47c

7 years agoUpdate tests to deal with SQLITE_FAST_SECURE_DELETE.
drh [Tue, 28 Nov 2017 00:52:14 +0000 (00:52 +0000)] 
Update tests to deal with SQLITE_FAST_SECURE_DELETE.

FossilOrigin-Name: e6b89304695be371978e65dddd710c8bd563c66b9c94d23165142b6c235c82e1

7 years agoFix a faulty NEVER assert() that could fail for SQLITE_ENABLE_STAT4 builds
dan [Mon, 27 Nov 2017 17:56:14 +0000 (17:56 +0000)] 
Fix a faulty NEVER assert() that could fail for SQLITE_ENABLE_STAT4 builds
that use foreign keys.

FossilOrigin-Name: 465350e55ddaf30cfba7874653301de7238a9dc2bc5e1f800fc95de9360679f6

7 years agoFix an CSV output quoting problem in the command-line shell on Windows.
drh [Sun, 26 Nov 2017 02:14:18 +0000 (02:14 +0000)] 
Fix an CSV output quoting problem in the command-line shell on Windows.

FossilOrigin-Name: 6500cdbd36b0169f37fe363c49182b3e30477a51bb521c2a964555cd086a5589

7 years agoFix builds with both SQLITE_ENABLE_MULTITHREADED_CHECKS and
dan [Sat, 25 Nov 2017 21:09:29 +0000 (21:09 +0000)] 
Fix builds with both SQLITE_ENABLE_MULTITHREADED_CHECKS and
SQLITE_THREADSAFE=0 defined.

FossilOrigin-Name: 7d0b12fcb58353b883ffce77df824a5cc8b1e913a21ec3f22fb73481a398c916

7 years agoAdd experimental feature to detect threading bugs in apps that use
dan [Sat, 25 Nov 2017 17:51:01 +0000 (17:51 +0000)] 
Add experimental feature to detect threading bugs in apps that use
SQLITE_CONFIG_MULTITHREADED. Enabled at compile time using
SQLITE_ENABLE_MULTITHREADED_CHECKS.

FossilOrigin-Name: a66886ac13aa6d8ccbb6d673ddd00267c93e3ee1fbc158236fce3157d150868d

7 years agoAdd the "^" syntax from fts3/4 to fts5.
dan [Fri, 24 Nov 2017 19:24:44 +0000 (19:24 +0000)] 
Add the "^" syntax from fts3/4 to fts5.

FossilOrigin-Name: 24d7058e2799133dd681d2fef341025ca50554861bb4cd39e93ee87ae1d8a605

7 years agoEnhance the configure script to detect zLib.
drh [Fri, 24 Nov 2017 16:55:48 +0000 (16:55 +0000)] 
Enhance the configure script to detect zLib.

FossilOrigin-Name: e3b6e22049caf78bc4153ded8dc295fe30ad320323d921f16bd794ef30f1b115

7 years agoFix a problem in the omit-table-from-left-join optimization
drh [Thu, 23 Nov 2017 04:45:35 +0000 (04:45 +0000)] 
Fix a problem in the omit-table-from-left-join optimization
from check-in [0cd82ee9a8413cf] that was discovered by OSSFuzz.

FossilOrigin-Name: b016c28fa5617a20ad34c005372e738d28f7fc4388d19ee0cb7add4ed19d74aa

7 years agoCompletely disable the skip-ahead-distinct optimization for all but the
drh [Thu, 23 Nov 2017 00:45:21 +0000 (00:45 +0000)] 
Completely disable the skip-ahead-distinct optimization for all but the
inner-most loop of a DISTINCT join.  Fix for ticket [ef9318757b152e3a26e9592]

FossilOrigin-Name: b7595cf2cadcba486e60b3c230ccc412a7cf449c1d56cbe65869e6d5d9f1374d

7 years agoFix the skip-ahead-distinct optimization on joins for cases there the table
drh [Tue, 21 Nov 2017 23:38:48 +0000 (23:38 +0000)] 
Fix the skip-ahead-distinct optimization on joins for cases there the table
in the inner loop of the join does not contribute any columns to the
result set.  Proposed fix for ticket [ef9318757b152e3a2]

FossilOrigin-Name: 2dcef5a9ae7f347da65207bf6bf612fb12e18e1a6704799322f0cf2a86154cfd

7 years agoFix typo in the Makefiles for MSVC.
mistachkin [Tue, 21 Nov 2017 21:15:17 +0000 (21:15 +0000)] 
Fix typo in the Makefiles for MSVC.

FossilOrigin-Name: 17dd2f7314e7eb124e0a2a7a6cf475850e87fe3041e6ce1e1fd71b38d54852a8

7 years agoFix compilation issue (C99-ism) in the shell seen with MSVC.
mistachkin [Tue, 21 Nov 2017 21:14:32 +0000 (21:14 +0000)] 
Fix compilation issue (C99-ism) in the shell seen with MSVC.

FossilOrigin-Name: 9cb47430553f00216e9b06e3d8226b903da536152fac80a5b6f615508c933252

7 years agoUpdate the omit-table-from-left-join optimization so that it can omit tables
dan [Tue, 21 Nov 2017 20:53:14 +0000 (20:53 +0000)] 
Update the omit-table-from-left-join optimization so that it can omit tables
from the middle of the join as well as the end.

FossilOrigin-Name: 0cd82ee9a8413cf127b5ca65770e3f363bd579941cd592298d3b0c27715583f3

7 years agoUpdate the omit-table-from-left-join optimization so that it can omit tables left-join-optimization
dan [Tue, 21 Nov 2017 19:22:45 +0000 (19:22 +0000)] 
Update the omit-table-from-left-join optimization so that it can omit tables
from the middle of the join as well as the end.

FossilOrigin-Name: 618ca9fe53d8d2d7b4f368e6ee404d5fceeecac0d689f32ab62af8a6cbb37401

7 years agoFix a problem preventing the planner from identifying scans that visit at most
dan [Mon, 20 Nov 2017 15:46:10 +0000 (15:46 +0000)] 
Fix a problem preventing the planner from identifying scans that visit at most
one row in cases where that property is guaranteed by a unique, not-null,
non-IPK column that is the leftmost in its table.

FossilOrigin-Name: 7fdb1e2ac2040dc47800a224d33a5c95d55200c480d46fedec1e97fb4f089ef7

7 years agoFix a typo in a test script on this branch. left-join-omit-fix
dan [Mon, 20 Nov 2017 15:45:03 +0000 (15:45 +0000)] 
Fix a typo in a test script on this branch.

FossilOrigin-Name: bff5dcfd2b29ee4834258914410a5dee69ec2727dd254053e3ebaf5090937694

7 years agoFix a problem preventing the planner from identifying scans that visit at most
dan [Mon, 20 Nov 2017 14:40:03 +0000 (14:40 +0000)] 
Fix a problem preventing the planner from identifying scans that visit at most
one row in cases where that property is guaranteed by a unique, not-null,
non-IPK column that is the leftmost in its table.

FossilOrigin-Name: 299d7ca52fec32f04ffd2b8561dd4b839e891792162f8b00259368683436b02d

7 years agoEnhance the log messages produced in some cases if database corruption is
dan [Sat, 18 Nov 2017 18:07:17 +0000 (18:07 +0000)] 
Enhance the log messages produced in some cases if database corruption is
encountered by an SQLITE_DEBUG build.

FossilOrigin-Name: ee840a7669dd462af072625232ea4238198c9b94e1873f361c45f3b0985456f3

7 years agoEnhance the log messages produced in some cases if database corruption is sqlite-corrupt-page
dan [Sat, 18 Nov 2017 17:30:08 +0000 (17:30 +0000)] 
Enhance the log messages produced in some cases if database corruption is
encountered by an SQLITE_DEBUG build.

FossilOrigin-Name: 23a3128083834b5fc80adf45448f7dc65587c52761fb3c9483b80313b369406f

7 years agoImproved fix for ticket [da78413751863] that does not require disabling the
drh [Fri, 17 Nov 2017 21:01:04 +0000 (21:01 +0000)] 
Improved fix for ticket [da78413751863] that does not require disabling the
query flattener as was done in [005d5b870625].  This also makes the code
generator for vector IN operators a little easier to understand.

FossilOrigin-Name: 723f1be3d4a905a6a16333f8ef3e1067dcd4944497b303033c49946fc37c780f

7 years agoAdd some missing "finish_test" lines to the end of test scripts.
dan [Fri, 17 Nov 2017 20:07:19 +0000 (20:07 +0000)] 
Add some missing "finish_test" lines to the end of test scripts.

FossilOrigin-Name: c21406ab3281480d3eddca0cdf5aea3abc224425ee52c10eed3ff702a0ae5c26