1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00
Commit Graph

13138 Commits

Author SHA1 Message Date
drh
b52e9c89df All bytes of a page are initialized, even bytes that follow a 2-byte cell
on a malformed page.

FossilOrigin-Name: 7373a004ed0e2781cda503c73e9a94f24350ef79
2015-05-27 18:13:35 +00:00
drh
f9705d4b66 A different approach to preventing buffer overreads when comparing a vector
of values with a corrupt index record that spans at least one overflow page.

FossilOrigin-Name: 95eaa49f4ee071c7a0f690a695f1f2d1ebca68a8
2015-05-27 15:42:53 +00:00
drh
a7298ac191 Disallow the use of "rowid" in CTEs - it has never worked correctly and it
makes no sense, so we might as well make it an explicit error.
Also: add the PRAGMA cell_size_check=ON command.

FossilOrigin-Name: 19e2cebc12aaa4e72d3bad74af73575a0457e5d4
2015-05-27 15:10:20 +00:00
dan
3548db7c13 A different approach to preventing buffer overreads when comparing a vector of values with a corrupt index record that spans at least one overflow page.
FossilOrigin-Name: 7e9e1b6123bc455dd7d1c894b6154ccd27acec18
2015-05-27 14:21:05 +00:00
drh
fccda8a162 CTEs have never add working rowids. So disallow the use of the "rowid" column
within CTEs.

FossilOrigin-Name: 0055df0445932a43e42b318ef88672dcbe312c3a
2015-05-27 13:06:55 +00:00
drh
1421d980c5 Add the "PRAGMA cell_size_check=ON" command.
FossilOrigin-Name: 2ead43f074d01312c7642e1df9abccc95547f019
2015-05-27 03:46:18 +00:00
dan
b95e1193d5 Avoid a buffer overread when comparing against a corrupt record that spans at least one overflow page.
FossilOrigin-Name: 62a5b3633a086694ef0e579a0a82322cb1ae3d60
2015-05-26 20:31:20 +00:00
dan
cc7aa1f6f3 Avoid branching on an uninitalized variable when comparing SQL values with the undefined serial types 10 and 11 (which only appear in corrupt databases).
FossilOrigin-Name: b4a45d3b78fede2433ac18f20b1ab7bddee77059
2015-05-26 20:07:32 +00:00
dan
584390e8dd Fix a one-byte buffer overread that may follow a syntax error while preparing an SQL statement.
FossilOrigin-Name: 075003930da98419f671b7833a5850693529fb62
2015-05-26 18:58:57 +00:00
dan
633d0753ab Add a cast to one side of the test added by [97806a78] in order to avoid a signed/unsigned comparison warning.
FossilOrigin-Name: 5b46d2a78a45de4176b666bfc89c2aaa6f083662
2015-05-26 17:33:30 +00:00
dan
fb0246ba8a Return SQLITE_CORRUPT to the user if an attempt is made to add database page 1 to the free page list.
FossilOrigin-Name: 68876003f922635737349f55bc73a78891ea7028
2015-05-26 12:18:17 +00:00
dan
c5b7358513 Fix a problem with ignoring UNIQUE constraints on WITHOUT ROWID tables rendered redundant by the PRIMARY KEY.
FossilOrigin-Name: 3b936913f3dc2cae4c94f983f28d85b136a44c9f
2015-05-26 11:53:14 +00:00
dan
c3e8ef1d0e Fix a case of a corrupt database causing SQLite to read from up to 4 bytes before the start of a memory allocation.
FossilOrigin-Name: 7d2c4f7b6695806ab8ce0c6f49d8bc1d77a4320b
2015-05-25 20:04:15 +00:00
dan
08f901b008 Have the b-tree layer return SQLITE_CORRUPT to any attempt to open a cursor with a root page number less than 1.
FossilOrigin-Name: aa18c8e9d1676b1caa53bc5f5c1dc5f201089b88
2015-05-25 19:24:36 +00:00
dan
0f8076dd69 Fix a couple of btree asserts that would fail when encountering 32-bit rollover in cell payload size fields (cell payloads this large always indicate corruption).
FossilOrigin-Name: 8fa0937a2f3476dd280259e252d6f422c33d38ee
2015-05-25 18:47:26 +00:00
dan
2fc3a6cd98 Fix a case where database corruption may cause SQLite to write past the end of a buffer.
FossilOrigin-Name: 97806a78142b15f89878e25ee70dc5b0524d6793
2015-05-25 17:07:29 +00:00
dan
cf3d17c604 Fix an assert() in btree routine freeSpace() that may be false if the database is corrupt.
FossilOrigin-Name: 00a473c56188cd60a74559effb114140e3fe8a8d
2015-05-25 15:03:49 +00:00
drh
af80a1c8e7 Fix an obsolete comment - no changes to code.
FossilOrigin-Name: 4e4228c47f862c7f1fb078bf1b8c1d604f09d365
2015-05-25 10:29:52 +00:00
drh
521d7bd214 Remove an incorrect and pointless assert().
FossilOrigin-Name: 8c3929bd42ff9c041df341aced5b7dbc0f563506
2015-05-25 09:33:48 +00:00
drh
7ca0954c2c The assert() changes removed in the previous check-in are needed after all.
FossilOrigin-Name: 336fccc84cd7b770c9c3720efc9976269096232e
2015-05-24 21:46:03 +00:00
drh
0b538f2a81 Better detection of corruption in allocateSpace() in btree.c.
FossilOrigin-Name: bf7bb53ee2485a5342916d514d6c7291eb84c5f1
2015-05-24 21:09:52 +00:00
drh
a1f75d96fd Detect database corruption in the modifyPagePointer() routine and abort.
FossilOrigin-Name: 4f0bba42f904e505900be67b00179ebb1f24ed03
2015-05-24 10:18:12 +00:00
drh
82110da971 Instead of early detection of corruption in balance_nonroot, simply ignore
the error, as it is harmless and exceedingly uncommon.

