]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
6 years agoEnhancements to the printf() logic in order to render a negative zero with negative-zero
drh [Wed, 12 Jun 2019 20:11:34 +0000 (20:11 +0000)] 
Enhancements to the printf() logic in order to render a negative zero with
a minus sign.

FossilOrigin-Name: 6ba4be66be90799ab0e1edc08c5c09bea239a85027ad0ca1f42818fc2580af4d

6 years agoHandle expressions like "expr IS TRUE COLLATE xyz" in the same way as "expr IS TRUE...
dan [Wed, 12 Jun 2019 13:49:32 +0000 (13:49 +0000)] 
Handle expressions like "expr IS TRUE COLLATE xyz" in the same way as "expr IS TRUE". Fix for [4d01eda8115b10d1].

FossilOrigin-Name: 5c6146b56a75a94f4baa10e95407c54dd0b9314a57a8702a4b96b15c4d7ac48c

6 years agoThe affinity of the unlikely() function and its cousins should be "none".
drh [Tue, 11 Jun 2019 21:02:15 +0000 (21:02 +0000)] 
The affinity of the unlikely() function and its cousins should be "none".
Ticket [0c620df60bffd9ef]

FossilOrigin-Name: 614ecb0af47038848e8ba2aed6b92db6f33ddc4aea6361795dbde440380f5a35

6 years agoMake sure the affinity of the RHS of an IN operator does not affect the
drh [Tue, 11 Jun 2019 18:07:53 +0000 (18:07 +0000)] 
Make sure the affinity of the RHS of an IN operator does not affect the
outcome even if the RHS expression contains a COLLATE clause.
Ticket [57353f8243c637c0]

FossilOrigin-Name: 0f748fe58bbbb7ce3f30303da25ec811b2bbce249549aa9c7927979ac5b38013

6 years agoMark an unreachable branch with an ALWAYS macro.
drh [Tue, 11 Jun 2019 16:43:58 +0000 (16:43 +0000)] 
Mark an unreachable branch with an ALWAYS macro.

FossilOrigin-Name: d4755aca4b435eed62b54af84013f7f176d3fa5b7b1c243555d59de5749fcde5

6 years agoNew test case in fuzzdata8.db.
drh [Tue, 11 Jun 2019 16:07:39 +0000 (16:07 +0000)] 
New test case in fuzzdata8.db.

FossilOrigin-Name: e96641f0be7d4454215459b0a95cf1c46ba0133e46d0bae22269741c8f4e5b44

6 years agoOff-by-one error in the CAST to NUMERIC logic.
drh [Tue, 11 Jun 2019 16:06:05 +0000 (16:06 +0000)] 
Off-by-one error in the CAST to NUMERIC logic.

FossilOrigin-Name: 25b89630206fdbb41c756e98f99baa711d35a8c226697a92339d0fe7e8b3652a

6 years agoHave the ALTER TABLE code handle the case where an entire expression that includes...
dan [Tue, 11 Jun 2019 12:03:10 +0000 (12:03 +0000)] 
Have the ALTER TABLE code handle the case where an entire expression that includes a sub-select is excluded from a view, trigger or index.

FossilOrigin-Name: f2c8179f3c0b77f10da3f9b0771db4dec30d0bbf0b7f4751ce439bfb08da8f6f

6 years agoAdd the new sqlite3ExprUnmapAndDelete() function and use it in place of
drh [Tue, 11 Jun 2019 10:43:56 +0000 (10:43 +0000)] 
Add the new sqlite3ExprUnmapAndDelete() function and use it in place of
separate calls to sqlite3RenameExprUnmap() and sqlite3ExprDelete().

FossilOrigin-Name: 36ea13e0a851a749c9ef292377ecd82dbd4797d38df907b362487fa234c98ca5

6 years agoThe ALTER TABLE command should not attempt to rename objects that are
drh [Tue, 11 Jun 2019 02:43:22 +0000 (02:43 +0000)] 
The ALTER TABLE command should not attempt to rename objects that are
contained within an expression tree that has been optimized out because
it is the other branch of an "AND false" expression.
Ticket [533010b8cacebe82]

FossilOrigin-Name: 04bd5cb73287f926f1ecf578998fa6ce1379474e86918c692eae5778d0817cef

6 years agoFix repeated test numbers in the altertab2.test file.
drh [Tue, 11 Jun 2019 01:56:42 +0000 (01:56 +0000)] 
Fix repeated test numbers in the altertab2.test file.

FossilOrigin-Name: e82f235e7201a420149847cda630ac6f2fce5e3a4577b0ea4793f430d3dc1611

6 years agoRemove a comment made obsolete by check-in [71643deb6bbad4b4]. No changes
drh [Tue, 11 Jun 2019 01:30:39 +0000 (01:30 +0000)] 
Remove a comment made obsolete by check-in [71643deb6bbad4b4].  No changes
to code.

FossilOrigin-Name: 211c8002d5ea4b224125d4ed395fe15767d1dc32a77b40b89fdfc80bdd1c5a48

6 years agoA string consisting of a single '.' is not a floating point literal with extra
drh [Mon, 10 Jun 2019 23:45:10 +0000 (23:45 +0000)] 
A string consisting of a single '.' is not a floating point literal with extra
text at the end.  Fix for ticket [412bba9b22c677da]

