drh
7cd5e856e5
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
2019-05-29 17:22:38 +00:00
drh
ef7d5187a7
Improved rounding even on systems with an 8-byte "long double" type.
...
FossilOrigin-Name: 15202aee150fa8e15fb90e90e5765c5e19a1eaf4896da2996a747636b76da8e6
2019-05-27 00:29:15 +00:00
drh
c2b893a7e0
Performance enhancement in sqlite3AtoF(). About 8% faster.
...
FossilOrigin-Name: 81721aa54587e20d031d528fb6b74d91671a6e950fa926dc63f4284466e70f0e
2019-05-25 18:17:53 +00:00
drh
38a59af417
Use "long double" literals to initialize an array of "long double" objects.
...
FossilOrigin-Name: 2e2ebad3ab636c4c65814ad41d417b105be8e254d609d0e08fbba4c5bd107bf3
2019-05-25 17:41:07 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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