]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
7 years agoProposed fix for the use of posix_fallocate() so that it handles EINVAL einval-from-fallocate
drh [Sat, 2 Jun 2018 14:37:39 +0000 (14:37 +0000)] 
Proposed fix for the use of posix_fallocate() so that it handles EINVAL
returns correctly.

FossilOrigin-Name: ab3a5539db82814cafb832cdaebd1e14566139306453ef9cdba6b244a994fe0b

7 years agoFix the CSV extension so that it works with single-column CSV files.
drh [Sat, 2 Jun 2018 12:05:18 +0000 (12:05 +0000)] 
Fix the CSV extension so that it works with single-column CSV files.

FossilOrigin-Name: e336cf00486bdc0ec04ecded2b7c874d73a87e6aba3544e3678bedfb9a4af3b6

7 years agoEnsure that sqlite3AuthRead() is only call for TK_COLUMN and TK_TRIGGER
drh [Sat, 2 Jun 2018 11:31:15 +0000 (11:31 +0000)] 
Ensure that sqlite3AuthRead() is only call for TK_COLUMN and TK_TRIGGER
expression nodes.  This fixes a harmless assert() identified by OSSFuzz.
Move the assert() into a position where it is tested even if the authorizer
is disabled.

FossilOrigin-Name: d0c3beef7cdc680c0768ddd18f766a4ca7be822c1eb1776b2f73b7433d9962dc

7 years agoFix a bug in the SQLITE_ENABLE_SORTER_REFERENCES code causing an out-of-bounds
dan [Fri, 1 Jun 2018 13:30:45 +0000 (13:30 +0000)] 
Fix a bug in the SQLITE_ENABLE_SORTER_REFERENCES code causing an out-of-bounds
array reference.

FossilOrigin-Name: 8cadaf587dc96370f9c8a1dccc366b93021e8cfe4526da9368a088828fd14faf

7 years agoMore documentation typo fixes. No code changes.
drh [Thu, 31 May 2018 19:14:52 +0000 (19:14 +0000)] 
More documentation typo fixes.  No code changes.

FossilOrigin-Name: 66c24513c2f6de98bd888c3e4c07bbb39fabf30ea9dd01eb255460054055347d

7 years agoFix a harmless typo in a comment used to generate documentation.
drh [Thu, 31 May 2018 19:00:20 +0000 (19:00 +0000)] 
Fix a harmless typo in a comment used to generate documentation.

FossilOrigin-Name: 5a2a88cb01ef4b299f9a5b2963f392a3bae90e8a7f84b190e67f86090f891e23

7 years agoAdd the Makefile.fallback makefile to the amalgamation tarball.
drh [Wed, 30 May 2018 14:17:09 +0000 (14:17 +0000)] 
Add the Makefile.fallback makefile to the amalgamation tarball.

FossilOrigin-Name: ce3d04563337c9556d66e55acfb454789b0baa49a1be8fcc349251ce88236d62

7 years agoDo not use the codec on the resetdb.test script.
drh [Wed, 30 May 2018 07:36:55 +0000 (07:36 +0000)] 
Do not use the codec on the resetdb.test script.

FossilOrigin-Name: fe55cea0c80ab29120574c5c4a8473b83fc80f79d7e11bc7c326bfdb32aa3902

7 years agoFix a typo in an error message in the CLI.
drh [Wed, 30 May 2018 07:24:41 +0000 (07:24 +0000)] 
Fix a typo in an error message in the CLI.

FossilOrigin-Name: 808839808141493c1e5122f40b2cdff725be0cd1212e03d609345dbff7af03e4

7 years agoFix the parser so that it builds with -DSQLITE_OMIT_CTE.
drh [Wed, 30 May 2018 01:14:20 +0000 (01:14 +0000)] 
Fix the parser so that it builds with -DSQLITE_OMIT_CTE.

FossilOrigin-Name: 86ee267ee86f5264774a9f215b1158aeaa2d605e77c205731b5ee3945d7de4c2