FossilOrigin-Name: 57050162294efec90caa5cc3c2f8c1a85215526adcf57b284ce2d2e799286b78

6 years agoHave ALTER TABLE commands ignore the lhs of "expr IN ()" and "expr NOT IN ()" express...
dan [Mon, 10 Jun 2019 19:17:37 +0000 (19:17 +0000)] 
Have ALTER TABLE commands ignore the lhs of "expr IN ()" and "expr NOT IN ()" expressions, just as other queries do. Fix for [533010b8ca].

FossilOrigin-Name: 71643deb6bbad4b4a511bfd43b32245b50a555b508b90f33adf0656ae53292c6

6 years agoImprovements to the documentation for the xAccess method of the VFS.
drh [Mon, 10 Jun 2019 19:07:15 +0000 (19:07 +0000)] 
Improvements to the documentation for the xAccess method of the VFS.
Ticket [5e0423b058fa5adf]

FossilOrigin-Name: 7078d77effc296c63c91ec032c866e2b320f081d58e57e9e83cc58373169bda3

6 years agoMake sure a CAST to "NUMERIC" results in an integer if the value can be
drh [Mon, 10 Jun 2019 18:33:16 +0000 (18:33 +0000)] 
Make sure a CAST to "NUMERIC" results in an integer if the value can be
losslessly expressed as an integer, as the documentation requires.
Ticket [dd6bffbfb6e61db9].

FossilOrigin-Name: c0c90961b4fa1c1185772d04fe1915bc1a1af27ed8ddb8db1c524bf90d68ccbf

6 years agoHandle renaming a column or table when the schema contains a (meaningless) index...
dan [Mon, 10 Jun 2019 15:34:16 +0000 (15:34 +0000)] 
Handle renaming a column or table when the schema contains a (meaningless) index on the constant expression ('text' IN ()) or ('text' NOT IN()).

FossilOrigin-Name: 567b13093956185b5d5e971b81ba4788fd9d26c03688f643b380f0f1c1a94da0

6 years agoDo not attempt the LIKE optimization on a column with numeric affinity if the rhs...
dan [Mon, 10 Jun 2019 13:46:42 +0000 (13:46 +0000)] 
Do not attempt the LIKE optimization on a column with numeric affinity if the rhs of the operator begins with whitespace. Fix for ticket [fd76310a5e].

FossilOrigin-Name: 94b58ab059cba9771e75f16d1460f313104a8fb879f9f8805725d362aa58cbcd

6 years agoRemove code in the round() SQL function that became unreachable due to
drh [Fri, 7 Jun 2019 22:51:13 +0000 (22:51 +0000)] 
Remove code in the round() SQL function that became unreachable due to
the optimization of check-in [e95138f5f4febde5]

FossilOrigin-Name: b141bae3f6d16c0ebb59dac9b02086a4370839e71ade34004f647b09b1083d1d

6 years agoWhen casting string values into numeric and the string has a prefix that looks
drh [Fri, 7 Jun 2019 22:26:08 +0000 (22:26 +0000)] 
When casting string values into numeric and the string has a prefix that looks
like a number but total string is not a well-formed number, then take extra
care that the result is either integer or real depending on what the prefix
looks like.  Fix for tickets [e8bedb2a184001] and [4c2d7639f076aa].

FossilOrigin-Name: 67a68af5578f08d2be2e48cf4fd12a6cf35a09c47d259deda81950f7ee1f02f7

6 years agoAlso upgrade script config.sub to the latest version. This should have been part...
dan [Fri, 7 Jun 2019 18:56:03 +0000 (18:56 +0000)] 
Also upgrade script config.sub to the latest version. This should have been part of the previous commit.

FossilOrigin-Name: efbf31b82e6e16fda88d8cea54202a8593ff52f2267a44dba828704818162e66

6 years agoUpgrade the config.guess script to the latest version.
dan [Fri, 7 Jun 2019 18:53:51 +0000 (18:53 +0000)] 
Upgrade the config.guess script to the latest version.

FossilOrigin-Name: be8438133f6cd87e5d51f15cfd1eed83176b3239334875eb0c3dec502cfe39d3

6 years agoCLI enhancements: Add the ".filectrl" command. Make the ".testctrl" command
drh [Wed, 5 Jun 2019 14:29:53 +0000 (14:29 +0000)] 
CLI enhancements:  Add the ".filectrl" command.  Make the ".testctrl" command
visible to ".help".

FossilOrigin-Name: 7b3a99fce8b4a757f2b2ef2f0b02d68566f2528d9ae1e30628522717f872466c

6 years agoAdd a test case for the unix SQLITE_FCNTL_CHUNK_SIZE file-control.
dan [Wed, 5 Jun 2019 13:14:19 +0000 (13:14 +0000)] 
Add a test case for the unix SQLITE_FCNTL_CHUNK_SIZE file-control.

FossilOrigin-Name: 3a477fd0c944440be03d23c667053b346c769c6a4f6ba1ef094b7581a08d7bd4

6 years agoIn the CLI, add a small delay (0.1 seconds) after launching the output
drh [Tue, 4 Jun 2019 18:21:59 +0000 (18:21 +0000)] 
In the CLI, add a small delay (0.1 seconds) after launching the output
command for ".once" before deleting the temporary file.

