]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 years agoRemove vestigial traces of json_ntype(). json-in-core
drh [Tue, 11 Jan 2022 22:06:25 +0000 (22:06 +0000)] 
Remove vestigial traces of json_ntype().

FossilOrigin-Name: 8da07c8b09ff83436a34e539e4cce8ba9524390017ca14f4af8344a12e351550

3 years agoFix the PG-compatible -> and ->> path parsing.
drh [Tue, 11 Jan 2022 18:01:17 +0000 (18:01 +0000)] 
Fix the PG-compatible -> and ->> path parsing.

FossilOrigin-Name: 22d5138315fb77eeea1c7e66ccc4190bcae18d058a99aa37ddd119e54b52f723

3 years agoFix typo in the json-enhancements.md document.
drh [Mon, 10 Jan 2022 17:43:54 +0000 (17:43 +0000)] 
Fix typo in the json-enhancements.md document.

FossilOrigin-Name: feba24ef774d80ebbaf87a93fc106cb7e482edcc3f237edd4c9d4e918ffb3131

3 years agoImplement the new PG-compliant versions of the -> and ->> operators.
drh [Mon, 10 Jan 2022 15:43:13 +0000 (15:43 +0000)] 
Implement the new PG-compliant versions of the -> and ->> operators.

FossilOrigin-Name: 39eff3b9bf1f318d3606d8e5361a2adb2ba8bc1ca2a436ce4f9a204aa4cf20dd

3 years agoNew proposal for -> and ->> operators.
drh [Mon, 10 Jan 2022 13:55:08 +0000 (13:55 +0000)] 
New proposal for -> and ->> operators.

FossilOrigin-Name: 1108e12a2244edc6247050a0e9ad25b912bba6c57c71c51c2bc55167a6955175

3 years agoTypo fix in doc/json-enhancements.md.
drh [Sun, 9 Jan 2022 20:51:59 +0000 (20:51 +0000)] 
Typo fix in doc/json-enhancements.md.

FossilOrigin-Name: c3b01d496479b3250a8895c245f79ab43ac469148d163593fea00894db195a37

3 years agoUpdate the doc/json-enhancements.md document to better explain the features
drh [Sun, 9 Jan 2022 20:42:55 +0000 (20:42 +0000)] 
Update the doc/json-enhancements.md document to better explain the features
of this branch.

FossilOrigin-Name: b8ac938f41eff8e5a23037c0e8b035a65e1b9505eca2a601221c195225595788

3 years agoDo not enclude ENABLE_JSON1 in the compile-time options.
drh [Sun, 9 Jan 2022 19:44:36 +0000 (19:44 +0000)] 
Do not enclude ENABLE_JSON1 in the compile-time options.

FossilOrigin-Name: 8bf41bc5cb19fcde569ed2c788553a848ebd9c79065bd3d2aa99e5a6bfed9696

3 years agoMerge trunk enhancements into the json-in-core branch.
drh [Sun, 9 Jan 2022 19:36:39 +0000 (19:36 +0000)] 
Merge trunk enhancements into the json-in-core branch.

FossilOrigin-Name: ea755771699dcbffe0ddfd204d42fae9b6e79e107485c725b8eb6caab92aacb8

3 years agoAdd a new built-in subtype() function.
drh [Sun, 9 Jan 2022 16:54:02 +0000 (16:54 +0000)] 
Add a new built-in subtype() function.

FossilOrigin-Name: a25f4ce255c034fc694c33728aedb98289ebccda9c48920829ef780b92b8faee

3 years agoAdd NEVER() macros to two branches that became unreachable due to
drh [Sat, 8 Jan 2022 21:50:00 +0000 (21:50 +0000)] 
Add NEVER() macros to two branches that became unreachable due to
[e199a851e316bd47].

FossilOrigin-Name: 71272caff5874137ad0b1ddfc22ced4bb66e6c97f7868fdae0347a186f589b38

3 years agoAdd function format() as an alias for printf(), for compatibility with other
drh [Sat, 8 Jan 2022 21:00:38 +0000 (21:00 +0000)] 
Add function format() as an alias for printf(), for compatibility with other
systems.

FossilOrigin-Name: 68bffc612c467b2419bf5fe85a8ca16b787003e0e8c11f7c051a879f5865b847

3 years agoMerge the JSON function enhancements from the json-enhancements branch into
drh [Sat, 8 Jan 2022 15:37:13 +0000 (15:37 +0000)] 
Merge the JSON function enhancements from the json-enhancements branch into
json-in-core.

FossilOrigin-Name: e116501c2f0e594eb7a3dd804daa943cc508f32ded3078aed21b695ec83bcd4c

3 years agoImproved commenting of changes in the json1.c extension.
drh [Sat, 8 Jan 2022 15:05:53 +0000 (15:05 +0000)] 
Improved commenting of changes in the json1.c extension.

FossilOrigin-Name: 4d81425e1bf2cff6fa961d0a7936b5f62d3f8ffe9bffea89c1e8b8ddf8fad6f4

3 years agoNotes on the JSON enhancement proposals.
drh [Fri, 7 Jan 2022 18:09:56 +0000 (18:09 +0000)] 
Notes on the JSON enhancement proposals.

