]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
6 years agoExperimental changes to (optionally) allow double-quoted strings to be checked agains... normalize_v4
mistachkin [Thu, 6 Dec 2018 20:18:43 +0000 (20:18 +0000)] 
Experimental changes to (optionally) allow double-quoted strings to be checked against known identifiers.

FossilOrigin-Name: 73a6b8c1b9c282b9d28c2ce131fc2f3545aaef8b9357a4ae17b46059e473c2d6

6 years agoWhen masking bits off of sqlite3.flags, make sure the mask is 64 bits
drh [Thu, 6 Dec 2018 17:06:02 +0000 (17:06 +0000)] 
When masking bits off of sqlite3.flags, make sure the mask is 64 bits
in size so as not to accidentally mask of high-order bits.

FossilOrigin-Name: 53d3b169d8e1892163526caff2c843302c92e280fdeff6831e23a9bb15b82be3

6 years agoWhen saving off the value of sqlite3.flags, take care to preserve all 64
drh [Thu, 6 Dec 2018 16:50:55 +0000 (16:50 +0000)] 
When saving off the value of sqlite3.flags, take care to preserve all 64
bits.

FossilOrigin-Name: 9c6dbcfab5952cf4e54de30cf9cee48f988b91a35dc3f04d64d6d994dd84a076

6 years agoIssue a warning whenever a double-quoted string literal is used.
drh [Thu, 6 Dec 2018 16:11:14 +0000 (16:11 +0000)] 
Issue a warning whenever a double-quoted string literal is used.

FossilOrigin-Name: ac9ad5043026b30394812457e1535df2759aea0d4510029561e92e386672796f

6 years agoInvoking the sqlite3_trace() or sqlite3_trace_v2() interfaces cancels
drh [Thu, 6 Dec 2018 03:59:25 +0000 (03:59 +0000)] 
Invoking the sqlite3_trace() or sqlite3_trace_v2() interfaces cancels
any sqlite3_profile() that is running.

FossilOrigin-Name: ec63d3506bd429560077f82a4c5ed9d189780789fe1c134fff4f3b8733be1a3f

6 years agoRemove the unused pColHash field from the Table object.
drh [Thu, 6 Dec 2018 02:01:17 +0000 (02:01 +0000)] 
Remove the unused pColHash field from the Table object.

FossilOrigin-Name: 3a2c047989facc3461c63a2f9eed412014c951035a80da47c52a70139fb552de

6 years agoFix a potential NULL pointer dereference that can occur in ALTER TABLE
drh [Thu, 6 Dec 2018 01:53:12 +0000 (01:53 +0000)] 
Fix a potential NULL pointer dereference that can occur in ALTER TABLE
following an OOM.  Test case in TH3.

FossilOrigin-Name: ea50815bf80ab0d36891518f209acbcd3d6d8d84529741bffd4e841874c78aff

6 years agoFix a missing mutex in the sqlite3_normalized_sql() interface when it is
drh [Thu, 6 Dec 2018 01:08:58 +0000 (01:08 +0000)] 
Fix a missing mutex in the sqlite3_normalized_sql() interface when it is
called on a prepared statement that did not previously have a computed
normalization of the input SQL.

FossilOrigin-Name: 1a1a59c6c570879c8f318bbc132103c0285088ba233dd8c32e049b86419347b0

6 years agoGet rid of the hash table used to track IN operators in the
drh [Wed, 5 Dec 2018 23:56:02 +0000 (23:56 +0000)] 
Get rid of the hash table used to track IN operators in the
sqlite3_normalized_sql() implementation.  Use simple integer variables
instead.

FossilOrigin-Name: 272dc74fd0304d6a28aaa8798d13e2f950c1a24d92d17519e3c32aef86714586

6 years agoThe sqlite3_normalized_sql() interface should not be transforming quoted
drh [Wed, 5 Dec 2018 23:45:46 +0000 (23:45 +0000)] 
The sqlite3_normalized_sql() interface should not be transforming quoted
identifier names into wildcards.  Fix this, and at the same time simplify
the code substantially.

FossilOrigin-Name: e8540377ec66fa5f9ae3c93bedb5c094057698199c37fc211f7ea95429e815e4

6 years agoFix an imbalanced lock problem in sqlite3Normalize() introduced by the
drh [Wed, 5 Dec 2018 21:55:39 +0000 (21:55 +0000)] 
Fix an imbalanced lock problem in sqlite3Normalize() introduced by the
simplification in [94ea6379178e3ff6a].

FossilOrigin-Name: f69624373e33c4d370a9264a317ffdb0adbce967a950f243de2b41161a8c7ded

6 years agoIncrease the version number to 3.27.0 for the next development cycle.
drh [Wed, 5 Dec 2018 19:42:59 +0000 (19:42 +0000)] 
Increase the version number to 3.27.0 for the next development cycle.

FossilOrigin-Name: 8f8d682825d065bcaebda4cba63f8b67789b923d8b62eb7c576a5bc01536f577

6 years agoSimplifications to the sqlite3_normalized_sql() implementation.
drh [Wed, 5 Dec 2018 17:48:57 +0000 (17:48 +0000)] 
Simplifications to the sqlite3_normalized_sql() implementation.

