Commit Graph

20817 Commits

Author SHA1 Message Date
drh
aa81cae485 Disable the new rounding tests on systems without long double support.
FossilOrigin-Name: ed250b4e18ea042d681bbe8d7ed00895564f4525c22928a003a84585b4756ec3
2019-05-25 00:17:26 +00:00
drh
a0ed86bc37 Improvements to rounding behavior in the round() and printf() functions.
FossilOrigin-Name: 641b2d210541b4d5a1a9e57d7dcf5ce5dfd7ff4d2dc6277ba0582869f48fc946
2019-05-24 22:58:16 +00:00
dan
98d63579be Fix an fts5 segfault that could occur after parsing a corrupt structure record.
FossilOrigin-Name: 600daa9c27206628bf74892376ded35dac11fe0a34894fcd975ad5041a0a0fda
2019-05-24 11:55:01 +00:00
dan
c542fa8573 Add test cases for the fix in the previous commit.
FossilOrigin-Name: c1057b2a60add08e5c80ef2a53932a690b096f2eb03c7de863844deaa8fc9d53
2019-05-23 16:40:45 +00:00
drh
30ad79aeb4 Improvements to the view-self-join optimization so that it works on all
VIEWs, not just on Common Table Expressions.

FossilOrigin-Name: d2fe370cafa9b11f6c3eb4e1c3be48d9d2610b9d2f9d9ebf9e50267f9079dfc0
2019-05-23 16:38:12 +00:00
drh
53e8709b75 New test case for check-in [74ef97bf51dd531a] that takes the fix in the
previous check-in into account.

FossilOrigin-Name: cb1d06521de5918a2324a41e207b48c5e5149c23b927b9e3e1f3c3b38b82658e
2019-05-22 23:12:10 +00:00
drh
59145813d2 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
2019-05-22 22:49:23 +00:00
drh
90c21df233 New dbsqlfuzz find added to test/fuzzdata8.db.
FossilOrigin-Name: 42af7c819bc52ccb6953a58b1c05d3bd47cc438c5119a9555b1b796764eb9f20
2019-05-22 14:35:10 +00:00
dan
29fa6b6642 Fix a buffer overread that could in fts3 when dealing with corrupt records.
FossilOrigin-Name: 1660d7733eb443ab085ddef7666b998a1c75ac81cc54a9620960a8d3b377e28e
2019-05-22 14:22:44 +00:00
drh
51e441da2b 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
2019-05-21 17:04:27 +00:00
dan
7ed6c068f5 Fix a problem in [b5ca442a] causing an assert() to fail in REINDEX commands.
FossilOrigin-Name: a3e77c7776ab01dadb9d30d6067ac97e9d4b09ec54834558a5fa1ffed7b52c72
2019-05-21 16:32:41 +00:00
dan
ef14abbf8d 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
2019-05-21 14:42:24 +00:00
dan
595d9f5f3c Fix a segfault that could occur in sqlite3session_diff() if NULL were passed as the pzErrMsg argument.
FossilOrigin-Name: aee73fd28f031a2568ac723de0826be7f1dca6be3b049e4a04fb47af75dcf4bf
2019-05-20 19:46:30 +00:00
drh
acd6bb5fe4 Improvements to the automatic compile-time selection of byte-order, as
suggested on the mailing list by Seb Kemper.

FossilOrigin-Name: b7aad929619f7043b1685a6477d50f6b4436e85511eb365eceae3dd4dbab571a
2019-05-20 18:43:57 +00:00
drh
3e4f6c43b8 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
2019-05-20 18:35:49 +00:00
dan
0d92571d65 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
2019-05-20 17:14:25 +00:00
dan
8ac02a94ab 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
2019-05-20 10:36:15 +00:00
dan
7ac0e562a3 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
2019-05-18 21:22:25 +00:00
dan
4db4b5b4fe 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
2019-05-18 19:49:08 +00:00
drh
6c35b3065c Disable PRAGMA journal_mode=OFF when SQLITE_DBCONFIG_DEFENSIVE is turned on.
Ticket [f4ec250930342e0c].

FossilOrigin-Name: a0f5eb5c79cc33b7224f3421d2baa02a2a19eb9d6eaa8117dda4a1878b229cb5
2019-05-17 20:37:17 +00:00
dan
be81262400 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
2019-05-17 15:59:11 +00:00
drh
829d4253ff Add test cases to test/fuzzdata7.db for (harmless) dbfuzz2 finds.
FossilOrigin-Name: 1eb2a628e4bfae51fea43e8f40fedfe23f2118024d9cce35828c3cbe92a9b392
2019-05-16 20:40:08 +00:00
drh
5c2f2206b6 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
2019-05-16 20:36:07 +00:00
dan
0971ef45ab Fix an assert() in the OP_Delete opcode that could fail with a corrupt database.
FossilOrigin-Name: 915388ab39ba3ca8681cd2613b91314aa965967f23a5bface90f54a3d6423300
2019-05-16 20:13:32 +00:00
dan
36c9301816 Add new test file fts5corrupt4.test.
FossilOrigin-Name: 5dfc4fe98a4821cbdbfd7dfddf221b00251b2a26bf58767a3956b64e9a4e92da
2019-05-16 16:44:47 +00:00
drh
e72d1a8682 Fix a harmless use-of-initialized-value fault in the assert() logic added
by check-in [d612fb7873cf59d]

