]>
git.ipfire.org Git - thirdparty/sqlite.git/log
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
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
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
drh [Wed, 22 May 2019 14:35:10 +0000 (14:35 +0000)]
New dbsqlfuzz find added to test/fuzzdata8.db.
FossilOrigin-Name:
42af7c819bc52ccb6953a58b1c05d3bd47cc438c5119a9555b1b796764eb9f20
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
dan [Thu, 16 May 2019 16:44:47 +0000 (16:44 +0000)]
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
mistachkin [Thu, 16 May 2019 03:47:38 +0000 (03:47 +0000)]
Fix harmless compiler warning in the session extension.
FossilOrigin-Name:
dff823ca8b5ca4a5611407b0231f89b2e8c981f50e85e361e76d3e4973cea8ca
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
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
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
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
drh [Tue, 14 May 2019 19:20:52 +0000 (19:20 +0000)]
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
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
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
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
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
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
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
dan [Fri, 10 May 2019 20:44:10 +0000 (20:44 +0000)]
drh [Fri, 10 May 2019 17:54:58 +0000 (17:54 +0000)]
drh [Fri, 10 May 2019 17:50:33 +0000 (17:50 +0000)]
mistachkin [Fri, 10 May 2019 16:16:19 +0000 (16:16 +0000)]
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
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
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
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
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
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
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
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
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
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
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
drh [Thu, 9 May 2019 16:22:51 +0000 (16:22 +0000)]
Improved debugging output from the OP_MakeRecord opcode.
FossilOrigin-Name:
ac790729d9c8f8612936bab56dca6061408007bc2150ac8c7089132403d7f885
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
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
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
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
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
dan [Thu, 9 May 2019 11:21:32 +0000 (11:21 +0000)]
dan [Thu, 9 May 2019 11:19:27 +0000 (11:19 +0000)]
Fix a problem in the new code introduced by [
658b84d7 ] causing corruption and other errors to be ignored.
FossilOrigin-Name:
7ccf2e7d413adb109c61456a5f46e87d38884801dbaab93297a17e3050014b59
drh [Thu, 9 May 2019 11:18:41 +0000 (11:18 +0000)]
Improved error handling for the ".open --hexdb" command of the CLI.
FossilOrigin-Name:
4fa831d5cd5861f6a0a8f08a738b2d4d371fb2a788178ce86482c5bba761f9de
drh [Wed, 8 May 2019 23:55:04 +0000 (23:55 +0000)]
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
drh [Wed, 8 May 2019 23:53:50 +0000 (23:53 +0000)]
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
dan [Wed, 8 May 2019 21:14:48 +0000 (21:14 +0000)]
Add another test case to cover a previously uncovered branch in the RBU module.
FossilOrigin-Name:
30392985612c51d4583a905f8fe766f08cd31b86d0e30a977adc6a6705649e00
drh [Wed, 8 May 2019 19:55:24 +0000 (19:55 +0000)]
Fix another pattern for which the LIKE optimization does not work for a
non-TEXT affinity. Case found by Manuel Rigger.
FossilOrigin-Name:
740201107ae802c12b678e388ea524db01ad0eb70601c78490ad63eae0fe6cf1
drh [Wed, 8 May 2019 19:32:33 +0000 (19:32 +0000)]
Simplification to the logic underlying PRAGMA case_sensitive_like.
FossilOrigin-Name:
ef0015fde4c87e992ffd3d7dea8586951bdd65ff98d30d436b126b85b1cc9c74
drh [Wed, 8 May 2019 19:06:59 +0000 (19:06 +0000)]
Avoid an excess register allocation in UPDATE, when possible. This improves
speed (slightly) and reduces the code footprint.
FossilOrigin-Name:
8658574e3f435f03a87c04f398bd05078ebc53ecb4a477d3b24902d701d935c4
dan [Wed, 8 May 2019 18:49:51 +0000 (18:49 +0000)]
Add tests to improve code coverage of the RBU module.
FossilOrigin-Name:
ecb56b75a0e66462acdcce285b93f9fc56944c42902d886d6bada419059519a9
drh [Wed, 8 May 2019 17:27:18 +0000 (17:27 +0000)]
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
dan [Wed, 8 May 2019 11:52:13 +0000 (11:52 +0000)]
Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.
FossilOrigin-Name:
658b84d7f4a0886591c5aab30ed9e31c4a0f56db303eb863f24833ca37085d14
dan [Wed, 8 May 2019 11:42:49 +0000 (11:42 +0000)]
Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.
FossilOrigin-Name:
a870c196d78d8b72c7353fa0015e96b2abd4be154541d76328e3a4f9e5da5d04
drh [Wed, 8 May 2019 04:33:17 +0000 (04:33 +0000)]
Remove an ALWAYS() that was previously added by check-in [
a0819086 ] but
which turns out can sometimes be false.
FossilOrigin-Name:
ad8fc5d8b440c49df95328df0408be699dde5a1dbd195b3f1f32e5f765578032
drh [Wed, 8 May 2019 03:34:53 +0000 (03:34 +0000)]
Remove a NEVER() that was added in the previous check-in because it is in fact
reachable.
FossilOrigin-Name:
74eba2558a81f9e790d95a12a0c5379d4f80b43c8698ef9d6a31ff8d160a53d8
drh [Wed, 8 May 2019 00:17:45 +0000 (00:17 +0000)]
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
drh [Tue, 7 May 2019 20:06:41 +0000 (20:06 +0000)]
Generate all records for INSERT or UPDATE prior to running foreign key
constraint checks, since the FK checks might modify the datatype of registers
used to generate the records. Fix for ticket [
e63cbcfd3378afe6980d6 ].
FossilOrigin-Name:
3c75605b4652ae88659465d832953ac9d467369f9cb417f73b3d8599ec60b18b
dan [Tue, 7 May 2019 19:44:11 +0000 (19:44 +0000)]
Do not commit an "OR FAIL" statement that causes foriegn key constraint violations.
FossilOrigin-Name:
659c551dcc374a0d349ba9419f692e3363839e11d791a17cc35fa1854a674a51
dan [Tue, 7 May 2019 19:21:58 +0000 (19:21 +0000)]
drh [Tue, 7 May 2019 19:13:42 +0000 (19:13 +0000)]
On an INSERT or UPDATE, generate the new table record prior to running
foreign key checks, in case the foreign key checks changes datatypes on
the registers holding column values. Proposed fix for ticket
[
e63cbcfd3378afe6980d626 ].
FossilOrigin-Name:
3f1c8051648a341db4dffad66d3b1f9980d8a2b314cb0ce879cb2a10d1779b84
drh [Tue, 7 May 2019 17:47:43 +0000 (17:47 +0000)]
Strive to prevent harmless compiler warnings in GCC 4.8.5.
FossilOrigin-Name:
8b6691f619ed9a56f6aecbd878ebb447c40984f8767508b248494fd9ec68fbaa
dan [Tue, 7 May 2019 16:37:37 +0000 (16:37 +0000)]
dan [Tue, 7 May 2019 16:28:50 +0000 (16:28 +0000)]
Remove some redundant code from sqlite3rbu.c. Add test cases for RBU vacuum.
FossilOrigin-Name:
7b051698d8a763d9db190fd662931266d24a4982f34f100a28641934c222e37b
dan [Mon, 6 May 2019 20:40:23 +0000 (20:40 +0000)]
Optimize further cases of restarting an RBU vacuum.
FossilOrigin-Name:
6b3261bfa1d762aa29a57244a30cf5e35655f1fe9c30ee682c186dec29d7a2c2
dan [Mon, 6 May 2019 16:15:28 +0000 (16:15 +0000)]
Fix a problem with renaming an INTEGER PRIMARY KEY column of a WITHOUT ROWID table using ALTER TABLE.
FossilOrigin-Name:
91f701d39852ef1ddb29d1527d1520867c5efea110333315c55d8b08084384e7
dan [Sat, 4 May 2019 20:04:42 +0000 (20:04 +0000)]
Optimize some cases of restarting an RBU vacuum.
FossilOrigin-Name:
cdc09867ed6522026ae7bfac1f59cd79b60fba6d07d49b99b030a501a7059ee4
drh [Sat, 4 May 2019 17:32:07 +0000 (17:32 +0000)]
Fix the NOT NULL logic in the theorem prover that determines when a partial
index can be used. Ticket [
5c6955204c392ae763a95 ].
FossilOrigin-Name:
c2e439bccc40825e211bfa9a88e6a251ff066ca7453d4e7cb5eab56ce7332635
mistachkin [Sat, 4 May 2019 03:56:47 +0000 (03:56 +0000)]
Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name:
5862b83eb36b93016d37e5b86ebb183d891bb553901facab1e5d83e114a38ec3
drh [Sat, 4 May 2019 01:41:18 +0000 (01:41 +0000)]
In the sqlite3_value or Mem object, make the MEM_IntReal type completely
independent from MEM_Int and MEM_Real. This helps avoid problems when
inserting non-float values into a "REAL" column.
FossilOrigin-Name:
5a8a23ee5f60a31dbd167a0966d1ab3d0f1c07df2251906cb73f23d1f5466b46
drh [Sat, 4 May 2019 01:29:13 +0000 (01:29 +0000)]
New testcase macros to ensure that MEM_IntReal is fully tested.
FossilOrigin-Name:
8b8ef445ccccc148af2cda5975986af0d134352fe16283f65d0f8a91c9ffa932
drh [Fri, 3 May 2019 21:17:28 +0000 (21:17 +0000)]
Add the SQLITE_TESTCTRL_RESULT_INTREAL test-control and use it to create
the intreal() SQL function in testfixture. Write a few simple tests to
prove this all works. TH3 will hold most of the INTREAL tests, probably.
FossilOrigin-Name:
c9838731325e0ca73bd8784c10c74ae043fed7861e6de269fd90e29fa4a19955
drh [Fri, 3 May 2019 19:34:41 +0000 (19:34 +0000)]
Ensure that UTF16 strings are properly zero-terminated before returning them
in an sqlite3_value_text16() request, even if the string is invalid UTF16
because it was formed from an arbitrary and/or odd-length BLOB.
FossilOrigin-Name:
3a16ddf91f0c9c516a7fc2a9d4a4f69a8326f9b8ea66421e9ef1a2d663687b70
dan [Fri, 3 May 2019 18:50:24 +0000 (18:50 +0000)]
Fix a memory-leak/segfault caused by using OP_OpenDup and OP_OpenEphemeral on the same VM cursor.
FossilOrigin-Name:
a9b90aa12eecdd9f2a8b2d23da8b7cac43d8b1789f5cefa3f4e939d9f2b59269
dan [Fri, 3 May 2019 17:19:10 +0000 (17:19 +0000)]
Fix a problem where self-joins on views that are aggregate queries may return the wrong result.
FossilOrigin-Name:
74ef97bf51dd531a277cf22fa4d42043d93799d5a5bd550812648834460fe0b7
drh [Fri, 3 May 2019 17:08:16 +0000 (17:08 +0000)]
Improved comments on the elements of the array constant used to implement
the sqlite3_value_type() interface.
FossilOrigin-Name:
f73a7de7a53f6aa6517221550a9c9882893206edfd7433e80e5fc0f441db9fc4
drh [Fri, 3 May 2019 02:41:36 +0000 (02:41 +0000)]
Fix the ".open --hexdb" command in the CLI so that it works even with
terminal input.
FossilOrigin-Name:
9b5d943426c9273162ecb4c561eb3b25e843318dd438239c882c9db50f788454
drh [Thu, 2 May 2019 21:36:26 +0000 (21:36 +0000)]
Make MEM_IntReal a completely independent type, meaning a floating point
value stored as an integer. This fixes a problem with arithmetic within
arguments to string functions on indexes of expressions. But it is a big
change and needs lots of new testcase() macros for MC/DC and so it is
initially put on this branch.
FossilOrigin-Name:
dba836e31cb29d339b4520acb06188a892a52e45c50aba9742966b01108e251a
drh [Thu, 2 May 2019 17:45:52 +0000 (17:45 +0000)]
Ensure that the typeof() function always returns SQLITE_FLOAT for floating
point values even when the value is stored as an integer to save space.
FossilOrigin-Name:
48889530a9de22fee536edfd1627be62396ed18d842d5fd6d91e010b4337be95
dan [Thu, 2 May 2019 17:06:01 +0000 (17:06 +0000)]
Add options to wapptest.tcl similar to those supported by releasetest.tcl. Also add the -noui switch, for running without wapp altogether.
FossilOrigin-Name:
005a169406ccea6e3cc42271620870d985e8bada1ad49a63656003db4911cb51
drh [Thu, 2 May 2019 15:56:39 +0000 (15:56 +0000)]
Earlier detection of a database corruption case in balance_nonroot(), to
prevent a possible use of an uninitialized variable.
FossilOrigin-Name:
c509d8a8aebe0da4847e95cf737c21313a665de9a540da2db57b8ed22f98a402
drh [Thu, 2 May 2019 01:41:53 +0000 (01:41 +0000)]
The collating sequence of the column must be TEXT if the LIKE or GLOB pattern
starts with a "+" sign. This is another case of ticket
[
c94369cae9b561b1f996d005 ] that was discovered by Manuel Rigger.
FossilOrigin-Name:
b043a54c3de54b286c4eae564eab6b99118a410d99bdb63480faba3123d2ca11
drh [Thu, 2 May 2019 00:52:50 +0000 (00:52 +0000)]
Fix an issue (discovered by OSSFuzz) in the enhanced OP_Concat operator
from check-in [
713caa382cf7dd ] earlier today.
FossilOrigin-Name:
3e897702f8f789fe5119b9042fb93eca3fbfcc44564fbfa66c65628725b1157d
drh [Wed, 1 May 2019 19:01:27 +0000 (19:01 +0000)]
drh [Wed, 1 May 2019 18:59:33 +0000 (18:59 +0000)]
When values have real affinity and are converted into strings for CHECK
constraints or index expressions, do the conversions into a real-number format
even if the values are stored as integers for efficiency.
This appears to fix ticket [
ae0f637bddc5290b446 ].
FossilOrigin-Name:
5997d075665faca6b70fa647e877ebc84c473b32887b96235865d59ce80247f8