FossilOrigin-Name: 94ea6379178e3ff6a0d1d5819ca4ac558bdadb1ca8a3637c797079db7dc0cd61

6 years agoEnsure that ALTER TABLE modifies table and column names embedded in WITH
dan [Wed, 5 Dec 2018 13:49:04 +0000 (13:49 +0000)] 
Ensure that ALTER TABLE modifies table and column names embedded in WITH
clauses that are part of views and triggers.

FossilOrigin-Name: f44bc7a8b3fac82aa5598e9bdaf65ea4dd3c331cf90c1d5ba26ff1698e92c230

6 years agoEnhance the sqlite3_normalize_sql() interface so that it works even if the
drh [Wed, 5 Dec 2018 13:39:06 +0000 (13:39 +0000)] 
Enhance the sqlite3_normalize_sql() interface so that it works even if the
prepared statement was not initially compiled using
SQLITE_PREPARE_NORMALIZED.  Enhance the ".trace" command in the CLI so that
it is able to access the full scope of functionality provided by
sqlite3_trace_v2() and in particular so that it is able to show normalized
SQL output using the newly enhanced sqlite3_normalize_sql() interface.

FossilOrigin-Name: 7da617e97eb905cb009c47403786682b911e32a630f266e1c53ea72836fc88b5

6 years agoAdd the "index_usage" utility program.
drh [Tue, 4 Dec 2018 16:51:42 +0000 (16:51 +0000)] 
Add the "index_usage" utility program.

FossilOrigin-Name: df95455213c9d1db7229e94217e78edc05cbf9e40f39528105494ea6ac52be94

6 years agoPerformance improvement in sqlite3_step() by creating a new mTrace flag
drh [Tue, 4 Dec 2018 14:33:02 +0000 (14:33 +0000)] 
Performance improvement in sqlite3_step() by creating a new mTrace flag
for the legacy xProfile pointer that is set by sqlite3_profile().

FossilOrigin-Name: e28584e8bc7b7405380064b60523fa6191f827f74075f6d117eb7732d752ba5e

6 years agoSmall performance increase in sqlite3_step() for the common case where
drh [Tue, 4 Dec 2018 13:51:26 +0000 (13:51 +0000)] 
Small performance increase in sqlite3_step() for the common case where
it returns SQLITE_ROW.

FossilOrigin-Name: 893448265299f4c70c32c8e92ea66f8d33c1c213b21701f73fa3815514cd5ef6

6 years agoReduce the size of the parser tables generated by Lemon by splitting the
drh [Mon, 3 Dec 2018 23:57:27 +0000 (23:57 +0000)] 
Reduce the size of the parser tables generated by Lemon by splitting the
yyRuleInfo structure into separate yyRuleInfoLhs and yyRuleInfoNRhs arrays.

FossilOrigin-Name: 70fe8ec2ae3099b8773834c7ac2e56768addbecd57956ac523e71a7dc264049c

6 years agoRemove the unused sqlite3Fts5UnicodeNCat() function.
drh [Mon, 3 Dec 2018 17:40:46 +0000 (17:40 +0000)] 
Remove the unused sqlite3Fts5UnicodeNCat() function.

FossilOrigin-Name: 7149dacf1d440a19f62808b4591c3fa8da202b2ec742d5490a63f2ec005ff9e7

6 years agoAdd the "remove_diacritics=2" option to the unicode61 tokenizer in both FTS5
dan [Mon, 3 Dec 2018 16:14:49 +0000 (16:14 +0000)] 
Add the "remove_diacritics=2" option to the unicode61 tokenizer in both FTS5
and FTS3/4.

FossilOrigin-Name: 06177f3f114b5d804b84c27ac843740282e2176fdf0f7a999feda0e1b624adec

6 years agoUpdate the autoconf makefile for MSVC.
mistachkin [Mon, 3 Dec 2018 14:58:07 +0000 (14:58 +0000)] 
Update the autoconf makefile for MSVC.

FossilOrigin-Name: 675aba1f8b989cfd99370704ecb09031026dc3321cccad122ea91d816e02fdba

6 years agoRemove two lines of unnecessary code, for a very small performance increase
drh [Mon, 3 Dec 2018 01:58:02 +0000 (01:58 +0000)] 
Remove two lines of unnecessary code, for a very small performance increase
and size decrease.

FossilOrigin-Name: 15824ccda0f110794a479b58fbf36082d8c383f34bae9dc0921d96547fb37869

6 years agoFix a parser bug in the use of parentheses around table-valued functions.
drh [Mon, 3 Dec 2018 01:47:41 +0000 (01:47 +0000)] 
Fix a parser bug in the use of parentheses around table-valued functions.

FossilOrigin-Name: 58a51123d1a6381cc67d3c64ba3468ec5a92c299ad6fd86de0b843d0ffafb846

6 years agoOmit a line of code that has no affect on the outcome.
drh [Sun, 2 Dec 2018 01:15:16 +0000 (01:15 +0000)] 
Omit a line of code that has no affect on the outcome.