FossilOrigin-Name: 3dac90728a6a1962da478afe751582ddf8b6d4666548a805564817b21e07a246
2019-05-16 11:47:16 +00:00
mistachkin
3196abb7cb Fix harmless compiler warning in the session extension.
FossilOrigin-Name: dff823ca8b5ca4a5611407b0231f89b2e8c981f50e85e361e76d3e4973cea8ca
2019-05-16 03:47:38 +00:00
drh
df82afc04e 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
2019-05-16 01:22:21 +00:00
drh
73c53b39c9 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
2019-05-15 18:42:15 +00:00
drh
58eaf76355 Simplify the "Verifying Code Authenticity" section of the README.md file.
No code changes.

FossilOrigin-Name: adebffc18e6165672947a6bda5ca23ea7723cca7ab8da4feb81fca8f83e4fcaf
2019-05-15 10:16:34 +00:00
dan
a40cb96a4c 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
2019-05-14 20:25:22 +00:00
drh
9252966b3c New test cases in test/fuzzdata8.db.
FossilOrigin-Name: 228e1087c0602470e450586499de5a3e87e266c688bc828f20e3bad2fdc65ff1
2019-05-14 19:20:52 +00:00
dan
2a71b17f2f Fix a problem with corrupt db handling in the fts5_vocab module.
FossilOrigin-Name: 456ced57774a92acff23cad975b78ff0e5cbbf5204ea48599fe1761a018a92e4
2019-05-14 18:33:58 +00:00
dan
c12655df87 Fix an assert() and potential buffer overrun in fts5 that could occur if the database was corrupt.
FossilOrigin-Name: 8be8bd0d562e571b73a93f4ed18258ebd114bbab67ee3cdcd66a4c8f2987f8dc
2019-05-14 11:33:09 +00:00
drh
bf9ff256fe 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
2019-05-14 00:43:13 +00:00
dan
d6712f3638 Fix an assert() failure in fts5 that could occur when processing a corrupt database.
FossilOrigin-Name: f158c048be1dc7c80d38787a20495caa55b86416967efd57f4888548d42b4819
2019-05-13 11:52:19 +00:00
drh
c51cf8642f 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
2019-05-11 19:36:03 +00:00
dan
c6824c8d6c When considering partial indexes, do not assume that a "CASE x ..." expression implies "x IS NOT NULL".
FossilOrigin-Name: 1b24303220b7b4f59520176a0150fc619c668865450b4fdaa9ce4113a56e9687
2019-05-11 16:14:42 +00:00
dan
8f2b1e4c90 Do not assume that "x IS NOT ?" implies "x NOT NULL" when considering partial indexes. Fix for ticket [8025674847].
FossilOrigin-Name: 0ba6d709b50d92db1542f2ff30535a80184b00dadf759d51e5cae7a6e37b1764
2019-05-11 13:04:33 +00:00
dan
90255b8149 Add tests for the RBU module.
FossilOrigin-Name: a194e53670e25a48c2bb51b54755abff88ed6ae2596c5858fb4aac16cb452bdf
2019-05-10 20:44:10 +00:00
drh
2240bb88f8 Fix harmless compiler warnings.
FossilOrigin-Name: 956ca2a452aa3707bca553007a7ef221af3d4f6b0af747d17070926e000f2362
2019-05-10 17:54:58 +00:00
drh
9546c76656 Fix harmless compiler warnings in the CLI.
FossilOrigin-Name: 2846bc0429c0956473bfe99dde135f2c206720f0be4c2800118b280e446ce325
2019-05-10 17:50:33 +00:00
mistachkin
d9bc6e8973 Fix some harmless compiler warnings.
FossilOrigin-Name: ca068d82387fc3cda9d2050cedb4f9c61b6d9dc54f89015b4b2ee492243ed5c9
2019-05-10 16:16:19 +00:00
drh
4142265645 Ensure that the BtShared.nPage value is reset correctly on a SAVEPOINT
ROLLBACK.

FossilOrigin-Name: e6d5fee8cdbdce8515957e8288e4d1e7b06f417fd3f9deeeb636fbf5b995af51
2019-05-10 14:34:18 +00:00
dan
08f6de7f31 Treat integer values in window definition ORDER BY clauses as constants, not as references to another expression.
FossilOrigin-Name: 7e4809eadfe99ebfd797a7c63501421021a720bbeed9fba81bebf630c58bb791
2019-05-10 14:26:32 +00:00
drh
2ce9b6bcd5 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
2019-05-10 14:03:07 +00:00
drh
7e6dc5d908 Fix the previous check-in [db9acef14d492121] so that the amalgamation build
works for systems for which lack HAVE_ISNAN.

FossilOrigin-Name: 3cc55e09e6c1de2059d97bdddf2fdfbdcc62c584b513f56faf9d3a39ef80cddd
2019-05-10 12:14:51 +00:00
drh
05d7bfd0bb Fix the round() SQL function so that it handles infinities correctly.
FossilOrigin-Name: db9acef14d49212108c8082cc15a9b9b4a56b8afe4fe1104ddf62783739c1fbe
2019-05-10 12:06:47 +00:00
dan
5985dcbf5e Fix another small buffer overread in sqlite_dbdata triggered by a corrupt database page.
FossilOrigin-Name: 1dfc95b8673b0e8c9ef5040c2fa0fbe9846e430d104e9b83f3f1f3ad63446380
2019-05-09 18:37:37 +00:00
dan
39e04f83b9 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
2019-05-09 18:33:32 +00:00