FossilOrigin-Name: 4979f138e8c8bef7dd6b5921fb9ca9fea86bbf7ec1419934bb2d1a0d74e77183

6 years agoNew dbsqlfuzz test cases add to test/fuzzdata8.db.
drh [Tue, 4 Jun 2019 15:47:37 +0000 (15:47 +0000)] 
New dbsqlfuzz test cases add to test/fuzzdata8.db.

FossilOrigin-Name: 873aa46da3d0f97784cad94828fc367bb2ceb13d5ece2e105320f404b3971c85

6 years agoFix a segfault in fts3 that could occur when processing corrupt fts records.
dan [Tue, 4 Jun 2019 13:11:37 +0000 (13:11 +0000)] 
Fix a segfault in fts3 that could occur when processing corrupt fts records.

FossilOrigin-Name: dff24c6c7a4e7623984b5bb24c2ff14fe079dc49a0ad048cbfc66f84c08875b0

6 years agoFix harmless compiler warning in lemon.
mistachkin [Mon, 3 Jun 2019 15:09:25 +0000 (15:09 +0000)] 
Fix harmless compiler warning in lemon.

FossilOrigin-Name: 2da0eea02d128c37f2fbe764227ac526d3e993284516544adc0a216a035c5676

6 years agoOptimization to the round() SQL function for large input values without a
drh [Thu, 30 May 2019 13:47:10 +0000 (13:47 +0000)] 
Optimization to the round() SQL function for large input values without a
fractional part.

FossilOrigin-Name: e95138f5f4febde598f39e031d6e4f4d5ad0adbd8dcdd34fd0baaa78ab393417

6 years agoSmaller and faster sqlite3IsNaN() implementation makes deserialization of
drh [Thu, 30 May 2019 00:46:37 +0000 (00:46 +0000)] 
Smaller and faster sqlite3IsNaN() implementation makes deserialization of
floating point values much faster.

FossilOrigin-Name: ea748edecb261f2b862d542daff6e99a6fd8879a8ace94b440d99e110577d1c1

6 years agoMuch faster implementation of applyNumericAffinity() by avoiding some
drh [Wed, 29 May 2019 21:18:27 +0000 (21:18 +0000)] 
Much faster implementation of applyNumericAffinity() by avoiding some
unnecessary calls to sqlite3Atoi64().

FossilOrigin-Name: c1d8a3f65490eef2216f360d708b1746cbaa6dadce42c0950dc8e09b9ab28ee2

6 years agoAdd an assert() as an additional test for fix in check-in [523b42371122d9e1b3].
drh [Wed, 29 May 2019 18:33:59 +0000 (18:33 +0000)] 
Add an assert() as an additional test for fix in check-in [523b42371122d9e1b3].

FossilOrigin-Name: f9e85e6c79162081f8f512d22951931a89d157a32b24afdc48b7eb865379abe7

6 years agoFix the query flattener optimization so that it preserve the "SF_Compound"
drh [Wed, 29 May 2019 17:22:38 +0000 (17:22 +0000)] 
Fix the query flattener optimization so that it preserve the "SF_Compound"
bit when flattening a compound subquery into a non-compound outer query.
Failure to preserve that bit could allow subsequent flattenings which are
not valid. Fix for ticket [c41afac34f15781fe09cd].

FossilOrigin-Name: 523b42371122d9e1b3185425745f1490138bff7f7cc941ee26ee81df7ade5bf4

6 years agoFix an assert() in fts3 that could fail when processing corrupt records. Also some...
dan [Tue, 28 May 2019 14:42:32 +0000 (14:42 +0000)] 
Fix an assert() in fts3 that could fail when processing corrupt records. Also some minor sanitizer warnings.

FossilOrigin-Name: c736c40aab071a69bd5c5347b7c116d87ea3954019e967ca8ff7bdb4b518e5bf

6 years agoFix an error message on the blobread() extension function so that it says
drh [Mon, 27 May 2019 11:21:43 +0000 (11:21 +0000)] 
Fix an error message on the blobread() extension function so that it says
"read" instead of "write".

FossilOrigin-Name: 7cbb9a5fe835d01be158edd1e2f9d553dc257f2d27b53a5d5bf6660d0bd101c4

6 years agoFix a memory leak in the delta_parse() table-valued function of the
drh [Mon, 27 May 2019 11:09:55 +0000 (11:09 +0000)] 
Fix a memory leak in the delta_parse() table-valued function of the
fossildelta.c extension.

FossilOrigin-Name: c86ca3f0220a5f9e7f7f1818f6e1220d851f3ebed6a5f0aae6ac38309bd2930e

6 years agoImproved rounding even on systems with an 8-byte "long double" type.
drh [Mon, 27 May 2019 00:29:15 +0000 (00:29 +0000)] 
Improved rounding even on systems with an 8-byte "long double" type.

FossilOrigin-Name: 15202aee150fa8e15fb90e90e5765c5e19a1eaf4896da2996a747636b76da8e6

6 years agoPerformance enhancement in sqlite3AtoF(). About 8% faster.
drh [Sat, 25 May 2019 18:17:53 +0000 (18:17 +0000)] 
Performance enhancement in sqlite3AtoF().  About 8% faster.