FossilOrigin-Name: 5d933aa659eb7a13f9ab44fe7762be292a1c3c75b957a3b7e0bc6188257b62f4

6 years agoVery slightly smaller and faster.
drh [Sat, 1 Dec 2018 21:13:41 +0000 (21:13 +0000)] 
Very slightly smaller and faster.

FossilOrigin-Name: 27798f17f567ad065f8a99effcb287bc241df7b450330ef890d192c70528e62b

6 years agoVersion 3.26.0 version-3.26.0
drh [Sat, 1 Dec 2018 12:34:55 +0000 (12:34 +0000)] 
Version 3.26.0

FossilOrigin-Name: bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9

6 years agoFix a typo in a comment. No changes to code.
drh [Fri, 30 Nov 2018 20:59:00 +0000 (20:59 +0000)] 
Fix a typo in a comment. No changes to code.

FossilOrigin-Name: 23684cb841ac2cb0d69e5470253bd96feb733762a7553b952a08470834fe85fa

6 years agoFix the name of the trig function approximation in geopoly. No functional
drh [Thu, 29 Nov 2018 12:00:02 +0000 (12:00 +0000)] 
Fix the name of the trig function approximation in geopoly.  No functional
changes to the code.

FossilOrigin-Name: 33576b12b450a37b467ba012e77b297eb80d7147b12a5b23302009bb32455720

6 years agoFix a typo in a comment used to generate documentation. No changes to code.
drh [Wed, 28 Nov 2018 19:23:28 +0000 (19:23 +0000)] 
Fix a typo in a comment used to generate documentation.  No changes to code.

FossilOrigin-Name: 62360ceae9d2321003c49cfac3e9f915969a0da12d02c3e633cfa898c0a68566

6 years agoUpdate incrvacuum.test so that it works with builds that do not support mmap().
dan [Thu, 29 Nov 2018 01:20:51 +0000 (01:20 +0000)] 
Update incrvacuum.test so that it works with builds that do not support mmap().

FossilOrigin-Name: 8eb62fd5fa9adb88de51aa812270dbdb32ee5cacd636d200e658c507a14a035b

6 years agoUpdate some test cases to account for SQLITE_OMIT_VIRTUAL_TABLE builds.
dan [Wed, 28 Nov 2018 11:49:46 +0000 (11:49 +0000)] 
Update some test cases to account for SQLITE_OMIT_VIRTUAL_TABLE builds.

FossilOrigin-Name: b53a9a3dc6b0422a102b245451769b0cd8c0d67090fefabf7cb3a65137a73771

6 years agoFollow-up to [0bf0fd242b93c3bd30]: only reset the pager when adding a
drh [Wed, 28 Nov 2018 11:09:09 +0000 (11:09 +0000)] 
Follow-up to [0bf0fd242b93c3bd30]: only reset the pager when adding a
new codec, not when overwriting an existing codec.  Also, improve a
comment in the pcache1 subsystem.

FossilOrigin-Name: 5c040fdb013d178e5dffa300621eab91b92beb085ffb9ef2ba08f6bf1dd4013e

6 years agoChanges to Makefile.in to allow testfixture to be built with
dan [Wed, 28 Nov 2018 08:24:41 +0000 (08:24 +0000)] 
Changes to Makefile.in to allow testfixture to be built with
SQLITE_USER_AUTHENTICATION.

FossilOrigin-Name: 7b510f59fd2cf68331c35ef6b4c2bcf092adf1120ea22be74d1bab1f42a171f5

6 years agoRemove -DSQLITE_USER_AUTHENTICATION from the "Unlock-Notify" configuration.
dan [Wed, 28 Nov 2018 08:09:08 +0000 (08:09 +0000)] 
Remove -DSQLITE_USER_AUTHENTICATION from the "Unlock-Notify" configuration.
Create a dedicated "User-Auth" configuration for testing this feature.

FossilOrigin-Name: 8c41024fbba8c70b671c63a5719c6757f0e6dc731ce52caa755edbb8e21d6944

6 years agoFixes for SQLITE_OMIT_VIRTUAL_TABLE builds.
dan [Wed, 28 Nov 2018 08:02:28 +0000 (08:02 +0000)] 
Fixes for SQLITE_OMIT_VIRTUAL_TABLE builds.

FossilOrigin-Name: 9bcdec85e21a5228c700f7373b92ae7ea14b585bcda34235b605be4f7ec15a15

6 years agoAlways enable SQLITE_ENABLE_DESERIALIZE for the MSVC makefile as this is necessary
drh [Wed, 28 Nov 2018 01:45:05 +0000 (01:45 +0000)] 
Always enable SQLITE_ENABLE_DESERIALIZE for the MSVC makefile as this is necessary
to get releasetest.tcl to work.

FossilOrigin-Name: d362dedba3637013d654f2a890fc7b61476f2adeb6bf3bffb4e715c1d1d0b7c2

6 years agoFix a failing assert() in sqlite3ResetAllSchemasOfConnection().
dan [Tue, 27 Nov 2018 19:47:55 +0000 (19:47 +0000)] 
Fix a failing assert() in sqlite3ResetAllSchemasOfConnection().