FossilOrigin-Name: 7bbf9b3cd6ebf103ebd8347579aef721d0dcd2dc
2015-05-23 19:53:48 +00:00
drh
3183ac590d Earlier detection of a specific kind of corruption in the balance_nonroot()
routine.

FossilOrigin-Name: ee6dc9913a8733891576e6e298241f7440209c5e
2015-05-23 19:29:08 +00:00
drh
3c46b7f7fd Minor documentation improvements. No changes to code.
FossilOrigin-Name: e446d9ce0049b8ce0fd4f03205a0c32776fc76cd
2015-05-23 02:44:00 +00:00
drh
eafdd67242 Merge bug fixes from trunk.
FossilOrigin-Name: 519054bb72e8f8977b11161c81b0e96ba7bca589
2015-05-22 23:51:30 +00:00
drh
cea1dc2798 Fix another bad assert() in btree - one that can be false on a corrupt database
file.

FossilOrigin-Name: 89f0bbfde4d86a7b15e93aab9c487b4355c6fb2d
2015-05-22 23:39:29 +00:00
drh
893ca50d0f Merge enhancements from trunk, including the new sqlite3_value_dup() API and
the addition of the apSqlParam field in the sqlite3_rtree_query_info object
of R-Tree.

FossilOrigin-Name: cdc0ca6fb36e787b981fb544a27c6df838f85704
2015-05-22 23:26:18 +00:00
drh
10ca5b4809 Make sure sqlite3_value_dup() works correctly even for sqlite3_value
objects that are marked SQLITE_STATIC.

FossilOrigin-Name: f332ffc39b7a17fd6254d8dc699293a57a508ba0
2015-05-22 21:04:54 +00:00
drh
9dfedc8246 Fix minor issues with the sqlite3_value_dup() interface.
FossilOrigin-Name: 95edcf5010ecb8edd8eb74279c4766f9b655d4a2
2015-05-22 19:55:10 +00:00
drh
fd29973f11 Update with fixes and enhancements from trunk.
FossilOrigin-Name: 9605d008f5c763137e9734d033fe4510ca316858
2015-05-22 18:40:48 +00:00
drh
e2248cfd2d The SRT_Table type for the SelectDest object is now just an SRT_EphemTab for
which the ephemeral table has already been allocated.

FossilOrigin-Name: b9727e6bbfc3c62c601227e86e62f2f39792fd1d
2015-05-22 17:29:27 +00:00
drh
afe028a815 Fix two faulty assert statements discovered by fuzzing.
FossilOrigin-Name: 799817bfb2bc95963c0e0d70063c4cb15c94ef74
2015-05-22 13:09:50 +00:00
drh
499e15bee1 Fix an assert in btree.c that can be false when using a corrupted database
file.