FossilOrigin-Name: 81721aa54587e20d031d528fb6b74d91671a6e950fa926dc63f4284466e70f0e

6 years agoUse "long double" literals to initialize an array of "long double" objects.
drh [Sat, 25 May 2019 17:41:07 +0000 (17:41 +0000)] 
Use "long double" literals to initialize an array of "long double" objects.

FossilOrigin-Name: 2e2ebad3ab636c4c65814ad41d417b105be8e254d609d0e08fbba4c5bd107bf3

6 years agoAdd new cases to speedtest1 for measuring performance of binary to/from decimal
drh [Sat, 25 May 2019 13:14:19 +0000 (13:14 +0000)] 
Add new cases to speedtest1 for measuring performance of binary to/from decimal
conversions of floating point values.

FossilOrigin-Name: b84e7057c05338347b4267f7ccc1d7b9b6d4e9a941ce8b76bf2c27c26772000c

6 years agoDisable the new rounding tests on systems without long double support.
drh [Sat, 25 May 2019 00:17:26 +0000 (00:17 +0000)] 
Disable the new rounding tests on systems without long double support.

FossilOrigin-Name: ed250b4e18ea042d681bbe8d7ed00895564f4525c22928a003a84585b4756ec3

6 years agoImprovements to rounding behavior in the round() and printf() functions.
drh [Fri, 24 May 2019 22:58:16 +0000 (22:58 +0000)] 
Improvements to rounding behavior in the round() and printf() functions.

FossilOrigin-Name: 641b2d210541b4d5a1a9e57d7dcf5ce5dfd7ff4d2dc6277ba0582869f48fc946

6 years agoFix an fts5 segfault that could occur after parsing a corrupt structure record.
dan [Fri, 24 May 2019 11:55:01 +0000 (11:55 +0000)] 
Fix an fts5 segfault that could occur after parsing a corrupt structure record.

FossilOrigin-Name: 600daa9c27206628bf74892376ded35dac11fe0a34894fcd975ad5041a0a0fda

6 years agoAdd test cases for the fix in the previous commit.
dan [Thu, 23 May 2019 16:40:45 +0000 (16:40 +0000)] 
Add test cases for the fix in the previous commit.

FossilOrigin-Name: c1057b2a60add08e5c80ef2a53932a690b096f2eb03c7de863844deaa8fc9d53

6 years agoImprovements to the view-self-join optimization so that it works on all
drh [Thu, 23 May 2019 16:38:12 +0000 (16:38 +0000)] 
Improvements to the view-self-join optimization so that it works on all
VIEWs, not just on Common Table Expressions.

FossilOrigin-Name: d2fe370cafa9b11f6c3eb4e1c3be48d9d2610b9d2f9d9ebf9e50267f9079dfc0

6 years agoNew test case for check-in [74ef97bf51dd531a] that takes the fix in the
drh [Wed, 22 May 2019 23:12:10 +0000 (23:12 +0000)] 
New test case for check-in [74ef97bf51dd531a] that takes the fix in the
previous check-in into account.

FossilOrigin-Name: cb1d06521de5918a2324a41e207b48c5e5149c23b927b9e3e1f3c3b38b82658e

6 years agoRenumber the Select.selId values in the copies of SELECT statements that
drh [Wed, 22 May 2019 22:49:23 +0000 (22:49 +0000)] 
Renumber the Select.selId values in the copies of SELECT statements that
implement VIEWs when the VIEW is expanded, so that when the same VIEW is
used twice in the same join, each expansion as a distinct selId.
This fixes ticket [ce823231949d3abf42453c8].

FossilOrigin-Name: 3cacc4b940fd69776d930deec9512df47a2f22cb04fb955e354a0b25bdec287c

6 years agoNew dbsqlfuzz find added to test/fuzzdata8.db.
drh [Wed, 22 May 2019 14:35:10 +0000 (14:35 +0000)] 
New dbsqlfuzz find added to test/fuzzdata8.db.

FossilOrigin-Name: 42af7c819bc52ccb6953a58b1c05d3bd47cc438c5119a9555b1b796764eb9f20

6 years agoFix a buffer overread that could in fts3 when dealing with corrupt records.
dan [Wed, 22 May 2019 14:22:44 +0000 (14:22 +0000)] 
Fix a buffer overread that could in fts3 when dealing with corrupt records.

FossilOrigin-Name: 1660d7733eb443ab085ddef7666b998a1c75ac81cc54a9620960a8d3b377e28e

6 years agoCombine the implementations of the key and hexkey pragmas into a single
drh [Tue, 21 May 2019 17:04:27 +0000 (17:04 +0000)] 
Combine the implementations of the key and hexkey pragmas into a single
case.  Have both pragmas return "ok" if they are implemented.

FossilOrigin-Name: b3692c406f7ba62587c9d3256f888748393519680e9e2db53f59557f1a300e05

6 years agoFix a problem in [b5ca442a] causing an assert() to fail in REINDEX commands.
dan [Tue, 21 May 2019 16:32:41 +0000 (16:32 +0000)] 
Fix a problem in [b5ca442a] causing an assert() to fail in REINDEX commands.