FossilOrigin-Name: 0ea049f342d11c676e148239e45d252164081362e921a4beb735d6899eb77344

6 years agoImprovements to two cases in pragma4.test.
drh [Tue, 27 Nov 2018 17:02:38 +0000 (17:02 +0000)] 
Improvements to two cases in pragma4.test.

FossilOrigin-Name: 3c893d9bcc34c391505b08cc35808dd3abddf3c5d952798334c296547bcae6a6

6 years agoRemove the sqlite3PagerUseWal() routine which was made obsolete by
drh [Tue, 27 Nov 2018 14:41:07 +0000 (14:41 +0000)] 
Remove the sqlite3PagerUseWal() routine which was made obsolete by
the [81629ba91475938b6ad] change.

FossilOrigin-Name: 4331b4990cbc1221d94fadd376dfc6efe83f67836aef00912126da4c924bf659

6 years agoAdd a simple test case for Lemon. Always include assert.h in the
drh [Tue, 27 Nov 2018 14:34:33 +0000 (14:34 +0000)] 
Add a simple test case for Lemon.  Always include assert.h in the
Lemon-generated parser.

FossilOrigin-Name: 9c9c46dcbe92aeabe3d5675bb69681b6dfd53798bc67e6a2ceba67ed3c4fb0af

6 years agoFix to the error handling logic in the Lemon parser template. This does
drh [Tue, 27 Nov 2018 14:03:11 +0000 (14:03 +0000)] 
Fix to the error handling logic in the Lemon parser template.  This does
not affect SQLite since SQLite does not use that part of the Lemon parser
template.

FossilOrigin-Name: c6dfc59eb12a02d35b708b5d94239377c79f688fa572f72bad51a157b1bf599c

6 years agoAdd an "#ifndef SQLITE_DISABLE_FTS4_DEFERRED" block around function
dan [Tue, 27 Nov 2018 09:57:10 +0000 (09:57 +0000)] 
Add an "#ifndef SQLITE_DISABLE_FTS4_DEFERRED" block around function
fts3EvalDeferredPhrase() in fts3 in order to silence a compiler warning.

FossilOrigin-Name: 6f4b0d0494446d46ac22b17650a25b025995cc545cac8fbc4776cf9dd388bcd8

6 years agoDo not allow direct access to internal-use SQL functions such as
drh [Mon, 26 Nov 2018 18:09:15 +0000 (18:09 +0000)] 
Do not allow direct access to internal-use SQL functions such as
sqlite_rename_column() and sqlite3_rename_table() except when the
new SQLITE_TESTCTRL_INTERNAL_FUNCTIONS flag is set.

FossilOrigin-Name: 6e1330545e7b74fe5f1f20751a3425e2788441485fc07fcb7626e448c72027ce

6 years agoMinor comment enhancement in alter.c. No changes to code.
drh [Mon, 26 Nov 2018 15:00:25 +0000 (15:00 +0000)] 
Minor comment enhancement in alter.c.  No changes to code.

FossilOrigin-Name: 12920bcb99b25e147e1877ee001bc551a743e3530c954fe2b45a18a4eef9eeff

6 years agoFix a bug in the geopoly_ccw() function. Test cases in TH3.
drh [Sat, 24 Nov 2018 20:44:46 +0000 (20:44 +0000)] 
Fix a bug in the geopoly_ccw() function.  Test cases in TH3.

FossilOrigin-Name: 773c5c1d9c0ec40c51949c38c9dc17e778086f3f92791cca9b85288de0076dab

6 years agoMake the winTruncate() method of the windows VFS be a no-op if there are
drh [Sat, 24 Nov 2018 17:46:07 +0000 (17:46 +0000)] 
Make the winTruncate() method of the windows VFS be a no-op if there are
outstanding references to the memory-mapped pages.  Otherwise, memory might
be deleted out from under those references when the file is remapped during
the truncate operation.

FossilOrigin-Name: ffce4aac18dacbf2a3112ae2ab56c7db20cb164f179683d90a66ef38f4a98f2b

6 years agoRemove the unused mmapSizeActual field from the Windows sqlite3_file
drh [Sat, 24 Nov 2018 16:07:21 +0000 (16:07 +0000)] 
Remove the unused mmapSizeActual field from the Windows sqlite3_file
implementation.

FossilOrigin-Name: 0e7aa62227d1d9c3540b54d7caf44a1ce7ccfa706672fc41dbb2be477ab3a667

6 years agoFix a problem reading from temp databases in SQLITE_DIRECT_OVERFLOW_READ
dan [Thu, 22 Nov 2018 19:10:14 +0000 (19:10 +0000)] 
Fix a problem reading from temp databases in SQLITE_DIRECT_OVERFLOW_READ
builds.

FossilOrigin-Name: 81629ba91475938b6ad528e7b1dbef4ad22239782bb2e9c1bb59413aba11da87

6 years agoImprovements to the ossfuzz.c fuzz-testing module so that it works with
drh [Wed, 21 Nov 2018 14:27:34 +0000 (14:27 +0000)] 
Improvements to the ossfuzz.c fuzz-testing module so that it works with
-DSQLITE_OMIT_PROGRESS_CALLBACK and with -DSQLITE_OMIT_INIT.