FossilOrigin-Name: 18160985ea6b2bbf27de25e0f4f3a1ebcdb079a36af039fc06e37a834e49e772

3 years agoReverse the meaningn of -> and ->>. ->> raises an error on invalid JSON
drh [Fri, 7 Jan 2022 17:26:40 +0000 (17:26 +0000)] 
Reverse the meaningn of -> and ->>.  ->> raises an error on invalid JSON
but -> does not.  This allows ->> to behave the same as PG and MySQL.

FossilOrigin-Name: 85f8170555ee0d4d28cb7e120a7062e9f64c331a936fdfa29fc0e67224eea7c6

3 years agoChange the -> operator to use json_extract(). The ->> operator continues
drh [Fri, 7 Jan 2022 17:14:35 +0000 (17:14 +0000)] 
Change the -> operator to use json_extract().  The ->> operator continues
to use json_nextract().

FossilOrigin-Name: b4c8a62381755b9f1447e10ab95df7209eebda91f9a4583ef1c093a13f6b4725

3 years agoNew json_nextract() function that works like json_extract() except that it
drh [Fri, 7 Jan 2022 17:08:48 +0000 (17:08 +0000)] 
New json_nextract() function that works like json_extract() except that it
returns NULL instead of raising an error if the first argument is not
well-formed JSON.  Or if the first argument is not well-formed JSON and
the second argument is '$', then return the first argument quoted.  The
"->" and "->>" operators are converted to use json_nextract().

FossilOrigin-Name: dc00f5286d26524b149de071490320afaa203fec5777b3eb813f07963614861a

3 years agoAdd the json_ntype() SQL function. Works like the 1-argument json_type()
drh [Fri, 7 Jan 2022 16:03:00 +0000 (16:03 +0000)] 
Add the json_ntype() SQL function.  Works like the 1-argument json_type()
except that it returns NULL if the argument is not well-formed JSON, rather
than raising an error.

FossilOrigin-Name: ed9956f5ddca68141eded81d5362847db603257329801622c4eb3b0732112f14

3 years agoAccept abbreviated JSON Paths on the right-hand side of the -> and ->> operators.
drh [Fri, 7 Jan 2022 15:47:12 +0000 (15:47 +0000)] 
Accept abbreviated JSON Paths on the right-hand side of the -> and ->> operators.

FossilOrigin-Name: d15410900dccbb7159683c29f640fa321b1e019718827334f5fefe89da623008

3 years agoAdd new binary operators "->" and "->>" to the parser that evaluate to
drh [Fri, 7 Jan 2022 14:58:47 +0000 (14:58 +0000)] 
Add new binary operators "->" and "->>" to the parser that evaluate to
2-argument SQL functions by the same name.  Add new "->" and "->>" functions
to the JSON extension that are aliases for json_extract().

FossilOrigin-Name: c4e4e3a3fc5da0381ccb7930706e57d7831d87f9c63bafe49ae64117701e1cfe