FossilOrigin-Name: a3e77c7776ab01dadb9d30d6067ac97e9d4b09ec54834558a5fa1ffed7b52c72

6 years agoUse a statement journal for all CREATE INDEX statements in case an indexed exprsesion...
dan [Tue, 21 May 2019 14:42:24 +0000 (14:42 +0000)] 
Use a statement journal for all CREATE INDEX statements in case an indexed exprsesion throws an exception when it is evaluated. Fix for [b5ca442a].

FossilOrigin-Name: b8071d10cba8f6c19fb8d5df3877f72567dc6d6a94744a39cbc1f58b2e2f343b

6 years agoFix a segfault that could occur in sqlite3session_diff() if NULL were passed as the...
dan [Mon, 20 May 2019 19:46:30 +0000 (19:46 +0000)] 
Fix a segfault that could occur in sqlite3session_diff() if NULL were passed as the pzErrMsg argument.

FossilOrigin-Name: aee73fd28f031a2568ac723de0826be7f1dca6be3b049e4a04fb47af75dcf4bf

6 years agoImprovements to the automatic compile-time selection of byte-order, as
drh [Mon, 20 May 2019 18:43:57 +0000 (18:43 +0000)] 
Improvements to the automatic compile-time selection of byte-order, as
suggested on the mailing list by Seb Kemper.

FossilOrigin-Name: b7aad929619f7043b1685a6477d50f6b4436e85511eb365eceae3dd4dbab571a

6 years agoA minor variation on check-in [1685610ef8e0dc] which (hopefully) makes the
drh [Mon, 20 May 2019 18:35:49 +0000 (18:35 +0000)] 
A minor variation on check-in [1685610ef8e0dc] which (hopefully) makes the
logic a little easier to follow.  Also disallows the use of the double-quoted
string hack in the query expression used for VACUUM INTO, which is not
strictly required, but moves us toward the goal of disallowing the double-quoted
string hack everywhere.

FossilOrigin-Name: 3e1b55f3ab85710ed81574904718205c7370b5f0b5a41029e961486d2e3f37c7

6 years agoDisallow string constants enclosed in double-quotes within new CREATE TABLE and CREAT...
dan [Mon, 20 May 2019 17:14:25 +0000 (17:14 +0000)] 
Disallow string constants enclosed in double-quotes within new CREATE TABLE and CREATE INDEX statements. It is still possible to enclose column names in double-quotes, and existing database schemas that use double-quotes for strings can still be loaded. This addresses ticket [9b78184b].

FossilOrigin-Name: 1685610ef8e0dc9218b02461ceab14dc6114f4f5ef7fcda0da395094aff443e1

6 years agoUpdate the sqlite3ExprCompare() routine so that it does not think "? IS NOT TRUE...
dan [Mon, 20 May 2019 10:36:15 +0000 (10:36 +0000)] 
Update the sqlite3ExprCompare() routine so that it does not think "? IS NOT TRUE" is the same as "? IS TRUE". Fix for [d3e7f2ba5b3].

FossilOrigin-Name: 99eba69b3a64741c69d167bf7a05dbe138c9e7faecc54a1b8d8220cb23902830

6 years agoFix an assert() failure that could occur in a join query if the RHS of an IN() operat...
dan [Sat, 18 May 2019 21:22:25 +0000 (21:22 +0000)] 
Fix an assert() failure that could occur in a join query if the RHS of an IN() operator is a list containing correlated expressions. This problem was introduced by checkin [e130319317e7611938] which was part of the fix for ticket [787fa716be3a7f650c] - so this commit is part of that ticket's fix too.

FossilOrigin-Name: 778b1224a318d0137c7dab8361128f593506d3677267898119b934b4d66dfe38

6 years agoAvoid including the comment in the output of "PRAGMA table_info" in situations where...
dan [Sat, 18 May 2019 19:49:08 +0000 (19:49 +0000)] 
Avoid including the comment in the output of "PRAGMA table_info" in situations where there is a comment following a DEFAULT value within a CREATE TABLE statement.

FossilOrigin-Name: d91095ba7130e974f0c95334760c679a31479b07a3d458e15994a24eee474752

6 years agoDisable PRAGMA journal_mode=OFF when SQLITE_DBCONFIG_DEFENSIVE is turned on.
drh [Fri, 17 May 2019 20:37:17 +0000 (20:37 +0000)] 
Disable PRAGMA journal_mode=OFF when SQLITE_DBCONFIG_DEFENSIVE is turned on.
Ticket [f4ec250930342e0c].

FossilOrigin-Name: a0f5eb5c79cc33b7224f3421d2baa02a2a19eb9d6eaa8117dda4a1878b229cb5

6 years agoAlways store a REAL value in a column with REAL affinity if the integer equivalent...
dan [Fri, 17 May 2019 15:59:11 +0000 (15:59 +0000)] 
Always store a REAL value in a column with REAL affinity if the integer equivalent would require 8 bytes of storage. Fix for [3c27b97e3].

FossilOrigin-Name: 14c00b1016ba53ab2dc177c59a27b6b9209202973685f0f274112d296ba7dfcb

6 years agoAdd test cases to test/fuzzdata7.db for (harmless) dbfuzz2 finds.
drh [Thu, 16 May 2019 20:40:08 +0000 (20:40 +0000)] 
Add test cases to test/fuzzdata7.db for (harmless) dbfuzz2 finds.