FossilOrigin-Name: d343f7d6b05865c282eb73a0e39dc396f2927982af45b3d045de03ef73715693

6 years agoFix problems in pragma.c causing some PRAGMA statements to test the wrong
dan [Tue, 20 Nov 2018 18:09:59 +0000 (18:09 +0000)] 
Fix problems in pragma.c causing some PRAGMA statements to test the wrong
schema-cookie before proceeding, or to try to open cursors on the wrong
database ("PRAGMA foreign_key_check" only).

FossilOrigin-Name: 6982f52f579d20b8a2965373731d41622bda7f09fbf82cc005bb378321829f4c

6 years agoFix the regexp used to recognize libdl errors on OS-X.
drh [Sat, 17 Nov 2018 14:59:35 +0000 (14:59 +0000)] 
Fix the regexp used to recognize libdl errors on OS-X.

FossilOrigin-Name: 1740025307531a52e4f0641e2e74dc14715130858f2e9236be13b66924f00220

6 years agoFix harmless compiler warnings that appear with SQLITE_OMIT_EXPLAIN.
drh [Sat, 17 Nov 2018 14:26:45 +0000 (14:26 +0000)] 
Fix harmless compiler warnings that appear with SQLITE_OMIT_EXPLAIN.

FossilOrigin-Name: 5fff00b0d5eb634d40e767671d5a0e8bd263d15d88abe531f6072f01bc789568

6 years agoRemove a C++-style comment.
drh [Sat, 17 Nov 2018 14:19:34 +0000 (14:19 +0000)] 
Remove a C++-style comment.

FossilOrigin-Name: 645232f2b9ce3ee345b1d22c0db1265e39bb674bef9ab6fb10d5bee8ab696787

6 years agoFix a problem in test script e_fkey.test.
dan [Sat, 17 Nov 2018 13:08:07 +0000 (13:08 +0000)] 
Fix a problem in test script e_fkey.test.

FossilOrigin-Name: acfd0a05a8957728c1f0eb936f4121ce26f291f20dd583bd57ce2bb271617d3f

6 years agoFix a test case so that it works on windows.
drh [Fri, 16 Nov 2018 20:50:53 +0000 (20:50 +0000)] 
Fix a test case so that it works on windows.

FossilOrigin-Name: 2d92d25fae5d9757866a0d0b30427b50d635e9b05e12df9464f095419fd7ef3e

6 years agoAdd SQLITE_CONSTRAINT support to the xBestIndex methods on dbstat,
drh [Fri, 16 Nov 2018 20:18:07 +0000 (20:18 +0000)] 
Add SQLITE_CONSTRAINT support to the xBestIndex methods on dbstat,
sqlite_dbpage, and zipfile.

FossilOrigin-Name: 5cd24e552b4fed71cfb2e37929371175682f23f1430df2900a87e6a5823d138e

6 years agoUpdate the explain virtual table to make use of SQLITE_CONSTRAINT.
drh [Fri, 16 Nov 2018 19:19:58 +0000 (19:19 +0000)] 
Update the explain virtual table to make use of SQLITE_CONSTRAINT.

FossilOrigin-Name: b2d41ff7027b44ccb5dffc303c47d42f1f6fd66ce22e90450d3a666c73fe8b8e

6 years agoFix the JSON table-valued functions to make use of SQLITE_CONSTRAINT.
drh [Fri, 16 Nov 2018 16:04:50 +0000 (16:04 +0000)] 
Fix the JSON table-valued functions to make use of SQLITE_CONSTRAINT.

FossilOrigin-Name: 3f34f4f561c77f8ec88906818f2984dcf8f17d1645bac175e9027595517560bc

6 years agoAdd an assert() to the generate_series virtual table to verify
drh [Fri, 16 Nov 2018 15:41:27 +0000 (15:41 +0000)] 
Add an assert() to the generate_series virtual table to verify
assumptions about the design.

FossilOrigin-Name: cd13b499a20a7d476edb8500537edef4c5151410ba0300469ebf0f7ba16964b8

6 years agoUpdate the generate_series() table-valued function to make use of the new
drh [Fri, 16 Nov 2018 15:08:31 +0000 (15:08 +0000)] 
Update the generate_series() table-valued function to make use of the new
SQLITE_CONSTRAINT return from xBestIndex.

FossilOrigin-Name: 4372ad644dda5a1fa46b6b6070092320c835439b41f598cbc041e9deef786988

6 years agoIn order to avoid exporting a symbol, use a macro instead of a function to
dan [Fri, 16 Nov 2018 14:36:42 +0000 (14:36 +0000)] 
In order to avoid exporting a symbol, use a macro instead of a function to
replace sqlite3_complete() in the shell code when SQLITE_OMIT_COMPLETE is
defined.

FossilOrigin-Name: d584a0cb512815945ef06ee3b5ebadbf2a543b008487f6d098e1e8ab79f61d2d