3 years agoAdd the '-guard:cf' compiler option for Windows 10, per [forum:/forumpost/8d3b4ad694...
mistachkin [Thu, 6 Jan 2022 17:13:56 +0000 (17:13 +0000)] 
Add the '-guard:cf' compiler option for Windows 10, per [forum:/forumpost/8d3b4ad694|forum post 8d3b4ad694].

FossilOrigin-Name: 2d6a16caa7d28ad5c766036b2eb6c2020683fcc9389b3c7df2013739929dd36f

3 years agoAn attempt to integrate the JSON functions directly into the SQLite core,
drh [Thu, 6 Jan 2022 01:40:09 +0000 (01:40 +0000)] 
An attempt to integrate the JSON functions directly into the SQLite core,
rather than holding them as an extension.

FossilOrigin-Name: 583b47d865fb8d2c9ae4d3a4e70356a8a758978efb0a282f6b19775bf41fb748

3 years agoRemove two NEVER() macros that can sometimes be true if the database is
drh [Wed, 5 Jan 2022 21:01:26 +0000 (21:01 +0000)] 
Remove two NEVER() macros that can sometimes be true if the database is
corrupt.  dbsqlfuzz 0414d2c18290fc80fd5fb540def7d3e46c1ae9c6.

FossilOrigin-Name: b6a82f3c3b9d89fdf628c7f117b6a4a64383a36c84fe84d47c80e845c9bd8a4f

3 years agoFix an assert() failure that could follow an OOM when coding a RETURNING trigger...
dan [Wed, 5 Jan 2022 15:54:02 +0000 (15:54 +0000)] 
Fix an assert() failure that could follow an OOM when coding a RETURNING trigger. dbsqlfuzz case 5d3e2438f15dc32b473d9f29413157857efa1212.

FossilOrigin-Name: 7ae596dd4a73a09585c5dc9f4faf75d126d0733fc2fb32c1de64126a1088d967

3 years agoImproved handling of OOM errors in sqlite3ExpandReturning().
drh [Wed, 5 Jan 2022 11:49:58 +0000 (11:49 +0000)] 
Improved handling of OOM errors in sqlite3ExpandReturning().
dbsqlfuzz 1040b720f0bbc3bdcfe7336acffbf71517e3ef82.

FossilOrigin-Name: 33c6b8e94bda12df13b4d2dd782b3120c3628596b86ef531d20b3100bf159b50

3 years agoTest .mode quote blob output
larrybr [Mon, 3 Jan 2022 19:33:44 +0000 (19:33 +0000)] 
Test .mode quote blob output

FossilOrigin-Name: ef4dcd1080241a62a50eff28ef12c49da0116032f10843aaf048ae7ad3cdfd0e

3 years agoSmall performance and size optimization to allocateCursor().
drh [Mon, 3 Jan 2022 01:43:28 +0000 (01:43 +0000)] 
Small performance and size optimization to allocateCursor().

FossilOrigin-Name: 23f042669aff535afa6ee9de367656848d01e90a1c9dab9359fa938a615b4195

3 years agoRemove unnecessary assignment operations in the btree search algorithm,
drh [Sun, 2 Jan 2022 21:53:54 +0000 (21:53 +0000)] 
Remove unnecessary assignment operations in the btree search algorithm,
for a small size reduction and performance increase.

FossilOrigin-Name: 01bd266eb682feed901a0995c2232b62d8444d19dbb227095dfbfe8edeaa5d88

3 years agoIn the CLI, fix ".mode quote" output for UTF16 BLOBs.
drh [Sun, 2 Jan 2022 20:54:33 +0000 (20:54 +0000)] 
In the CLI, fix ".mode quote" output for UTF16 BLOBs.
[forum:/forumpost/b4bfe62fe6|Forum post b4bfe62fe6].

FossilOrigin-Name: 728e9dcc6d211acd787837c41cb62275284b5e02f55bd28bf5a44e233bcb057a

3 years agoDo not open a rollback journal file when the journal_mode is OFF, even if
drh [Sun, 2 Jan 2022 19:32:43 +0000 (19:32 +0000)] 
Do not open a rollback journal file when the journal_mode is OFF, even if
such a file exists on disk. See
[forum/forumpost/ec2a102440|forum post ec2a102440] for a description.  I so
far have been unable to find any harm to come of the problem, other than the
assertion fault when in DEBUG mode.

FossilOrigin-Name: fdf9ed665b2fb07d26f3852bfd2170f2fb56851edd2851d47672116a8ea58463

3 years agoImprove formatting of an assert(). No functional changes.
drh [Sun, 2 Jan 2022 19:10:49 +0000 (19:10 +0000)] 
Improve formatting of an assert().  No functional changes.

FossilOrigin-Name: 4bb78ce8b50af3c6f04ffdf4de4438e61370a73ccfa971479af5d58a0a7e5fbb

3 years agoPerformance optimization in btreeParseCellPtr() by unrolling the loop that
drh [Sun, 2 Jan 2022 16:48:00 +0000 (16:48 +0000)] 
Performance optimization in btreeParseCellPtr() by unrolling the loop that
decodes the rowid.

FossilOrigin-Name: fef72368a2eef5cb68ffc56e4f01be212d5e3318ebdb56a23ab26e1ef454272e

3 years agoSmall performance optimization and size reduction in sqlite3BtreeDelete().
drh [Sun, 2 Jan 2022 14:55:43 +0000 (14:55 +0000)] 
Small performance optimization and size reduction in sqlite3BtreeDelete().

FossilOrigin-Name: da0af4dd9ba4180a16543fac1549fd4ccecdc66dcf6d275f77de21fd80708882

3 years agoClear the cache of triggers used to implement CASCADE foreign key constraints
drh [Sun, 2 Jan 2022 12:01:03 +0000 (12:01 +0000)] 
Clear the cache of triggers used to implement CASCADE foreign key constraints
whenever the schema changes.  Fix for the problem identified by
[forum:/forumpost/2831335356|forum post 2831335356].

FossilOrigin-Name: 5232c9777fe4fb13e1ecfe5b5d644e2c45d0514f95884dbed49a03fb9b67304c

3 years agoEarlier detection of corruption in sqlite3BtreeDelete(). Fix for
drh [Sun, 2 Jan 2022 11:25:51 +0000 (11:25 +0000)] 
Earlier detection of corruption in sqlite3BtreeDelete().  Fix for
the assertion fault reported by
[forum:/forumpost/9d78389221|forum post 9d78389221].

FossilOrigin-Name: 13e9ff9e84a114374b49986484dbee05953a496f3017dd5089fba6f495a17c40

3 years agoDo not raise an SQLITE_SCHEMA error if in sqlite3Init(). Fix for PoC #2 in
drh [Sat, 1 Jan 2022 22:55:31 +0000 (22:55 +0000)] 
Do not raise an SQLITE_SCHEMA error if in sqlite3Init().  Fix for PoC #2 in
[forum:/forumpost/b03d86f951|forum post b03d86f951].  See TH3 for test
cases.

FossilOrigin-Name: e199a851e316bd471bfc54204b8c250d3ae93b829261214158a2c74acad4093e

3 years agoFix an assert() in pager.c to avoid the possibility of side-effects.
dan [Sat, 1 Jan 2022 20:02:58 +0000 (20:02 +0000)] 
Fix an assert() in pager.c to avoid the possibility of side-effects.

FossilOrigin-Name: 1d1fe03c752267f03f015ada975876f65e2a7b967e19f057b5c73f95d7df8a9c

3 years agoAttempt to fix a harmless compiler warning in FTS5.
drh [Sat, 1 Jan 2022 19:55:29 +0000 (19:55 +0000)] 
Attempt to fix a harmless compiler warning in FTS5.

FossilOrigin-Name: 8e619c21e2326be1538b60908e7cd211558ec840835c6eb69e768eb190e1fd0b

3 years agoFix an obscure problem with releasing savepoints stored in an in-memory journal that...
dan [Sat, 1 Jan 2022 19:29:50 +0000 (19:29 +0000)] 
Fix an obscure problem with releasing savepoints stored in an in-memory journal that could cause subsequent savepoint rollback to fail.

FossilOrigin-Name: 73c2b50211d3ae26aeb89976ec7b9fcd7de9f152b283ec7d0809ad18bddc603e

3 years agoRemove an obsolete assert() statement that no longer does anything useful
drh [Sat, 1 Jan 2022 17:21:55 +0000 (17:21 +0000)] 
Remove an obsolete assert() statement that no longer does anything useful
and which is not always true.  Fix for PoC #1 of
[forum:/forumpost/b03d86f951|forum post b03d86f951].

FossilOrigin-Name: c76a4c0b3cb625017ba09c8bccfcf1b5826df6873f1d3705d3345716079d5ec9

3 years agoFix a faulty assert() statement - adding a CORRUPT_DB term - based on a test
drh [Sat, 1 Jan 2022 12:26:01 +0000 (12:26 +0000)] 
Fix a faulty assert() statement - adding a CORRUPT_DB term - based on a test
case derived from [562805cf488a455c].  Also add a test case to that prior
issue.

FossilOrigin-Name: 0dd6b5fccd554ebe4c0b081601863acd7b6ea81b51e14b508b23244f2a570e7e

3 years agoMark the REGEXP operator in the built-in extension as deterministic.
drh [Fri, 31 Dec 2021 22:53:15 +0000 (22:53 +0000)] 
Mark the REGEXP operator in the built-in extension as deterministic.

FossilOrigin-Name: e654b57a9fc32021453eed48d1c1bba65c833fb1aac3946567968c877e4cbd10

3 years agoSimplify the sqlite3RunParser() routine by omitting the third parameter.
drh [Fri, 31 Dec 2021 19:20:42 +0000 (19:20 +0000)] 
Simplify the sqlite3RunParser() routine by omitting the third parameter.
Results in a binary that is about 100 bytes smaller and 1.4M cycles faster.

FossilOrigin-Name: 6fb2a1bb0280d6e31291e3fd06bbcbbb28ef5fb27d3898e2327a50ac738ae1f3

3 years agoFix harmless compiler warnings in the shell.
mistachkin [Fri, 31 Dec 2021 19:08:20 +0000 (19:08 +0000)] 
Fix harmless compiler warnings in the shell.

FossilOrigin-Name: f3ea36d79b6aa95470bf13e8d4ed5250a6b19bc16032b29e4dcdfc49b47a1edf

3 years agoFix harmless compiler warnings seen with MSVC.
mistachkin [Fri, 31 Dec 2021 18:26:50 +0000 (18:26 +0000)] 
Fix harmless compiler warnings seen with MSVC.

FossilOrigin-Name: a9bfb621091b6d92d1caeb69134d3809d9e0b43fe764608c5995db277ac785be

3 years agoPerformance optimization and size reduction in sqlite3RunParser().
drh [Fri, 31 Dec 2021 17:54:48 +0000 (17:54 +0000)] 
Performance optimization and size reduction in sqlite3RunParser().

FossilOrigin-Name: 41ee2bac5731d8434322e92abba580f7c759a137e576dd286fe01ab23fc440ea

3 years agoMove the pTriggerPrg and pCleanup elements of the Parse object up into the
drh [Fri, 31 Dec 2021 16:37:46 +0000 (16:37 +0000)] 
Move the pTriggerPrg and pCleanup elements of the Parse object up into the
section of that object that is persisted across calls to sqlite3NestedParse().
This fixes a memory leak
[forum:/info/24bd1fef7e9323ef|reported in forum post 24bd1fef7e9323ef].

FossilOrigin-Name: 562805cf488a455cdc57adcb110fef9b5416d813d5eaeabacd28bccb76d7f39d

3 years agoRemove unnecessary conditionals around the ORDER BY resolver calls in
drh [Thu, 30 Dec 2021 17:46:15 +0000 (17:46 +0000)] 
Remove unnecessary conditionals around the ORDER BY resolver calls in
multiSelectOrderBy().

FossilOrigin-Name: f2887e018be71bc406526935c7e99e42f12fc5d1d1c65a89dc2b9bfbca01d43d

3 years agoWhen constructing the sqlite3_index_info object for the xBestIndex method
drh [Thu, 30 Dec 2021 17:36:54 +0000 (17:36 +0000)] 
When constructing the sqlite3_index_info object for the xBestIndex method
of a virtual table, omit constant trims from the ORDER BY clause, as they
will always be in the correct order.

FossilOrigin-Name: 524c2b87d74c8cad6fb377aed7275788d61beafe61e675480de732519987102c

3 years agoWhen a table has an INTEGER PRIMARY KEY ON CONFLICT REPLACE and some other
drh [Thu, 30 Dec 2021 02:38:43 +0000 (02:38 +0000)] 
When a table has an INTEGER PRIMARY KEY ON CONFLICT REPLACE and some other
uniqueness constraint, and it participates in an upsert on that other
constraint, ensure that code that checks for conflicts on the INTEGER PRIMARY
KEY is well-formed.  Fix for the problem reported by
[forum:/forumpost/06b16b8b29f8c8c3|forum post 06b16b8b29f8c8c3].

FossilOrigin-Name: 2f09b51b1ff37bf98f958564cc1224968caa7e33147e6666b5c1ba20b2a7813b

3 years agoWhen implementing a multi-way compound SELECT using merge, try to balance
drh [Thu, 30 Dec 2021 00:37:11 +0000 (00:37 +0000)] 
When implementing a multi-way compound SELECT using merge, try to balance
the merge tree.

FossilOrigin-Name: bb8522fe0dc54282ec13672eba9b44ee08f9cb55c1663f1699a61bf96ec1fd04

3 years agoMinor changes to shell1.test test results to account for the new feature
drh [Wed, 29 Dec 2021 13:32:36 +0000 (13:32 +0000)] 
Minor changes to shell1.test test results to account for the new feature
of the shell that points to the specific part of the input line where the
error occurs.

FossilOrigin-Name: d4870c08893ea9984b1fa1c3a7d04893ad5ed4a2130e9287d169a306cc8ef0a4

3 years agoEnsure that the affinity of columns is honored in the RETURNING clause.
drh [Wed, 29 Dec 2021 04:31:54 +0000 (04:31 +0000)] 
Ensure that the affinity of columns is honored in the RETURNING clause.
See [forum:/forumpost/e0c7574ab2|forum post e0c7574ab2] for the bug report.

FossilOrigin-Name: 4711fb69547f4f17653ab116030c32fdcc2c836410349d1d025866ffc15704da

3 years agoAdd the sqlite3_error_offset() interface. Use it to enhance error reporting
drh [Wed, 29 Dec 2021 04:13:37 +0000 (04:13 +0000)] 
Add the sqlite3_error_offset() interface. Use it to enhance error reporting
in the CLI.

FossilOrigin-Name: 416602a85101c2cd1705eb5306a8933e54cb05ae1562400395ec2769173dec01

3 years agoMake .read's help tell of piped input
drh [Wed, 29 Dec 2021 04:10:49 +0000 (04:10 +0000)] 
Make .read's help tell of piped input

FossilOrigin-Name: 155c3e9c7ccd6fd644cc64b027cf460112c491e5f9202dd76cefe2000936ad80

3 years agoChange an assert() in FTS3 into assert_fts3_nc(), since it is a harmless
drh [Wed, 29 Dec 2021 04:10:03 +0000 (04:10 +0000)] 
Change an assert() in FTS3 into assert_fts3_nc(), since it is a harmless
condition that can occur when processing a corrupt database file.

FossilOrigin-Name: e773d6219bded9a5dfa9930882682dadaa7f1c6be344dbde904c9477a89f2d2c

3 years agoFix the build-breaker bug in test1.c introduced by check-in [7fa20ca4c09ab024]. build-bug
drh [Wed, 29 Dec 2021 04:08:11 +0000 (04:08 +0000)] 
Fix the build-breaker bug in test1.c introduced by check-in [7fa20ca4c09ab024].

FossilOrigin-Name: 5f804da1820c98e7ff5c377e57e30b5154844b92ce622ed2ff888fe2c887e1ca

3 years agoMake .read's help tell of piped input
larrybr [Tue, 28 Dec 2021 05:08:38 +0000 (05:08 +0000)] 
Make .read's help tell of piped input

FossilOrigin-Name: e4ddcd8aa582c1130c34e9f05cd3e5f96ebf03c97a36c09ca442e3612fee4a20

3 years agoChange an assert() in FTS3 into assert_fts3_nc(), since it is a harmless
drh [Sat, 25 Dec 2021 23:59:54 +0000 (23:59 +0000)] 
Change an assert() in FTS3 into assert_fts3_nc(), since it is a harmless
condition that can occur when processing a corrupt database file.

FossilOrigin-Name: c03205aee9015fd886b8db02c8190899cee699255ca370f939e547deaf5ba9e8

3 years agoAdd the sqlite3_error_offset() interface. Use it to enhance error reporting
drh [Sat, 25 Dec 2021 00:26:51 +0000 (00:26 +0000)] 
Add the sqlite3_error_offset() interface.  Use it to enhance error reporting
in the CLI.

FossilOrigin-Name: 7fa20ca4c09ab0249de0363691541fa836120ec277e72feb0e1516b9bfbdd97a

3 years agoOne minor change for an exceptional case in sqlite3_error_offset(). improved-error-context
drh [Sat, 25 Dec 2021 00:19:46 +0000 (00:19 +0000)] 
One minor change for an exceptional case in sqlite3_error_offset().

FossilOrigin-Name: c93609a8b9dc2e656bb4360138606e269fd323469f7666dbc3bbc699e431313e

3 years agoAdd the sqlite3_error_offset() interface. Use it in the CLI to provide
drh [Fri, 24 Dec 2021 20:22:13 +0000 (20:22 +0000)] 
Add the sqlite3_error_offset() interface.  Use it in the CLI to provide
better context for error messages.

FossilOrigin-Name: b518ce77439852759bc0901071f36d622b1314c9bf3d29c279dfcc405188b975

3 years agoFix a minor problem in the CLI introduced by [d156123885abe6bf], apparently.
drh [Fri, 24 Dec 2021 19:44:11 +0000 (19:44 +0000)] 
Fix a minor problem in the CLI introduced by [d156123885abe6bf], apparently.

FossilOrigin-Name: 37e6e10f4364f556c7503c80408fc62895cdccdd0372fb2b63aaca02c3a1ee30

3 years agoRaise an error if a schema name is attached to the table-alias name of a
drh [Fri, 24 Dec 2021 13:30:22 +0000 (13:30 +0000)] 
Raise an error if a schema name is attached to the table-alias name of a
subquery or view.  See
[forum:/forumpost/021a33600b|forum post 021a33600b] for the bug report.

FossilOrigin-Name: 8af8c153f8c3fe16db1c2280571e005838c4ea3c48929ad7660a1686e49ed255

3 years agoReduce the size of the compiled binary by a couple of hundred bytes by
drh [Thu, 23 Dec 2021 00:16:06 +0000 (00:16 +0000)] 
Reduce the size of the compiled binary by a couple of hundred bytes by
using a thigher packing of a transformation table in date.c.
Suggested by [forum:/forumpost/4f6efbb2a9|forum post 4f6efbb2a9].

FossilOrigin-Name: c75ba4fa644d338d22813c17172b9975411fe6197e07fd584e3209e3beb78036

3 years agoUpdate the README.md to instruct the user to remove the final comment line
drh [Tue, 21 Dec 2021 16:59:45 +0000 (16:59 +0000)] 
Update the README.md to instruct the user to remove the final comment line
from the "manifest" file before using it to compute the check-in hash.

FossilOrigin-Name: 7b4f9d95a95f685ea4ee045e43c67b1a5c70e908e357b0b41d522699255663ce

3 years agoIn the json1 extension, which compiling it separately, ensure that either
drh [Mon, 20 Dec 2021 23:46:44 +0000 (23:46 +0000)] 
In the json1 extension, which compiling it separately, ensure that either
SQLITE_DEBUG macro or the NDEBUG macro is set prior to including assert.h.
If neither macro is defined, then assert() statement do generate code but
VVA() statements do not, and that is a deadly combination.
[forum:/forumpost/858dee399e|forum post 858dee399e]

FossilOrigin-Name: d9f814a6402ca7fd999bbb847dc354b52ab9b97cae0c932344584d26c9430f24

3 years agoRemove old script ext/fts3/mkfts3amal.tcl, as it doesn't work.
dan [Mon, 20 Dec 2021 17:00:42 +0000 (17:00 +0000)] 
Remove old script ext/fts3/mkfts3amal.tcl, as it doesn't work.

FossilOrigin-Name: 9e33ee24b3793b3d7faf7421279d16217f8b09b1e92bfdc771f902f2f1e1b7d6

3 years agoImproved documentation for the sqlite3_vtab_collation() interface.
drh [Fri, 17 Dec 2021 23:56:43 +0000 (23:56 +0000)] 
Improved documentation for the sqlite3_vtab_collation() interface.

FossilOrigin-Name: 826f84a92d3b1f760560bff72c911a2c664737820af0c9114eb3494df7b8e878

3 years agoFix windowC tests to specify little-endian or big-endian UTF16, for
drh [Thu, 16 Dec 2021 19:50:02 +0000 (19:50 +0000)] 
Fix windowC tests to specify little-endian or big-endian UTF16, for
cross-platform portability.
[forum post 559b84a5c6|forum:/forumpost/559b84a5c6]

FossilOrigin-Name: adf3a1e6f7575964e467f6813ff980e802cf5a37aaa9e1736af702c493f276b1

3 years agoGive the correct prefix to tests in the windowC.test module.
drh [Thu, 16 Dec 2021 19:43:16 +0000 (19:43 +0000)] 
Give the correct prefix to tests in the windowC.test module.

FossilOrigin-Name: fb43456324c26879767b08febf1b5a2b46a289f25398a3872f81d845afd5d84e

3 years agoIn the CLI, omit the ".oom" command (only available in debug builds) and
drh [Thu, 16 Dec 2021 17:57:21 +0000 (17:57 +0000)] 
In the CLI, omit the ".oom" command (only available in debug builds) and
disable the experimental ".expert" commmand in --safe mode.

FossilOrigin-Name: 5cda1f7da885afdfda8683c59e78fec8da1a05c7a4fde573e89db5f872fcfb20

3 years agoNew defenses against OOM and corrupt database problems in the CLI.
drh [Thu, 16 Dec 2021 17:35:27 +0000 (17:35 +0000)] 
New defenses against OOM and corrupt database problems in the CLI.

FossilOrigin-Name: 5c9fd7fde16d8e335488b8bf5c691961d2636201b034d1f29d25de8708de291d

3 years agoFix a typo in the result of one of the new test cases.
drh [Thu, 16 Dec 2021 17:21:34 +0000 (17:21 +0000)] 
Fix a typo in the result of one of the new test cases.

FossilOrigin-Name: 4d02a129c4781c97981748f3c69564e1320d8085dfba4c207e54793390cd64ab

3 years agoFix fts3 and fts4 so that they can still be used even if the other is dropped by...
dan [Thu, 16 Dec 2021 15:29:49 +0000 (15:29 +0000)] 
Fix fts3 and fts4 so that they can still be used even if the other is dropped by a call to sqlite3_drop_modules().

FossilOrigin-Name: a0a8d6c9f0e91996003626e4f80dfac278e3c5bddd9ace5d442061e6c95e49dc

3 years agoFix a memory leak in the CLI that occurs after an error in the ".open" command.
drh [Thu, 16 Dec 2021 14:59:25 +0000 (14:59 +0000)] 
Fix a memory leak in the CLI that occurs after an error in the ".open" command.

FossilOrigin-Name: d156123885abe6bf23c3530de99be257f82ef85b89fbe019568ac60fa1ed5bb7

3 years agoFix harmless compiler warning in the new Bloom filter logic.
drh [Thu, 16 Dec 2021 14:36:36 +0000 (14:36 +0000)] 
Fix harmless compiler warning in the new Bloom filter logic.

FossilOrigin-Name: 9406d95d3fbaf0d8e65623adb790845f78a7456fb32aafd7fa4f74eda2f2dacc

3 years agoImproved robustness against OOM in the expert extension.
drh [Thu, 16 Dec 2021 14:26:16 +0000 (14:26 +0000)] 
Improved robustness against OOM in the expert extension.

FossilOrigin-Name: e732c429bafeffaf7e0f458213089c073c262a39eabb41b291e5006078ca7f98

3 years agoFix a potential NULL pointer dereference in the CLI logic for printing the
drh [Thu, 16 Dec 2021 13:56:04 +0000 (13:56 +0000)] 
Fix a potential NULL pointer dereference in the CLI logic for printing the
schema of virtual tables.

FossilOrigin-Name: fe44ebf6be47e1c7f2458297669dbd2b882a31595ea8759f7e8bb024ffc44d11

3 years agoAdd more tests for OOM conditions in the CLI.
drh [Thu, 16 Dec 2021 13:29:28 +0000 (13:29 +0000)] 
Add more tests for OOM conditions in the CLI.

FossilOrigin-Name: b6fa402d159b2475a7b99ef6a5180d7bf800f90afe28cea726d346d071405045

3 years agoSimplify the generation of the sqlite3_index_info object during query planning
drh [Wed, 15 Dec 2021 20:48:15 +0000 (20:48 +0000)] 
Simplify the generation of the sqlite3_index_info object during query planning
for virtual tables.

FossilOrigin-Name: 241dc0428a6e0238c57e2449e98ea60047e777e29c83a4ebe6da16f7cba40e19

3 years agoEnhance the virtual table query planner so that it is able to deal with
drh [Tue, 14 Dec 2021 20:13:28 +0000 (20:13 +0000)] 
Enhance the virtual table query planner so that it is able to deal with
ORDER BY terms that contain COLLATE clauses as long as the specified
collation matches the virtual table.  This is especially important for
UNION ALL since a "COLLATE binary" is added to ORDER BY clauses if no
COLLATE clause exists in the original SQL.

FossilOrigin-Name: 5c3d398d20b86a1558720e995eddf11403aec2d160590571fa9525fe8f6efff9

3 years agoMinor fix to the ORDER BY elimination logic in generate_series().
drh [Tue, 14 Dec 2021 18:11:46 +0000 (18:11 +0000)] 
Minor fix to the ORDER BY elimination logic in generate_series().

FossilOrigin-Name: a2e50712fca9dff1b8d19631f792270c82da3c8696a5d9890cf0d1e13e950d60

3 years agoOmit the return value from sqlite3VdbeSerialGet() for a size reduction
drh [Tue, 14 Dec 2021 00:36:09 +0000 (00:36 +0000)] 
Omit the return value from sqlite3VdbeSerialGet() for a size reduction
and performance improvement.

FossilOrigin-Name: 788e79f881d443fc1b3a213a7ba4f19bfd245e96c15bb21fcb6bffd92c4320b8

3 years agoSmall performance optimization and code size reduction in moveToRoot().
drh [Mon, 13 Dec 2021 19:59:55 +0000 (19:59 +0000)] 
Small performance optimization and code size reduction in moveToRoot().

FossilOrigin-Name: cdcde00b2d68eeb35c472fdfd4c4508551f6722054394b43cc97eaf01ad7181d

3 years agoAdd NEVER() on an unreachable branch in the Bloom filter pull-down logic.
drh [Mon, 13 Dec 2021 18:53:10 +0000 (18:53 +0000)] 
Add NEVER() on an unreachable branch in the Bloom filter pull-down logic.

FossilOrigin-Name: 471070462593faba865d8d05ee89161b340145351e2fa0bfbaa766d974e932d6

3 years agoFix an off-by-one error in the Bloom filter pulldown logic, found by OSSFuzz.
drh [Mon, 13 Dec 2021 18:43:46 +0000 (18:43 +0000)] 
Fix an off-by-one error in the Bloom filter pulldown logic, found by OSSFuzz.
Also fix over-length source code lines in the immediate vicinity.

FossilOrigin-Name: 027626521c02be06ef61e8229bde49d20cb3f1cb600c4cb127c5f139b9de8858

3 years agoRemove unused code.
drh [Mon, 13 Dec 2021 00:02:59 +0000 (00:02 +0000)] 
Remove unused code.

FossilOrigin-Name: b98b24f26518fb362e776bbaef80910bed66b654239e7c76d4b234033ef4174b

3 years agoDo not allow early evaluation of Bloom filters that use the IN operator as
drh [Sat, 11 Dec 2021 17:10:58 +0000 (17:10 +0000)] 
Do not allow early evaluation of Bloom filters that use the IN operator as
the machinery to deal with the IN operator is not available.
dbsqlfuzz 5b51c247518278f79a45cea978702e86e86cd4f9.

FossilOrigin-Name: 799db7cb2e0d73031182d26a0e5919368f9f9823df81cb2863bfe79eca344f5c

3 years agoFactor out the logic that does quoting for the SQL quote() function, so that
drh [Fri, 10 Dec 2021 21:01:24 +0000 (21:01 +0000)] 
Factor out the logic that does quoting for the SQL quote() function, so that
it might be reused for other purposes.

FossilOrigin-Name: 8e98ba1eeb1a5a61b7cb2de337ef8bca3d07494266a50d62b9c6bc60ad0a955f

3 years agoRename the internal routine constructBloomFilter() to
drh [Fri, 10 Dec 2021 17:36:16 +0000 (17:36 +0000)] 
Rename the internal routine constructBloomFilter() to
sqlite3ConstructBloomFilter(). OSSFuzz is reporting a crash with a garbled
stack that we cannot reproduce. Perhaps the original "constructBloomFilter()"
name is colliding with some internal name used by OSSFuzz. We'll see if this
rename clears the problem.

FossilOrigin-Name: 403e7312dd9a3fe493a21aceb82e387d6f152622d66c1b403c881597713e8cc3

3 years agoAdd support for Bloom-filters as a performance optimization for joins.
drh [Thu, 9 Dec 2021 20:06:18 +0000 (20:06 +0000)] 
Add support for Bloom-filters as a performance optimization for joins.

FossilOrigin-Name: 633bfeeea2bccdd44126acf3f61ecca163c9d933bdc787a2c18a697dc9406882

3 years agoRemove unused code and fix comments. Final cleanup before merging. bloom-filter
drh [Thu, 9 Dec 2021 19:42:52 +0000 (19:42 +0000)] 
Remove unused code and fix comments.  Final cleanup before merging.

FossilOrigin-Name: ce42039f5647b1f276acf5d9911528ecb47df1544a587def72c8cd6b2f664289

3 years agoEnable bloom filters for the right table of a LEFT JOIN. Fix unreachable
drh [Thu, 9 Dec 2021 18:44:03 +0000 (18:44 +0000)] 
Enable bloom filters for the right table of a LEFT JOIN.  Fix unreachable
branches.

FossilOrigin-Name: d342ab722de1fc3f34219c9755253db9d88eb50a6fa5cc257207008b00e7fc03

3 years agoAdd ".mode off" and ".mode count" to the CLI.
drh [Thu, 9 Dec 2021 16:26:45 +0000 (16:26 +0000)] 
Add ".mode off" and ".mode count" to the CLI.

FossilOrigin-Name: 1eefd957ff35e961685db565f7ef116c566a04574c5bedad7298b3cc69dd72d2

3 years agoAdd ".mode off" and ".mode count" to the CLI.
drh [Thu, 9 Dec 2021 16:17:43 +0000 (16:17 +0000)] 
Add ".mode off" and ".mode count" to the CLI.

FossilOrigin-Name: b11f4d080aa9e6f694e2ec401e871f42bf25997e8e8bf77fa9b6014a50466e3c

3 years agoNew test cases added to test/fuzzdata8.db
drh [Thu, 9 Dec 2021 14:15:39 +0000 (14:15 +0000)] 
New test cases added to test/fuzzdata8.db

FossilOrigin-Name: 7046877006259a0073cca4ddb4541321d373c462eac9924be26b5ae224075732

3 years agoDo not attempt to reprepare a prepared statement that returns SQLITE_SCHEMA
drh [Thu, 9 Dec 2021 14:09:47 +0000 (14:09 +0000)] 
Do not attempt to reprepare a prepared statement that returns SQLITE_SCHEMA
if there was an OOM.  This enhancement supercedes check-in
[fee469925231d074].

FossilOrigin-Name: 94fdbeffaf501daf30dc7fae7cef5c2bfdb3a9b055562adfc04374a9fc899c8d

3 years agoAdd SQLITE_TESTCTRL_LOGEST and enhance the LogEst utility program.
drh [Thu, 9 Dec 2021 01:28:15 +0000 (01:28 +0000)] 
Add SQLITE_TESTCTRL_LOGEST and enhance the LogEst utility program.
Improvements to testability of bloom filters.

FossilOrigin-Name: 88b43d798cc5aa59855e92d3e658aee9f0a5def6ffbc5db77af048d75ecdf8cc