FossilOrigin-Name: 1eb2a628e4bfae51fea43e8f40fedfe23f2118024d9cce35828c3cbe92a9b392

6 years agoInitialize the 18-byte overrun area on the buffer used to reconstruct
drh [Thu, 16 May 2019 20:36:07 +0000 (20:36 +0000)] 
Initialize the 18-byte overrun area on the buffer used to reconstruct
overflow btree cells during a btree search, to avoid a harmless
jump-depends-on-uninit-values warning.

FossilOrigin-Name: 4b05caeb1b9767ba58cb4261ecc22cdd495216b3258d45f2165cdbd3ea079495

6 years agoFix an assert() in the OP_Delete opcode that could fail with a corrupt database.
dan [Thu, 16 May 2019 20:13:32 +0000 (20:13 +0000)] 
Fix an assert() in the OP_Delete opcode that could fail with a corrupt database.

FossilOrigin-Name: 915388ab39ba3ca8681cd2613b91314aa965967f23a5bface90f54a3d6423300

6 years agoAdd new test file fts5corrupt4.test.
dan [Thu, 16 May 2019 16:44:47 +0000 (16:44 +0000)] 
Add new test file fts5corrupt4.test.

FossilOrigin-Name: 5dfc4fe98a4821cbdbfd7dfddf221b00251b2a26bf58767a3956b64e9a4e92da

6 years agoFix a harmless use-of-initialized-value fault in the assert() logic added
drh [Thu, 16 May 2019 11:47:16 +0000 (11:47 +0000)] 
Fix a harmless use-of-initialized-value fault in the assert() logic added
by check-in [d612fb7873cf59d]

FossilOrigin-Name: 3dac90728a6a1962da478afe751582ddf8b6d4666548a805564817b21e07a246

6 years agoFix harmless compiler warning in the session extension.
mistachkin [Thu, 16 May 2019 03:47:38 +0000 (03:47 +0000)] 
Fix harmless compiler warning in the session extension.

FossilOrigin-Name: dff823ca8b5ca4a5611407b0231f89b2e8c981f50e85e361e76d3e4973cea8ca

6 years agoMake sure the OP_Concat opcode always correctly zero-terminates a UTF16
drh [Thu, 16 May 2019 01:22:21 +0000 (01:22 +0000)] 
Make sure the OP_Concat opcode always correctly zero-terminates a UTF16
string, even if the input strings are ill-formed.  This is a followup to
check-in [3a16ddf91f0c9c516a7] that fixes a case the previous check-in missed.
Also add assert()s to prove correct zero termination.

FossilOrigin-Name: d612fb7873cf59dfda18cabe45f674c37aa78a4587de3378b1840c99465a0269

6 years agoFix the count-of-view optimization so that it is (correctly) disabled for
drh [Wed, 15 May 2019 18:42:15 +0000 (18:42 +0000)] 
Fix the count-of-view optimization so that it is (correctly) disabled for
a query that includes a WHERE clause or a GROUP BY clause.

FossilOrigin-Name: 05897ca48a40c6771ff83ba8ecc3a5c60dafddf58651c222dd8cf89b9fc7b077

6 years agoSimplify the "Verifying Code Authenticity" section of the README.md file.
drh [Wed, 15 May 2019 10:16:34 +0000 (10:16 +0000)] 
Simplify the "Verifying Code Authenticity" section of the README.md file.
No code changes.

FossilOrigin-Name: adebffc18e6165672947a6bda5ca23ea7723cca7ab8da4feb81fca8f83e4fcaf

6 years agoFix a problem with the fix for [9cf6c9bb51] (commit [658b84d7]) that could cause...
dan [Tue, 14 May 2019 20:25:22 +0000 (20:25 +0000)] 
Fix a problem with the fix for [9cf6c9bb51] (commit [658b84d7]) that could cause a cursor to be left in an invalid state following a (rowid < text-value) search.

FossilOrigin-Name: bc7d2c1656396bb4f5f1f814e60dbf816cc91c5a521b54ad593cd3da0fe8dcb4

6 years agoNew test cases in test/fuzzdata8.db.
drh [Tue, 14 May 2019 19:20:52 +0000 (19:20 +0000)] 
New test cases in test/fuzzdata8.db.

FossilOrigin-Name: 228e1087c0602470e450586499de5a3e87e266c688bc828f20e3bad2fdc65ff1

6 years agoFix a problem with corrupt db handling in the fts5_vocab module.
dan [Tue, 14 May 2019 18:33:58 +0000 (18:33 +0000)] 
Fix a problem with corrupt db handling in the fts5_vocab module.

FossilOrigin-Name: 456ced57774a92acff23cad975b78ff0e5cbbf5204ea48599fe1761a018a92e4

6 years agoFix an assert() and potential buffer overrun in fts5 that could occur if the database...
dan [Tue, 14 May 2019 11:33:09 +0000 (11:33 +0000)] 
Fix an assert() and potential buffer overrun in fts5 that could occur if the database was corrupt.

FossilOrigin-Name: 8be8bd0d562e571b73a93f4ed18258ebd114bbab67ee3cdcd66a4c8f2987f8dc