6 years agoEnhance the xBestIndex interface of virtual table so that if the xBestIndex
drh [Fri, 16 Nov 2018 13:56:15 +0000 (13:56 +0000)] 
Enhance the xBestIndex interface of virtual table so that if the xBestIndex
method returns SQLITE_CONSTRAINT then that particular combination of
constraints is considered unusable and does not participate further in
query planning.

FossilOrigin-Name: 684013cef6bfcfd920a4aec645df9f5d41ace8b34e75fca61759c1b4f82cc89e

6 years agoFix comments and make magic numbers into #defines in the fsdir
drh [Fri, 16 Nov 2018 13:06:30 +0000 (13:06 +0000)] 
Fix comments and make magic numbers into #defines in the fsdir
implementation.

FossilOrigin-Name: c537c9c3630ca979bdccab977275bfc11cce33ea54adb71a4bd4f46c85f65c6f

6 years agoFix a problem with virtual table "fsdir" and some join queries.
dan [Fri, 16 Nov 2018 08:36:15 +0000 (08:36 +0000)] 
Fix a problem with virtual table "fsdir" and some join queries.

FossilOrigin-Name: 7fffcee0fc3fe8d036f0d93ec17673992c3edcf2bb454dc90d80142435b37946

6 years agoImprovements to the CSV virtual table.
drh [Fri, 16 Nov 2018 01:42:26 +0000 (01:42 +0000)] 
Improvements to the CSV virtual table.

FossilOrigin-Name: 0406ecbbe75513e342040b71fdd342462222dbb3820486b5f745d7865805c00b

6 years agoFix typos in the previous check-in.
mistachkin [Thu, 15 Nov 2018 19:12:22 +0000 (19:12 +0000)] 
Fix typos in the previous check-in.

FossilOrigin-Name: 9b37bbf5f338dea962331e4fd73dfa0baae98ba63344a2fa737b845b90ecb0c5

6 years agoInclude geopoly in the compiler-warning script.
drh [Thu, 15 Nov 2018 16:56:33 +0000 (16:56 +0000)] 
Include geopoly in the compiler-warning script.

FossilOrigin-Name: 3d947e1ec0f0800fcad3a04e4876d5247fd1b23e51ed7f49d428fff6683e8a16

6 years agoNew fuzztest cases.
drh [Thu, 15 Nov 2018 13:51:48 +0000 (13:51 +0000)] 
New fuzztest cases.

FossilOrigin-Name: e8316ba47f566c8d2cb48d9d54308e8869743ef39d35b662a8764b0479aed9e0

6 years agoFix a potential buffer overread in the dbstat virtual table when processing
drh [Tue, 13 Nov 2018 20:21:52 +0000 (20:21 +0000)] 
Fix a potential buffer overread in the dbstat virtual table when processing
a corrupt database file.

FossilOrigin-Name: a62e6b593b59eae44d299842a4d02b9346a0c72a3e1206882f304ab40f2cd5c5

6 years agoTurn on ASAN for the dbfuzz2 utility. Fix a buffer overread associated
drh [Tue, 13 Nov 2018 19:51:41 +0000 (19:51 +0000)] 
Turn on ASAN for the dbfuzz2 utility.  Fix a buffer overread associated
with sqlite3_deserialize().

FossilOrigin-Name: 4e38f27b55030e908bd36f32101e26b30f10dbde67e12c8197d0363ee12aa06d

6 years agoNew hyperlinks in comments used to generate documentation. No changes to code.
drh [Mon, 12 Nov 2018 15:20:44 +0000 (15:20 +0000)] 
New hyperlinks in comments used to generate documentation.  No changes to code.

FossilOrigin-Name: f9755f81b1c0fd29f242dce78a2fba570fa2714d76e93b8563f426a040352513

6 years agoFix a use-after-free problem in the fts5vocab virtual table.
dan [Mon, 12 Nov 2018 13:20:00 +0000 (13:20 +0000)] 
Fix a use-after-free problem in the fts5vocab virtual table.

FossilOrigin-Name: ac69d169c61c973448b1d3eef5b8ff0de2d932d7bb74068344cb1b79bd330578

6 years agoAdd support for read-only shadow tables on virtual tables. Added the
drh [Sat, 10 Nov 2018 18:23:32 +0000 (18:23 +0000)] 
Add support for read-only shadow tables on virtual tables.  Added the
SQLITE_DEFAULT_DEFENSIVE compile-time option that can put SQLite in
defensive mode by default.

FossilOrigin-Name: 9c685171c4d7ae8615d1489c9621aba79fe4ef1f0e56b75823b88c3e70d127df

6 years agoAdd the "changesetfuzz" program. For fuzzing changeset blobs.
dan [Sat, 10 Nov 2018 17:37:39 +0000 (17:37 +0000)] 
Add the "changesetfuzz" program. For fuzzing changeset blobs.

FossilOrigin-Name: 2bae0e7c1c1393aeb0bb7234865e410c9ca0e3c31cdc8566e9503f70ca7ac64c

6 years agoMerge latest trunk changes. changesetfuzz
dan [Sat, 10 Nov 2018 17:36:55 +0000 (17:36 +0000)] 
Merge latest trunk changes.

