Commit Graph

20641 Commits

Author SHA1 Message Date
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
drh
0a0536ab0f Make the ".schema" command in the CLI resistant to corrupt database files.
FossilOrigin-Name: f22c7e229ea4626c5268d61de3964521cf6a2735290cbd1518d68731ba6cca90
2019-05-09 18:13:30 +00:00
dan
4d2175613f 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
2019-05-09 17:54:27 +00:00
drh
6bab6f2b4d 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
2019-05-09 17:10:30 +00:00
dan
f6099e9b40 Avoid long delays that can occur when ".recover"ing data from a database with a corrupt freelist.
FossilOrigin-Name: 20f06bf2e659212a68dcf138e444da7bd4220548ec15a97cfd7eb82e028b3630
2019-05-09 16:57:39 +00:00
drh
5ad1251a60 Improved debugging output from the OP_MakeRecord opcode.
FossilOrigin-Name: ac790729d9c8f8612936bab56dca6061408007bc2150ac8c7089132403d7f885
2019-05-09 16:22:51 +00:00
dan
9c34bc0ad5 Fix another corruption related buffer overread in the sqlite_dbdata module.
FossilOrigin-Name: 5cd728fb6b3a70f795306d4d6e12151a4de327f801733a8558139e3cd76fe66a
2019-05-09 15:51:27 +00:00
dan
e216ae0a3e Fix further buffer overreads triggered by passing corrupt records to the sqlite_dbdata module.
FossilOrigin-Name: dbc6a9f7f67256dea96d3245e7bec145ba65d64adf322e18f1f3ac9556b4e0b6
2019-05-09 15:07:46 +00:00
dan
9877965f56 Have ".recover" handle cases where the sqlite_master table contains malformed SQL statements.
FossilOrigin-Name: e736da9c18fad138c5502d354c3553373cba15358b69e44b257f60def59422e2
2019-05-09 14:15:19 +00:00
dan
13b876773c Fix a problem with running the ".recover" command on a database that is zero pages in size.
FossilOrigin-Name: 47fa65343e46c7782a173174952c637c5621e16229ece258dc7e7a556683ca0c
2019-05-09 11:45:21 +00:00
dan
b3e3a5bb57 Avoid reading outside a record buffer when extracting an SQL value in the sqlite_dbdata virtual table code.
FossilOrigin-Name: d99bb0c11d62f629bf59da037827af73a9b814e65815006e0cbca1bc41f42e25
2019-05-09 11:34:31 +00:00
dan
eb4a61a30c Merge accidental fork in trunk.
FossilOrigin-Name: ec9373031d76b34163a45d0ed05e43c0c9d585c8d47aa255f670340673bc7875
2019-05-09 11:21:32 +00:00
dan
873b019826 Fix a problem in the new code introduced by [658b84d7] causing corruption and other errors to be ignored.
FossilOrigin-Name: 7ccf2e7d413adb109c61456a5f46e87d38884801dbaab93297a17e3050014b59
2019-05-09 11:19:27 +00:00
drh
68feae52a9 Improved error handling for the ".open --hexdb" command of the CLI.
FossilOrigin-Name: 4fa831d5cd5861f6a0a8f08a738b2d4d371fb2a788178ce86482c5bba761f9de
2019-05-09 11:18:41 +00:00
drh
eb265343a9 Ensure that the sqlite3BtreeLast() interface initializes the *pRes return
to zero if the cursor is already sitting on the last entry of the table.

FossilOrigin-Name: ebe4845cd0ffb96b30be3c69eb399d58e93149886bc2fa60a7ebd7b4fbe447a4
2019-05-08 23:55:04 +00:00
drh
6f7f5d95f8 This is part of the previous check-in that didn't get committed for some
reason - probably because I failed to press the "Save" button on the text
editor.

FossilOrigin-Name: 51d32173ff1f610b5d75a50f20fa1e0e4e22046299869e3b82e0bb446dba890c
2019-05-08 23:53:50 +00:00
dan
ad5536fca1 Add another test case to cover a previously uncovered branch in the RBU module.
FossilOrigin-Name: 30392985612c51d4583a905f8fe766f08cd31b86d0e30a977adc6a6705649e00
2019-05-08 21:14:48 +00:00
drh
97afa309d7 Fix another pattern for which the LIKE optimization does not work for a
non-TEXT affinity.  Case found by Manuel Rigger.

FossilOrigin-Name: 740201107ae802c12b678e388ea524db01ad0eb70601c78490ad63eae0fe6cf1
2019-05-08 19:55:24 +00:00
drh
ea5c040f87 Simplification to the logic underlying PRAGMA case_sensitive_like.
FossilOrigin-Name: ef0015fde4c87e992ffd3d7dea8586951bdd65ff98d30d436b126b85b1cc9c74
2019-05-08 19:32:33 +00:00
drh
9e9374b2e2 Avoid an excess register allocation in UPDATE, when possible. This improves
speed (slightly) and reduces the code footprint.

FossilOrigin-Name: 8658574e3f435f03a87c04f398bd05078ebc53ecb4a477d3b24902d701d935c4
2019-05-08 19:06:59 +00:00
dan
42e84ae1ab Add tests to improve code coverage of the RBU module.
FossilOrigin-Name: ecb56b75a0e66462acdcce285b93f9fc56944c42902d886d6bada419059519a9
2019-05-08 18:49:51 +00:00
drh
08652b5ea0 Provide the SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA compile-time option to
omit the case_sensitive_like pragma.  This change, in combination with
documentation changes, is the current solution to ticket
[a340eef47b0cad5].

FossilOrigin-Name: eabe7f2d4ff0e0dd868dcab7ec1d4a9168a25f80d3a52f0eeea2f90bd33782f2
2019-05-08 17:27:18 +00:00
dan
a7be6f355c Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.
FossilOrigin-Name: 658b84d7f4a0886591c5aab30ed9e31c4a0f56db303eb863f24833ca37085d14
2019-05-08 11:52:13 +00:00
dan
9edd8c11ab Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.
FossilOrigin-Name: a870c196d78d8b72c7353fa0015e96b2abd4be154541d76328e3a4f9e5da5d04
2019-05-08 11:42:49 +00:00
drh
291508f62b Remove an ALWAYS() that was previously added by check-in [a0819086] but
which turns out can sometimes be false.

FossilOrigin-Name: ad8fc5d8b440c49df95328df0408be699dde5a1dbd195b3f1f32e5f765578032
2019-05-08 04:33:17 +00:00
drh
d2cfbea2a4 Remove a NEVER() that was added in the previous check-in because it is in fact
reachable.

FossilOrigin-Name: 74eba2558a81f9e790d95a12a0c5379d4f80b43c8698ef9d6a31ff8d160a53d8
2019-05-08 03:34:53 +00:00
drh
dfcecdfea8 Earlier detections of errors in the byte-offset-to-cell-content integer at
offset 5 in the header of a btree page.

FossilOrigin-Name: a0819086a521fb0ca4ffd12f959b168a89ea2e30a2844bbbd39831b2b9ecf29b
2019-05-08 00:17:45 +00:00