6 years agoDisable index seek optimizations on REINDEX when the order of primary keys
drh [Tue, 14 May 2019 00:43:13 +0000 (00:43 +0000)] 
Disable index seek optimizations on REINDEX when the order of primary keys
in the index differs from the main table.
Fix for ticket [bba7b69f9849b5bf11b4].

FossilOrigin-Name: f7aadfab3bb8eb8eb2cd62dc8a6823538387b3329f1efc23ef75482488109478

6 years agoFix an assert() failure in fts5 that could occur when processing a corrupt database.
dan [Mon, 13 May 2019 11:52:19 +0000 (11:52 +0000)] 
Fix an assert() failure in fts5 that could occur when processing a corrupt database.

FossilOrigin-Name: f158c048be1dc7c80d38787a20495caa55b86416967efd57f4888548d42b4819

6 years agoA new implementation for the sqlite3ExprImpliesExpr() theorem prover that
drh [Sat, 11 May 2019 19:36:03 +0000 (19:36 +0000)] 
A new implementation for the sqlite3ExprImpliesExpr() theorem prover that
does a better job of answering TRUE to "(NOT A) OR B" when B is a NOT NULL
expression.

FossilOrigin-Name: b3413197f57711f04102d8cc6ff1e8ddbe0f5f2bcb6e1989cf314fa97f0ff7f1

6 years agoWhen considering partial indexes, do not assume that a "CASE x ..." expression implie...
dan [Sat, 11 May 2019 16:14:42 +0000 (16:14 +0000)] 
When considering partial indexes, do not assume that a "CASE x ..." expression implies "x IS NOT NULL".

FossilOrigin-Name: 1b24303220b7b4f59520176a0150fc619c668865450b4fdaa9ce4113a56e9687

6 years agoDo not assume that "x IS NOT ?" implies "x NOT NULL" when considering partial indexes...
dan [Sat, 11 May 2019 13:04:33 +0000 (13:04 +0000)] 
Do not assume that "x IS NOT ?" implies "x NOT NULL" when considering partial indexes. Fix for ticket [8025674847].

FossilOrigin-Name: 0ba6d709b50d92db1542f2ff30535a80184b00dadf759d51e5cae7a6e37b1764

6 years agoAdd tests for the RBU module.
dan [Fri, 10 May 2019 20:44:10 +0000 (20:44 +0000)] 
Add tests for the RBU module.

FossilOrigin-Name: a194e53670e25a48c2bb51b54755abff88ed6ae2596c5858fb4aac16cb452bdf