FossilOrigin-Name: b6d549c988e765789c4a81d586170451db9f5da1973dde8aa0329445f915fbb2

6 years agoRemove a NEVER() that is reachable after all. Reverts checkin [9292d3351c40339]. read-only-shadow
drh [Sat, 10 Nov 2018 04:14:51 +0000 (04:14 +0000)] 
Remove a NEVER() that is reachable after all. Reverts checkin [9292d3351c40339].

FossilOrigin-Name: c5dc7fb873b15bd4e4f31b944c9feee78ab7ec2cb74f5fc55b615fd0e2784a88

6 years agoMerge fixes from trunk.
drh [Sat, 10 Nov 2018 03:47:40 +0000 (03:47 +0000)] 
Merge fixes from trunk.

FossilOrigin-Name: bf88efcec40036e0805940ff6371643dbc518442457d2bc18c711753607ae36c

6 years agoFix invalid use of unprotected sqlite3_value objects in the sqldiff utility,
drh [Fri, 9 Nov 2018 23:41:57 +0000 (23:41 +0000)] 
Fix invalid use of unprotected sqlite3_value objects in the sqldiff utility,
when using the --changeset option.

FossilOrigin-Name: a8d65214a567eb1afd703ee4d09d398247e060a610b46097a726364db2861001

6 years agoWhen a table is renamed using "ALTER TABLE RENAME TO", update any REFERENCES
dan [Fri, 9 Nov 2018 20:04:05 +0000 (20:04 +0000)] 
When a table is renamed using "ALTER TABLE RENAME TO", update any REFERENCES
clauses that refer to the table, unless "PRAGMA legacy_alter_table" is true
and "PRAGMA foreign_keys" is set to false (i.e. so that when "PRAGMA
legacy_alter_table" is set behaviour is still compatible with versions 3.24
and earlier).

FossilOrigin-Name: ae9638e9c0ad0c366f93c88a850f6b4cc86881e9f3f9f1e39574d9d83ddd8a6a

6 years agoFix for ticket [787fa716be3a7f650cac]
drh [Fri, 9 Nov 2018 14:17:51 +0000 (14:17 +0000)] 
Fix for ticket [787fa716be3a7f650cac]

FossilOrigin-Name: 531eca6104e41e4301fa2cf58bb8fec811da31e151a0f766c93aece5521d235b

6 years agoIn the treeview.c module, break out the display of SrcList into a separate
drh [Thu, 8 Nov 2018 22:53:06 +0000 (22:53 +0000)] 
In the treeview.c module, break out the display of SrcList into a separate
subroutine, so that it can be invoked while debugging.

FossilOrigin-Name: 8c74065f0031274d9bc711d5d53c39aefcfb2b2679811105974a2c7c7a9e1dcb

6 years agoImproved documentation for SQLITE_DBCONFIG_DEFENSIVE. Add a NEVER() macro
drh [Thu, 8 Nov 2018 17:32:50 +0000 (17:32 +0000)] 
Improved documentation for SQLITE_DBCONFIG_DEFENSIVE.  Add a NEVER() macro
on an unreachable branch.

FossilOrigin-Name: 9292d3351c40339de7ad6bc26c02e7592e6cdee2592e0c790fae63ccf21ea88c

6 years agoAdd tests and a fix for program "changesetfuzz".
dan [Thu, 8 Nov 2018 14:59:51 +0000 (14:59 +0000)] 
Add tests and a fix for program "changesetfuzz".

FossilOrigin-Name: 09b90db56c2d5e3aceae59c6bf1eb07f9db9ef38da29d2162046b88d39e47b86