FossilOrigin-Name: a6eb2a39357c35dc13d549ef86c785ff5c69938a
2015-05-22 12:37:37 +00:00
drh
4f03f413bc Add the sqlite3_value_dup() and sqlite3_value_free() interfaces. Use
these interfaces to enhance R-Tree to add the
sqlite3_rtree_query_info.apSqlParam field.

FossilOrigin-Name: a7ee40c4fc62843ac5b96ba47ca14a66e8cd6961
2015-05-20 21:28:32 +00:00
drh
9263220487 Simplification of the initialization code for CREATE TABLE AS.
FossilOrigin-Name: 937f659e8933011c44e822328a97cb5f0607c04d
2015-05-20 17:18:29 +00:00
drh
9df25c4736 A proposed fix for the problem of CREATE TABLE AS generating a table that
has INTEGER values in a TEXT column.  Ticket [f2ad7de056ab1dc92].

FossilOrigin-Name: d5e2c1fc7625130a3cbacc95c28bb553a0119cb8
2015-05-20 15:51:09 +00:00
drh
00d5ab7405 Fix handling of queries with VALUES on the left and UNION ALL SELECT on the
right and a LIMIT clause.

FossilOrigin-Name: c403502cdce8b82e570e6fc49ab7f5144800c189
2015-05-20 00:15:27 +00:00
drh
7f0cd09cdd Enhance the selecttrace display by showing Select.selFlags.
FossilOrigin-Name: 45d3893c6142ee1dfed48e26a13cf547da12468a
2015-05-19 23:56:07 +00:00
drh
adf3bf5811 Merge recent trunk changes, include the R-Tree enhancement that allows
8-byte BLOB arguments to geometry functions, and the fix for the TEXT affinity
problem that could cause corrupt indexes.

FossilOrigin-Name: 0a0de8b72ca24f287f9c84766a14e12ea4564b59
2015-05-19 22:42:23 +00:00
dan
dde548cb16 Ensure that when the VM applies TEXT affinity to a value it discards any existing REAL or INTEGER value.
FossilOrigin-Name: f5d0ce80792d58ef424300f973f8876d835ed4ad
2015-05-19 19:44:25 +00:00
dan
504ab3b6e5 Add a comment for SQLITE_FCNTL_OTA to sqlite.h.in.
FossilOrigin-Name: efa20f8e41e9370f419f055efa941a8521c68c86
2015-05-19 16:26:51 +00:00
dan
b387e63707 Merge latest trunk changes with this branch.
FossilOrigin-Name: 6055a6725cb24469c10de9a04f3614dcc79193c6
2015-05-19 14:14:57 +00:00
drh
a48bae8819 Transitive constraints should only work if operands have compatible
affinities and collating sequences.

FossilOrigin-Name: 5df4056448fee1c766f8f79c735ed12abdce5101
2015-05-18 12:28:09 +00:00
drh
c4d56dd74b Use an ALWAY() on conditionals in the transitive constraint logic that are
always true as far as we know.

FossilOrigin-Name: 204e567f68e4b3e069f04ca0643c6e5db781d39f
2015-05-18 12:18:37 +00:00
drh
69c15fee98 Refinements to the determination of when an A==B term is an equivalence.
Add test cases.

FossilOrigin-Name: 6bfaf525cac2e0c0a4a3bd3a1fc7bf5bd3234303
2015-05-18 11:34:52 +00:00
drh
df553659ad Make a hard copy of the results of a subquery lest the result of the
subquery be referenced after a change to the table that generated the subquery
result.

FossilOrigin-Name: 9c0d80907b4dee8ee8f205c2ebdb759f5ba1d771
2015-05-18 04:24:27 +00:00
drh
5820118da5 Further restrictions on the use of the transitive property in WHERE clauses.
FossilOrigin-Name: 8c886c43ff0bd5953d289534791d2c6b9dc25445
2015-05-16 20:51:25 +00:00
drh
ea19cc10f5 Fix the transitive constraint processing to only allow transitivity if the
operands of the == or IS operator have compatible affinities.

FossilOrigin-Name: a46a247fbcfe6e63b12cef31353835295a650c9b
2015-05-16 19:17:17 +00:00
drh
e655a0e34e Fix a typo in a comment. No changes to code.
FossilOrigin-Name: ee4b74250ad7a4061421d44b490cb79f649b3720
2015-05-16 18:31:44 +00:00