6 years agoFix harmless compiler warnings.
drh [Fri, 10 May 2019 17:54:58 +0000 (17:54 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 956ca2a452aa3707bca553007a7ef221af3d4f6b0af747d17070926e000f2362

6 years agoFix harmless compiler warnings in the CLI.
drh [Fri, 10 May 2019 17:50:33 +0000 (17:50 +0000)] 
Fix harmless compiler warnings in the CLI.

FossilOrigin-Name: 2846bc0429c0956473bfe99dde135f2c206720f0be4c2800118b280e446ce325

6 years agoFix some harmless compiler warnings. warnings
mistachkin [Fri, 10 May 2019 16:16:19 +0000 (16:16 +0000)] 
Fix some harmless compiler warnings.

FossilOrigin-Name: ca068d82387fc3cda9d2050cedb4f9c61b6d9dc54f89015b4b2ee492243ed5c9

6 years agoEnsure that the BtShared.nPage value is reset correctly on a SAVEPOINT
drh [Fri, 10 May 2019 14:34:18 +0000 (14:34 +0000)] 
Ensure that the BtShared.nPage value is reset correctly on a SAVEPOINT
ROLLBACK.

FossilOrigin-Name: e6d5fee8cdbdce8515957e8288e4d1e7b06f417fd3f9deeeb636fbf5b995af51

6 years agoTreat integer values in window definition ORDER BY clauses as constants, not as refer...
dan [Fri, 10 May 2019 14:26:32 +0000 (14:26 +0000)] 
Treat integer values in window definition ORDER BY clauses as constants, not as references to another expression.

FossilOrigin-Name: 7e4809eadfe99ebfd797a7c63501421021a720bbeed9fba81bebf630c58bb791

6 years agoImproved comments and extra assert() statements on the OP_Savepoint opcode,
drh [Fri, 10 May 2019 14:03:07 +0000 (14:03 +0000)] 
Improved comments and extra assert() statements on the OP_Savepoint opcode,
just to make the code a little easier to read and reason about.

FossilOrigin-Name: e80b2d9fcbc82ae5dc8a1fc13196f9a30bdb504eb5a5c131d136a78bbd5bbe7b

6 years agoFix the previous check-in [db9acef14d492121] so that the amalgamation build
drh [Fri, 10 May 2019 12:14:51 +0000 (12:14 +0000)] 
Fix the previous check-in [db9acef14d492121] so that the amalgamation build
works for systems for which lack HAVE_ISNAN.

FossilOrigin-Name: 3cc55e09e6c1de2059d97bdddf2fdfbdcc62c584b513f56faf9d3a39ef80cddd

6 years agoFix the round() SQL function so that it handles infinities correctly.
drh [Fri, 10 May 2019 12:06:47 +0000 (12:06 +0000)] 
Fix the round() SQL function so that it handles infinities correctly.

FossilOrigin-Name: db9acef14d49212108c8082cc15a9b9b4a56b8afe4fe1104ddf62783739c1fbe

6 years agoFix another small buffer overread in sqlite_dbdata triggered by a corrupt database...
dan [Thu, 9 May 2019 18:37:37 +0000 (18:37 +0000)] 
Fix another small buffer overread in sqlite_dbdata triggered by a corrupt database page.

FossilOrigin-Name: 1dfc95b8673b0e8c9ef5040c2fa0fbe9846e430d104e9b83f3f1f3ad63446380

6 years agoFix a problem in the ".recover" command allowing a circular loop of b-tree pages...
dan [Thu, 9 May 2019 18:33:32 +0000 (18:33 +0000)] 
Fix a problem in the ".recover" command allowing a circular loop of b-tree pages in a database file to cause an infinite loop.

FossilOrigin-Name: 8d2a062eb8a3e6fdc6a61b571c8da0070382bf208c53e797151eac8679c975a1

6 years agoMake the ".schema" command in the CLI resistant to corrupt database files.
drh [Thu, 9 May 2019 18:13:30 +0000 (18:13 +0000)] 
Make the ".schema" command in the CLI resistant to corrupt database files.

FossilOrigin-Name: f22c7e229ea4626c5268d61de3964521cf6a2735290cbd1518d68731ba6cca90

6 years agoFix a crash in the sqlite_dbdata module that could occur if a pointer within an overf...
dan [Thu, 9 May 2019 17:54:27 +0000 (17:54 +0000)] 
Fix a crash in the sqlite_dbdata module that could occur if a pointer within an overflow chain in a corrupt database pointed past the end of the db.

FossilOrigin-Name: 3eae4e301e3e4bcf14e96066f77be1434c5d4b3daadb10153cd36382589ac128

6 years agoDisable the optimization where a REAL value with no fractional part
drh [Thu, 9 May 2019 17:10:30 +0000 (17:10 +0000)] 
Disable the optimization where a REAL value with no fractional part
is stored as an INTEGER when the integer uses as much space as the real
value it proposes to stand in for (8 bytes).  This avoids corner cases
of comparing integers against real values that are beyond the resolution
of an IEEE 754 double.  Fix for ticket [6c1d3febc00b22d457c78c2]

FossilOrigin-Name: 9b0915272f4d4052aa31e9297424a7db9a0234b676e8e2a44c3f2dc54236705a

6 years agoAvoid long delays that can occur when ".recover"ing data from a database with a corru...
dan [Thu, 9 May 2019 16:57:39 +0000 (16:57 +0000)] 
Avoid long delays that can occur when ".recover"ing data from a database with a corrupt freelist.

FossilOrigin-Name: 20f06bf2e659212a68dcf138e444da7bd4220548ec15a97cfd7eb82e028b3630

6 years agoImproved debugging output from the OP_MakeRecord opcode.
drh [Thu, 9 May 2019 16:22:51 +0000 (16:22 +0000)] 
Improved debugging output from the OP_MakeRecord opcode.

FossilOrigin-Name: ac790729d9c8f8612936bab56dca6061408007bc2150ac8c7089132403d7f885

6 years agoFix another corruption related buffer overread in the sqlite_dbdata module.
dan [Thu, 9 May 2019 15:51:27 +0000 (15:51 +0000)] 
Fix another corruption related buffer overread in the sqlite_dbdata module.

FossilOrigin-Name: 5cd728fb6b3a70f795306d4d6e12151a4de327f801733a8558139e3cd76fe66a

6 years agoFix further buffer overreads triggered by passing corrupt records to the sqlite_dbdat...
dan [Thu, 9 May 2019 15:07:46 +0000 (15:07 +0000)] 
Fix further buffer overreads triggered by passing corrupt records to the sqlite_dbdata module.

FossilOrigin-Name: dbc6a9f7f67256dea96d3245e7bec145ba65d64adf322e18f1f3ac9556b4e0b6

6 years agoHave ".recover" handle cases where the sqlite_master table contains malformed SQL...
dan [Thu, 9 May 2019 14:15:19 +0000 (14:15 +0000)] 
Have ".recover" handle cases where the sqlite_master table contains malformed SQL statements.

FossilOrigin-Name: e736da9c18fad138c5502d354c3553373cba15358b69e44b257f60def59422e2

6 years agoFix a problem with running the ".recover" command on a database that is zero pages...
dan [Thu, 9 May 2019 11:45:21 +0000 (11:45 +0000)] 
Fix a problem with running the ".recover" command on a database that is zero pages in size.

FossilOrigin-Name: 47fa65343e46c7782a173174952c637c5621e16229ece258dc7e7a556683ca0c

6 years agoAvoid reading outside a record buffer when extracting an SQL value in the sqlite_dbda...
dan [Thu, 9 May 2019 11:34:31 +0000 (11:34 +0000)] 
Avoid reading outside a record buffer when extracting an SQL value in the sqlite_dbdata virtual table code.

FossilOrigin-Name: d99bb0c11d62f629bf59da037827af73a9b814e65815006e0cbca1bc41f42e25