7 years agoFix a harmless compiler warning.
drh [Wed, 30 May 2018 00:59:09 +0000 (00:59 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 8d02c7a6a09f7520ad180b0d943db475894cd39b0ccdb2ad2c44009d5f25c8a6

7 years agoIncrease the number of database handles opened by test script oserror.test to
dan [Tue, 29 May 2018 19:12:58 +0000 (19:12 +0000)] 
Increase the number of database handles opened by test script oserror.test to
provoke an "out of file-descriptors" error to 20000 (from 2000).

FossilOrigin-Name: 3b00f73456c65dfc1827fdada9afb49245f9addfa684d5ae35e69a07f39164bf

7 years agoFix autoinc.test and resetdb.test so that they work with all permutations.
dan [Tue, 29 May 2018 16:37:12 +0000 (16:37 +0000)] 
Fix autoinc.test and resetdb.test so that they work with all permutations.

FossilOrigin-Name: 89f56d6b0a6847b042a1556cdf79c598c9bfdbdd5f9529d508ca7b4d26a6ed38

7 years agoAdd a comment to justify a goto statement. No code changes.
drh [Tue, 29 May 2018 15:18:31 +0000 (15:18 +0000)] 
Add a comment to justify a goto statement.  No code changes.

FossilOrigin-Name: f141d806476aabe592a15d83b72c9409d2cd6bd7f9cced1ea2513c134191430a

7 years agoMore minor changes to test scripts.
dan [Tue, 29 May 2018 14:29:28 +0000 (14:29 +0000)] 
More minor changes to test scripts.

FossilOrigin-Name: ce9b756f09df4feb485bbf9695f8c6774906eb1b2fb45a340b74ffd21c9adfd8

7 years agoFix some test script issues caused by recent EXPLAIN QUERY PLAN enhancements.
dan [Tue, 29 May 2018 14:06:55 +0000 (14:06 +0000)] 
Fix some test script issues caused by recent EXPLAIN QUERY PLAN enhancements.

FossilOrigin-Name: f808e22831c33bfe3d0dd44e209f64d527c23ca7c72be7c694736535afee1317

7 years agoDo not run test file "resetdb.test" as part of permutation "inmemory_journal".
dan [Tue, 29 May 2018 13:25:14 +0000 (13:25 +0000)] 
Do not run test file "resetdb.test" as part of permutation "inmemory_journal".

FossilOrigin-Name: 4921e5bae4c12c3413cc0b2e58766cf2ac117ad95f92fcd1c2457db6cfabb054

7 years agoDo not require a statement journal in cases where REPLACE conflict handling is
dan [Mon, 28 May 2018 18:29:46 +0000 (18:29 +0000)] 
Do not require a statement journal in cases where REPLACE conflict handling is
used to insert a single row, so long as the REPLACE operation cannot fire any
triggers or foreign key actions.

FossilOrigin-Name: 469a62ca33081854e54f3af6d93ab5a350484b149c8c8c4ee8be0ae5418382d9

7 years agoWhen compiling with SQLITE_DEBUG, add run-time checks to ensure that no statement...
drh [Mon, 28 May 2018 18:25:19 +0000 (18:25 +0000)] 
When compiling with SQLITE_DEBUG, add run-time checks to ensure that no statement aborts unless either there have been no writes or else there is a statement journal.

FossilOrigin-Name: ce99c7724460b9cf4ccaf7f6bc1a522b5c34d5ad0683d465f7926b10f31f7d05

7 years agoFix the build so that it works with -DSQLITE_TEST_REALLOC_STRESS stmt-journal-testing
drh [Mon, 28 May 2018 17:43:28 +0000 (17:43 +0000)] 
Fix the build so that it works with -DSQLITE_TEST_REALLOC_STRESS

FossilOrigin-Name: 90ba2b2e5ce2619e68879eb325b43639159f27eb462b9fb6795534c91200a3d2

7 years agoWhen compiling with SQLITE_DEBUG, add run-time checks to ensure that no
drh [Mon, 28 May 2018 17:31:20 +0000 (17:31 +0000)] 
When compiling with SQLITE_DEBUG, add run-time checks to ensure that no
statement aborts unless either there have been no writes or else there is
a statement journal.

FossilOrigin-Name: 5a4542dbcf17a9f7fed600897555c271e1651fd50eb41d0b126725b486e1d14c

7 years agoStore application-defined function names as lower-case to avoid the need
drh [Sat, 26 May 2018 16:00:26 +0000 (16:00 +0000)] 
Store application-defined function names as lower-case to avoid the need
for case conversions before calling xFindFunction on virtual tables.
Avoid using lookaside to store the destructors for application defined
functions, as lookaside should be reserved for transient allocations.

FossilOrigin-Name: 777189ce88799f93f393fd14fd716111c85bcdcb23690fd561f78ea2bd2ce5da

7 years agoAdd a single sentence of documentation about the virtual table
drh [Sat, 26 May 2018 13:55:04 +0000 (13:55 +0000)] 
Add a single sentence of documentation about the virtual table
scan flags.  No changes to code.

FossilOrigin-Name: 27b4fa5dd0defc6ddaf5d8cde6a1e1162b70d99bfdc69c1d2290621a6d23ed91

7 years agoWhen doing a one-pass UPDATE or DELETE on virtual tables, close the cursor
drh [Thu, 24 May 2018 23:51:57 +0000 (23:51 +0000)] 
When doing a one-pass UPDATE or DELETE on virtual tables, close the cursor
prior to running VUpdate.  This allows one-pass to work on virtual tables
that do not allow concurrent reads and writes.  Enhance rtree to take
advantage of this new capability.

FossilOrigin-Name: b816023ce07d01024d5769e16db924374a49bf909edd12dc1344a0a1ef693db5

7 years agoNew test case for reading and writing the same rtree concurrently.
drh [Thu, 24 May 2018 22:42:27 +0000 (22:42 +0000)] 
New test case for reading and writing the same rtree concurrently.

FossilOrigin-Name: 3ba08e53d54165f5541756ad13a4c2f0b18516cb612a256e056ed1ff76c1fa83

7 years agoDo not allow RTree writes when a read cursor is active on the same virtual
drh [Thu, 24 May 2018 22:31:01 +0000 (22:31 +0000)] 
Do not allow RTree writes when a read cursor is active on the same virtual
table, as the writes might rebalance and disrupt the read cursors.  Return
the new SQLITE_LOCKED_VTAB error code if this happens.

FossilOrigin-Name: d4ce66610851c825cb712f985216b63e015c753fdd5521f929c67ad18bfd7664

7 years agoIn the OOM testing logic, add the sqlite3FirstFault() routine as a place to
drh [Thu, 24 May 2018 17:38:00 +0000 (17:38 +0000)] 
In the OOM testing logic, add the sqlite3FirstFault() routine as a place to
set a breakpoint the first time any simulated OOM fault occurs for a single
test case.

FossilOrigin-Name: b4d80bd287ca7f3a6d182ba2435273266035b94fdf6a44047a64a4eff931c571

7 years agoFix a typo in a comment used to generate VDBE opcode documentation. No
drh [Thu, 24 May 2018 17:25:35 +0000 (17:25 +0000)] 
Fix a typo in a comment used to generate VDBE opcode documentation.  No
code changes.

FossilOrigin-Name: 36cdfbf2ce1811691c790fde3eaeed0238c03b4dc97dc3a20d1e0397520145d1

7 years agoAddition cases for rtree preformance testing in speedtest1.c. Add the
drh [Thu, 24 May 2018 16:18:35 +0000 (16:18 +0000)] 
Addition cases for rtree preformance testing in speedtest1.c.  Add the
--nodiff option to the speed-check.sh script.

FossilOrigin-Name: 95f2d62cf3cf8dbe0f12b652b47fe1f8e0f52bc269e269955fafdf802afc47c1

7 years agoUpdates to the sqlite3_vtab_nochange() documentation. No changes to code.
drh [Thu, 24 May 2018 13:59:45 +0000 (13:59 +0000)] 
Updates to the sqlite3_vtab_nochange() documentation.  No changes to code.

FossilOrigin-Name: 5bd99abc10b8153aadff5f815ae15fbe375f34f043c65def4be03014d2efdb50

7 years agoRemove a branch that is no longer used due to the fix to the
drh [Wed, 23 May 2018 17:53:07 +0000 (17:53 +0000)] 
Remove a branch that is no longer used due to the fix to the
sqlite_sequence schema problem, ticket
[d8dc2b3a58cd5dc2918a1d4acbba4676a23ada4c]

FossilOrigin-Name: 066742692a9e8735b814c6a145545f97a7fb10b29cead78e68e25324e79aabaa

7 years agoVerify that the sqlite_sequence table exists and is in approximately the
drh [Wed, 23 May 2018 16:50:21 +0000 (16:50 +0000)] 
Verify that the sqlite_sequence table exists and is in approximately the
correct format prior to using it to process an autoincrement table.
Fix for ticket [d8dc2b3a58cd5dc2918a1d4a].

FossilOrigin-Name: e199e859ace4f8381c6380175206e7a276e3f2228fadbbca9341bca8d2fc445d

7 years agoAdd support for auxiliary columns to the rtree extension.
drh [Fri, 18 May 2018 17:58:33 +0000 (17:58 +0000)] 
Add support for auxiliary columns to the rtree extension.

FossilOrigin-Name: c6071ac99cfa4b6272ac4d739fc61a85acb544f6c1c2ae67b31e92aadcc995bd

7 years agoMerge enhancements from trunk, especially the CLI fixes. aux-data-in-rtree
drh [Fri, 18 May 2018 17:17:36 +0000 (17:17 +0000)] 
Merge enhancements from trunk, especially the CLI fixes.

FossilOrigin-Name: a350040a3bb962823f92908fb31cade52baf13eab90ef608ca3a8349e4c28c9d

7 years agoIn the CLI, detect and report errors on sqlite3_close(). Clear global
drh [Fri, 18 May 2018 17:11:50 +0000 (17:11 +0000)] 
In the CLI, detect and report errors on sqlite3_close().  Clear global
variables prior to exit to so that valgrind can better detect resource
leaks.

FossilOrigin-Name: e3b2e0a078b82ac6cd3c3312e8ac0983c1375e1052f1e324476d2f8d1b227c30

7 years agoAvoid unnecessary sqlite3_finalize() operations.
drh [Fri, 18 May 2018 16:53:07 +0000 (16:53 +0000)] 
Avoid unnecessary sqlite3_finalize() operations.

FossilOrigin-Name: 16f71032a3a2919cb226b25b5256a370adb5c55fa506d4774b7f83dc8868e793

7 years agoFix a prepare-statement leak.
drh [Fri, 18 May 2018 16:46:09 +0000 (16:46 +0000)] 
Fix a prepare-statement leak.

FossilOrigin-Name: 95fd296ffc8130526a1453cbdca6ce47f22fc5b5c474aa31d66b627d0c7393a1

7 years agoImproved error messages. Limit the number of auxiliary columns to 100.
drh [Fri, 18 May 2018 15:21:43 +0000 (15:21 +0000)] 
Improved error messages.  Limit the number of auxiliary columns to 100.

FossilOrigin-Name: 059d20abd57727e6d312f15b640359ef778786f577d9b50b17b57195db2d0aef

7 years agoImprovements to integer/float comparisons on architectures that lack a
drh [Fri, 18 May 2018 14:24:23 +0000 (14:24 +0000)] 
Improvements to integer/float comparisons on architectures that lack a
"long double" type.

FossilOrigin-Name: 5139ea62a8a6c6dc6558c337de39bcbadd26f6515742263387be03c862c78cf0

7 years agoRemove incorrect NEVER() macro added by the previous check-in. int-float-compare
drh [Fri, 18 May 2018 14:19:35 +0000 (14:19 +0000)] 
Remove incorrect NEVER() macro added by the previous check-in.

FossilOrigin-Name: 3d6625111319c0356c57aaf7b7460fd882c3f00ca668dc43c0abe3403c7c2ba3

7 years agoImprovements to the sqlite3IntFloatCompare() routine for systems that
drh [Fri, 18 May 2018 13:39:00 +0000 (13:39 +0000)] 
Improvements to the sqlite3IntFloatCompare() routine for systems that
lack the long double type.

FossilOrigin-Name: ea6a03a89dc23e860e53e79ec3fddf0ae7072a23b73aef3d2d181b426566b677

7 years agoIn the CLI with the -A command, if the file does not previously exist and
drh [Thu, 17 May 2018 20:04:24 +0000 (20:04 +0000)] 
In the CLI with the -A command, if the file does not previously exist and
its name looks like a ZIP archive name, then create it as a ZIP archive.

FossilOrigin-Name: 33dc8fad7f2b467f259eb78eb7342a760f01d54d95da7fe4cace10e558788a58

7 years agoImproved error and help messages for the ".archive" command and "-A" option
drh [Thu, 17 May 2018 14:09:06 +0000 (14:09 +0000)] 
Improved error and help messages for the ".archive" command and "-A" option
to the CLI. If a memory leak in --list processing.

FossilOrigin-Name: 02541ac6f919a8a8b18ef0525c4ee24fdbc5c1883171fb1a492434cd0f006f7c

7 years agoFix memory errors associated with argv in the CLI when it is
drh [Thu, 17 May 2018 13:29:14 +0000 (13:29 +0000)] 
Fix memory errors associated with argv in the CLI when it is
compiled on Windows.

FossilOrigin-Name: 4474d69b5c21b4e6f0d1376fbceca0f18c715ff673aea63053a02bfbe041d03b

7 years agoFix an issue with rtreecheck() and auxiliary data columns.
drh [Wed, 16 May 2018 19:56:20 +0000 (19:56 +0000)] 
Fix an issue with rtreecheck() and auxiliary data columns.

FossilOrigin-Name: 46715136078a51ca7dd08b83214d6ad0e85728af8a26cd342077b8dd4ada1d60

7 years agoDo not allow auxiliary columns in the rtree to interfere with query planning.
drh [Wed, 16 May 2018 19:07:07 +0000 (19:07 +0000)] 
Do not allow auxiliary columns in the rtree to interfere with query planning.
Begin adding test cases.

FossilOrigin-Name: 9abe023e1afa7dc1a7eba7fbb3128401de129873d86b7c71c221decca26a821c

7 years agoFix the OOM issue mentioned in the previous check-in.
drh [Wed, 16 May 2018 18:18:24 +0000 (18:18 +0000)] 
Fix the OOM issue mentioned in the previous check-in.

FossilOrigin-Name: c489d8e44eac4cd355096ab66bb40f13ef662f31e080c9f1f2ee379fe55b207a

7 years agoInitial implementation of the ability to have auxiliary columns in an rtree
drh [Wed, 16 May 2018 17:57:30 +0000 (17:57 +0000)] 
Initial implementation of the ability to have auxiliary columns in an rtree
virtual table that store arbitrary content.  It mostly works, but there are
some minor issues in OOM corner cases.

FossilOrigin-Name: 0c87fec970221f954e0a92f3ef0437b382255479fac5b403ee37b1bb5ab29719

7 years agoEnhance the sqlite3_str_new() interface so that it always returns a valid
drh [Wed, 16 May 2018 15:35:03 +0000 (15:35 +0000)] 
Enhance the sqlite3_str_new() interface so that it always returns a valid
and non-NULL pointer even in an OOM condition.

FossilOrigin-Name: ed5b09680fd6659ebbe5ace3c1c56f3962bbd75cfdf65c7565651900cf87917a

7 years agoCorrect output for the fullkey column of json_each() when the total JSON
drh [Wed, 16 May 2018 12:19:11 +0000 (12:19 +0000)] 
Correct output for the fullkey column of json_each() when the total JSON
input is a simple value, not an array or object.

FossilOrigin-Name: b45b18850c59f22a163ee482f529f578a8798f96d0e26b5a061d336d480a1540

7 years agoFix a test case problem in wherelimit.test.
dan [Tue, 15 May 2018 09:09:00 +0000 (09:09 +0000)] 
Fix a test case problem in wherelimit.test.

FossilOrigin-Name: 3012df8b2c0b19d27260f389147a96c501aee9a4aee3813834cc9e438dbacede

7 years agoMake more aggressive use of automatic indexes when processing materalized
drh [Mon, 14 May 2018 22:46:11 +0000 (22:46 +0000)] 
Make more aggressive use of automatic indexes when processing materalized
views and subqueries.

FossilOrigin-Name: 172f5bd27e47cbdaaab54fe4383a5ee505d285257af6153ed626d9493a4adab3

7 years agoConvert the schema creation logic in the rtree extension to use the
drh [Mon, 14 May 2018 15:26:05 +0000 (15:26 +0000)] 
Convert the schema creation logic in the rtree extension to use the
new sqlite3_str interface.

FossilOrigin-Name: fd8b8c4196d3f0f6cb129f43ebf473ada86eefdf16181fa70ceee21e1232b5e1

7 years agoFix typo in the shell.c source file.
mistachkin [Mon, 14 May 2018 12:23:04 +0000 (12:23 +0000)] 
Fix typo in the shell.c source file.

FossilOrigin-Name: 389dc0a901b0ce54c3c773d63e5b288f6dd28b96dffc4b77861db89b275b57d6

7 years agoExport the deduceDatabaseType() function the shell.c source file.
drh [Mon, 14 May 2018 00:41:12 +0000 (00:41 +0000)] 
Export the deduceDatabaseType() function the shell.c source file.

FossilOrigin-Name: d0f35739af3b226c8eef39676407293650cde551acef06fe8628fdd5b59bd66a

7 years agoAdd the --append option to the ".backup" command in the CLI.
drh [Mon, 14 May 2018 00:23:08 +0000 (00:23 +0000)] 
Add the --append option to the ".backup" command in the CLI.

FossilOrigin-Name: 0dfdbdee527b0c429703bc2696bf8d8e44a852aafe0aca742b9d7152eb1f932e

7 years agoIn the CLI, allow comment lines that begin with '#', but only in a context
drh [Sat, 12 May 2018 23:56:22 +0000 (23:56 +0000)] 
In the CLI, allow comment lines that begin with '#', but only in a context
where a dot-command is allowed.  In other words, '#' at the beginning of a
line in the middle of an SQL statement is just part of the SQL.

FossilOrigin-Name: 4ee136d6d2e029dad8371faf659d3a0bc0ac6ae76940db81d333848545bc990f

7 years agoIn the CLI, return non-zero if there are errors on the command-line.
drh [Fri, 11 May 2018 19:11:18 +0000 (19:11 +0000)] 
In the CLI, return non-zero if there are errors on the command-line.

FossilOrigin-Name: 13e7300a37e379eac564594d78d3f039fd25737493b3b627ef02fab57a6c98e1

7 years agoFix a typo in the help message from the ".sha3sum" command in the CLI.
drh [Fri, 11 May 2018 15:10:43 +0000 (15:10 +0000)] 
Fix a typo in the help message from the ".sha3sum" command in the CLI.

FossilOrigin-Name: dba87a201806f93a1736c1ee81d9c9cf9848e401a237dc2af3b4376402976c32

7 years agoMake sure the open_db() routine in the CLI does not invoke access() with
drh [Fri, 11 May 2018 15:10:11 +0000 (15:10 +0000)] 
Make sure the open_db() routine in the CLI does not invoke access() with
a NULL filename.

FossilOrigin-Name: 20a8c61122f37a43c418ca4415b3d26e0f7a27a6faea9048aa9fbb1a56e9d629

7 years agoAdd a test case to check that the fts5 unicode64 tokenizer is dealing with
dan [Wed, 9 May 2018 16:32:00 +0000 (16:32 +0000)] 
Add a test case to check that the fts5 unicode64 tokenizer is dealing with
codepoints greater than 65535 correctly.

FossilOrigin-Name: 9f7a6ae878cd17ff4de7c55e654406773e0ea2b9fe1c4e2a9fc2b0da84d059a4

7 years agoAdd 14 new interfaces to the loadable extension mechanism.
drh [Wed, 9 May 2018 15:17:02 +0000 (15:17 +0000)] 
Add 14 new interfaces to the loadable extension mechanism.

FossilOrigin-Name: 0e809cdcbd1bb1e269298814d6bb1dcdaea48c5b0bb20e0e1caa4dba27654873

7 years agoFix minor problems with the sqlite3_str interface.
drh [Wed, 9 May 2018 14:29:40 +0000 (14:29 +0000)] 
Fix minor problems with the sqlite3_str interface.

FossilOrigin-Name: 43ea8a6836ccb9910314d35e07d881694200c97ef5969629f62e49f7a2a42f92

7 years agoMake the internal dynamic string interface available to extensions using
drh [Wed, 9 May 2018 13:46:26 +0000 (13:46 +0000)] 
Make the internal dynamic string interface available to extensions using
the new sqlite3_str object and its associated methods.  This is mostly just
a renaming of internal objects and methods to use external names, through
there are a few small wrapper functions.

FossilOrigin-Name: 87f261f0cb800b06ad786f6df16f2c4dddd0d93dfdcc77b4a4eaa22920b56bf1

7 years agoFix a typo in a comment used for documentation. No code changes.
drh [Wed, 9 May 2018 10:11:44 +0000 (10:11 +0000)] 
Fix a typo in a comment used for documentation.  No code changes.

FossilOrigin-Name: b866693e6a50b5c41ca54b56bb20753efb94980ad3365c511cccf23ac43a1c23

7 years agoCorrectly format the STAT1 and STAT4 content in the output from the
drh [Tue, 8 May 2018 23:17:36 +0000 (23:17 +0000)] 
Correctly format the STAT1 and STAT4 content in the output from the
".fullschema" command in the CLI.  Fix for ticket
[e63a34a0045832dc850367552].

FossilOrigin-Name: 0c3f128fd7d5738a8e9da706f5f30aa1985ef5efab70ddaad28ef6b641b04f4a

7 years agoFix a harmless compiler warning in fuzzcheck. Add new OSSFuzz test cases
drh [Tue, 8 May 2018 13:03:31 +0000 (13:03 +0000)] 
Fix a harmless compiler warning in fuzzcheck.  Add new OSSFuzz test cases
to the test case library.

FossilOrigin-Name: d2619746cb233f4be127a77988548dd1d90eebddf0d0ac9107913b240553e5d0

7 years agoFuzz test cases for UPSERT.
drh [Tue, 8 May 2018 12:49:53 +0000 (12:49 +0000)] 
Fuzz test cases for UPSERT.

FossilOrigin-Name: fd11fbd21893d520de5a2249f825ecb5839fa4943f5c207e9e9bf8b52f4e2695

7 years agoActivate the cell-overwrite optimization for index b-trees.
drh [Mon, 7 May 2018 18:41:19 +0000 (18:41 +0000)] 
Activate the cell-overwrite optimization for index b-trees.

FossilOrigin-Name: a68697d10ef17d452c8279181186faad7bc54e3a35858a336552f717449065ea

7 years agoImproved comments on the cell-overwrite optimization code.
drh [Mon, 7 May 2018 17:27:04 +0000 (17:27 +0000)] 
Improved comments on the cell-overwrite optimization code.

FossilOrigin-Name: a4fe966da2fc479b18bf521ff596000410af3a611f7d8723d126795e595ccf22

7 years agoOn an UPDATE, try to overwrite an existing btree cell with the modified
drh [Mon, 7 May 2018 11:48:22 +0000 (11:48 +0000)] 
On an UPDATE, try to overwrite an existing btree cell with the modified
content, if the old and new cell are the same size.  Use memcmp() first
to avoid dirtying pages that are unchanged.

FossilOrigin-Name: 5887d8beb502ad62689d31b850f46ab50831a1e9db36adf20d55ad45619d207e

7 years agoFix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic.
drh [Mon, 7 May 2018 11:37:34 +0000 (11:37 +0000)] 
Fix harmless compiler warnings associated with the new EXPLAIN QUERY PLAN logic.

FossilOrigin-Name: 374d8e264487b0437a8d995ced1bc026a92d495a2d0568f65f033e9ebe11d0e2

7 years agoFix harmless compiler warnings in the cell-overwrite logic. cell-overwrite-prototype
drh [Mon, 7 May 2018 11:29:59 +0000 (11:29 +0000)] 
Fix harmless compiler warnings in the cell-overwrite logic.

FossilOrigin-Name: 3e11dc3183bc3e8ec49af244a8e8b3e07d12f7a2e59028b2bf64ce0ab589a91f

7 years agoBackout change [05fee1a21ea398f1e4d6f1cf3] because it does not take into
drh [Mon, 7 May 2018 02:50:38 +0000 (02:50 +0000)] 
Backout change [05fee1a21ea398f1e4d6f1cf3] because it does not take into
account the LD_LIBRARY_PATH environment variable used by dl_open().

FossilOrigin-Name: b348d1193a7a3ed4d3e656b6cc95a41f87eae29222e0723850a5eb5ffabffd00

7 years agoIn an ORDER BY LIMIT, make sure the ORDER BY expression evaluator does not
drh [Sat, 5 May 2018 16:50:35 +0000 (16:50 +0000)] 
In an ORDER BY LIMIT, make sure the ORDER BY expression evaluator does not
try to reuse values from the result set if the result set has not yet
be computed.  This fixes a bug in the recent deferred-row loading
optimization, check-in [c381f0ea57002a264fd958b28e].
OSSFuzz discovered the problem.

FossilOrigin-Name: 5d61e75f32de09c81dbe844443209f063cccb005d60b846900de5b023643fc3b

7 years agoFix a slightly incorrect corruption detection branch in the btree logic.
drh [Sat, 5 May 2018 01:23:28 +0000 (01:23 +0000)] 
Fix a slightly incorrect corruption detection branch in the btree logic.

FossilOrigin-Name: 9191ff670cb7f36e0b2dac4a22888679b639845687aef8edcc3c05e35ba71eda

7 years agoMerge enhancements from trunk.
drh [Fri, 4 May 2018 19:18:27 +0000 (19:18 +0000)] 
Merge enhancements from trunk.

FossilOrigin-Name: 9650f71b82ca1b3759e776bbd8a2e8ca61c51f80038e37c9c9a675a8c13b0b06

7 years agoFix requirements marks. No code changes.
drh [Fri, 4 May 2018 18:32:11 +0000 (18:32 +0000)] 
Fix requirements marks.  No code changes.

FossilOrigin-Name: 7fdad122a21e4b01bd678198fd5131dc32febe3af366bd6368505398255f9822

7 years agoFor the amalgamation-tarball, enable FTS5 and JSON1 by default and
drh [Fri, 4 May 2018 04:49:55 +0000 (04:49 +0000)] 
For the amalgamation-tarball, enable FTS5 and JSON1 by default and
provide a new --enable-debug option that actives debugging facilities.

FossilOrigin-Name: 03edecaf9dcfc927aa60c2a17590a432b17de1647d480d277b4aafc8018c2d20

7 years agoMake a separate limb in the EXPLAIN QUERY PLAN output for the various lines
drh [Fri, 4 May 2018 00:39:43 +0000 (00:39 +0000)] 
Make a separate limb in the EXPLAIN QUERY PLAN output for the various lines
associated with the OR-optimization.

FossilOrigin-Name: 75ac7b4e4fd0811ca80c719badacff207e0bbd00ac64dde3b3d4ec676fad472d

7 years agoIn ORDER BY LIMIT queries, try to evaluate the ORDER BY terms first, and it
drh [Thu, 3 May 2018 23:20:06 +0000 (23:20 +0000)] 
In ORDER BY LIMIT queries, try to evaluate the ORDER BY terms first, and it
it becomes clear that the row will not come in under the LIMIT, then skip
evaluation of the other columns.

FossilOrigin-Name: c381f0ea57002a264fd958b28e4921cb9c9e73a10fb592f6bb64e6bc9bd16d39

7 years agoFix a branch that has become unreachable due to recent enhancements.
drh [Thu, 3 May 2018 22:52:56 +0000 (22:52 +0000)] 
Fix a branch that has become unreachable due to recent enhancements.

FossilOrigin-Name: 81ab5e0d106fb9f2de80d17c8167d8542c6721b8d7ec69c43e1571c2dcadeddd

7 years agoImproved security for VACUUM. This check-in combines the fixes
drh [Thu, 3 May 2018 21:51:30 +0000 (21:51 +0000)] 
Improved security for VACUUM.  This check-in combines the fixes
of [ab0d99d0b5ede] and [27754b74ddf646] in a way that is less likely to
to be broken by future changes.

FossilOrigin-Name: 260fc696538b195e8decabaab46771f664fb829b539efa86fb0b8170db01fa0a

7 years agoOverhaul of EXPLAIN QUERY PLAN. The output is now in the form of a tree.
drh [Thu, 3 May 2018 19:56:50 +0000 (19:56 +0000)] 
Overhaul of EXPLAIN QUERY PLAN. The output is now in the form of a tree.
More details of the query plan are shown, and what is shown is truer to what
actually happens.

FossilOrigin-Name: ff01bbdabc4b9db3db8b928979442c91b32d72082158e4f5fe62ae51a73649d2

7 years agoOptimizations to the new EQP framework. rework-EQP
drh [Thu, 3 May 2018 19:47:14 +0000 (19:47 +0000)] 
Optimizations to the new EQP framework.

FossilOrigin-Name: 956fef361a795bd081d8e23ce4075dc8aafcee63ab7275d13b657b529d185b30

7 years agoFix various error handling conditions on the cell overwrite optimization.
drh [Thu, 3 May 2018 16:56:06 +0000 (16:56 +0000)] 
Fix various error handling conditions on the cell overwrite optimization.
Fix a test case so that it works with the new optimization.

FossilOrigin-Name: f89b54f41405ed7e28132f66b8a0c690a087c2412c8f55790c2beabb0b521645

7 years agoThe BtCursor.info fields are only valid if info.nSize!=0.
drh [Thu, 3 May 2018 14:07:18 +0000 (14:07 +0000)] 
The BtCursor.info fields are only valid if info.nSize!=0.

FossilOrigin-Name: 54c537eead5b08104cfaf0d5b1e2706e53d6f74be2ca02e06229024fd889fc94

7 years agoAdd more corruption checking to the cell overwrite logic.
drh [Thu, 3 May 2018 13:56:23 +0000 (13:56 +0000)] 
Add more corruption checking to the cell overwrite logic.

FossilOrigin-Name: 58d14afe1e1288d114ea213458b3121e0a95670887861928858b7f143c76f789

7 years agoBug fixes in the overwrite optimization.
drh [Thu, 3 May 2018 12:57:48 +0000 (12:57 +0000)] 
Bug fixes in the overwrite optimization.

FossilOrigin-Name: 0cb6cd2a6a596afaa1cca6c5f5abc2ea75d04f254c7debaf36ecd6a90b66aed6

7 years agoThe sqlite3BtreeInsert() routine tries to overwrite an existing cell with
drh [Thu, 3 May 2018 03:59:02 +0000 (03:59 +0000)] 
The sqlite3BtreeInsert() routine tries to overwrite an existing cell with
modified content if the new content is the same size.  Pages are only dirtied
if they change.  This prototype works some, but still has issues.

FossilOrigin-Name: 489451b378819621537231c1c8a07704437e11c1f5384fd53b09f3977d2213a4

7 years agoEnhance EXPLAIN QUERY PLAN to report the generation of constant rows using
drh [Thu, 3 May 2018 01:37:13 +0000 (01:37 +0000)] 
Enhance EXPLAIN QUERY PLAN to report the generation of constant rows using
VALUES or just a SELECT without FROM.

FossilOrigin-Name: c75eee69fa8a9b56ee58a4cc539e80cc982f43390dc3a357344d58479dd89a41

7 years agoMore test case updates. Tests are all running now.
drh [Wed, 2 May 2018 19:42:33 +0000 (19:42 +0000)] 
More test case updates.  Tests are all running now.

FossilOrigin-Name: dab5e5294813891469660cceb211ac1a1e526715bb57dcdbb1ab90321e6a4dad

7 years agoFix test cases so that they work with the new EXPLAIN QUERY PLAN output
drh [Wed, 2 May 2018 18:00:17 +0000 (18:00 +0000)] 
Fix test cases so that they work with the new EXPLAIN QUERY PLAN output
format.  Only some of the cases have been fixed.  This is an incremental
check-in.

FossilOrigin-Name: 5f0e803e33aa557865d5fc830d9202d628de9a94c9757058ca48f1a560702cd3

7 years agoImproved EQP output for recursive CTEs and multi-value VALUES clauses.
drh [Wed, 2 May 2018 16:13:48 +0000 (16:13 +0000)] 
Improved EQP output for recursive CTEs and multi-value VALUES clauses.

FossilOrigin-Name: f2f525548c65f89f55cbe91da8a21512dedc6f7b68b58b7906d653e800a2963a

7 years agoPrevent VACUUM from running any commands in sqlite_master.sql other than
drh [Wed, 2 May 2018 15:00:26 +0000 (15:00 +0000)] 
Prevent VACUUM from running any commands in sqlite_master.sql other than
CREATE statements.  That is all that should be there anyhow.  This fixes
a problem discovered by OSSFuzz.  Test cases in TH3.

FossilOrigin-Name: ab0d99d0b5edece4c639baa47ce1ca2c02774cb2515e5b7f36d9bd312ccd3310

7 years agoFix a dangling-else problem that was causing recursive CTEs to malfunction.
drh [Wed, 2 May 2018 14:24:34 +0000 (14:24 +0000)] 
Fix a dangling-else problem that was causing recursive CTEs to malfunction.
Begin fixing test cases to work with the new EQP output.

FossilOrigin-Name: 82ca44b82fed6814c84440ba8bfaa019488ab956e84ac165180e2fcece6facb2

7 years agoFix a problem in the xBestIndex method of the closure extension causing it to
dan [Wed, 2 May 2018 08:12:22 +0000 (08:12 +0000)] 
Fix a problem in the xBestIndex method of the closure extension causing it to
allocate non-contiguous argvIndex values in some cases (an "xBestIndex
malfunction" error).

FossilOrigin-Name: 0c67150749cb3d067e14b2dcac9c3489e0f14bd18c0387f1d9bc93d21fc96fe5

7 years agoAdd sqlite3_win32_set_directory8() and sqlite3_win32_set_directory16() functions.
mistachkin [Wed, 2 May 2018 03:01:50 +0000 (03:01 +0000)] 
Add sqlite3_win32_set_directory8() and sqlite3_win32_set_directory16() functions.

FossilOrigin-Name: 22089ea2bbea93eb1da7f08344789a5455077169443e40025f053d2a117f1c08

7 years agoImprovements to the EQP display for compound select statements.
drh [Wed, 2 May 2018 02:22:22 +0000 (02:22 +0000)] 
Improvements to the EQP display for compound select statements.

FossilOrigin-Name: 699a77e479010a331b0423f157a2fbfc373688e3d0d04ae5e64376c00cb3d488

7 years agoBegin reengineering the EXPLAIN QUERY PLAN function to provide more
drh [Wed, 2 May 2018 00:33:43 +0000 (00:33 +0000)] 
Begin reengineering the EXPLAIN QUERY PLAN function to provide more
intuitive output.

FossilOrigin-Name: 70b48a7972dfbb44af3ccd8ccd830e984bec88d80a78b3566a5de86a16e7fc14