6 years agoMerge latest trunk changes into this branch.
dan [Wed, 7 Nov 2018 20:13:45 +0000 (20:13 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 53cd91d00594f1bd7c0a565a35ec9cac3095a583022d6211158a369e942257b0

6 years agoFix minor issues in the changesetfuzz program.
dan [Wed, 7 Nov 2018 20:07:28 +0000 (20:07 +0000)] 
Fix minor issues in the changesetfuzz program.

FossilOrigin-Name: 5c7f024073bc93089f038b5cf122a7a9d5b933f7c1b357f6d20ae925739ffc38

6 years agoUpdate the "changesetfuzz" program to work with patchsets as well as
dan [Wed, 7 Nov 2018 17:52:29 +0000 (17:52 +0000)] 
Update the "changesetfuzz" program to work with patchsets as well as
changesets.

FossilOrigin-Name: 75b00fbe884d4bd8ba099d7c0a2e8af2f40fedfdef2d9b624dd51cb66952611c

6 years agoPerformance improvement in subroutine that decides whether or not a table
drh [Wed, 7 Nov 2018 16:46:43 +0000 (16:46 +0000)] 
Performance improvement in subroutine that decides whether or not a table
is read-only.

FossilOrigin-Name: 6e4968b00507c4fdbe7e3c91f3f9cd61c6f1848092ddcf306f9fcb101a47fce7

6 years agoMerge the onefile permutation fix from trunk.
drh [Wed, 7 Nov 2018 16:12:34 +0000 (16:12 +0000)] 
Merge the onefile permutation fix from trunk.

FossilOrigin-Name: e543bff87d1efc31a5b863085c056ce06c365cc7d9d3fef0ced7521bde536783

6 years agoMore test-case adjustments for defensive mode.
drh [Wed, 7 Nov 2018 14:41:08 +0000 (14:41 +0000)] 
More test-case adjustments for defensive mode.

FossilOrigin-Name: 911e8a17a3810cd7042e91a32aba80dc3d6be88320c208e48f7bcee8b22a0ff2

6 years agoFix a problem with the handling of SQLITE_FCNTL_PRAGMA in the test_onefile.c
dan [Wed, 7 Nov 2018 14:39:22 +0000 (14:39 +0000)] 
Fix a problem with the handling of SQLITE_FCNTL_PRAGMA in the test_onefile.c
demo.

FossilOrigin-Name: 13e21b7da8fe754e230b09ca0b9f1f69cd9aa20d4407ddd8b95ca3fb18c9abeb

6 years agoMerge the permutations fix from trunk.
drh [Wed, 7 Nov 2018 13:41:27 +0000 (13:41 +0000)] 
Merge the permutations fix from trunk.

FossilOrigin-Name: b753d849fe0524e14ae9367a47e29be76332fafb77bfe13e266aeef1ef6742ce

6 years agoPartially revert [3e1a2f661], as some test scripts require separate $presql
dan [Wed, 7 Nov 2018 11:56:23 +0000 (11:56 +0000)] 
Partially revert [3e1a2f661], as some test scripts require separate $presql
and $dbconfig variables.

FossilOrigin-Name: cbf85284beb60d068b446c52f000d694a810d4de9096ad2951523a4c88e7334c

6 years agoAdd the SQLITE_DEFAULT_DEFENSIVE compile-time option. Fix up test cases
drh [Wed, 7 Nov 2018 02:17:01 +0000 (02:17 +0000)] 
Add the SQLITE_DEFAULT_DEFENSIVE compile-time option.  Fix up test cases
so that they work with DEFENSIVE enabled.

FossilOrigin-Name: 3212733cb6d1a59516d67a86df7c7b1d2456a1b2e5d7080c26b0e87b2609c65d

6 years agoUpdate the changesetfuzz program to fuzz changeset schemas as well as data.
dan [Tue, 6 Nov 2018 20:08:03 +0000 (20:08 +0000)] 
Update the changesetfuzz program to fuzz changeset schemas as well as data.

FossilOrigin-Name: 141a93c843d501d8bb640228645ead0a83870c1c11e9d4b07ed24b296c69a0b8

6 years agoEnable DEFENSIVE mode by default for tests. This requires lots of case of
drh [Tue, 6 Nov 2018 19:26:04 +0000 (19:26 +0000)] 
Enable DEFENSIVE mode by default for tests.  This requires lots of case of
turning DEFENSIVE off in order to dodgy things to the database for testing
purposes.  No all of those cases are yet handled, so "make test" does not run
to completion.

FossilOrigin-Name: a1d6c6712c3304fd736077432c8c180692cf7d79be7f3a073510b6dab0eb951f

6 years agoTurn on defensive mode for running test scripts. Does not yet work.
drh [Tue, 6 Nov 2018 15:57:59 +0000 (15:57 +0000)] 
Turn on defensive mode for running test scripts.  Does not yet work.

FossilOrigin-Name: 1c1d24edbb732f2a2002a741c7a7afdd010b67e1b5e6d90ff36c6428897e7612

6 years agoOnly allow shadow table to be written from within a recursive SQL call.
drh [Tue, 6 Nov 2018 14:03:07 +0000 (14:03 +0000)] 
Only allow shadow table to be written from within a recursive SQL call.
Omit the SQLITE_PREPARE_SHADOW flag.  Some tests are failing because the
tests depend on being able to write to shadow tables.

FossilOrigin-Name: d890c6582524677666e6f5b5817331dec332ade16b2f744cbb8a3c7dd9b63e21

6 years agoAdd enforcement of read-only on shadow tables. This does not currently work
drh [Tue, 6 Nov 2018 13:37:20 +0000 (13:37 +0000)] 
Add enforcement of read-only on shadow tables.  This does not currently work
since some virtual tables are attempting to update shadow tables using
sqlite3_exec().

FossilOrigin-Name: f79b47c9859de597d5924870752dd7cab89c8f0608e5cceb2281f6ffb2e91930

6 years agoInitial code to make shadow tables read-only to ordinary SQL. The now
drh [Mon, 5 Nov 2018 23:01:45 +0000 (23:01 +0000)] 
Initial code to make shadow tables read-only to ordinary SQL. The now
xShadowName method is added to the sqlite3_module object and is used
to identify potential shadow tables.  The SQLITE_PREPARE_SHADOW argument
to sqlite3_prepare_v3() is defined.  It is designed to permit writing to
shadow tables, but is currently an unused placeholder.

FossilOrigin-Name: 31942b3dd3f66eb0d9977bf1cadc2f2d7be7967cce2b55784be0b939dfef1985