aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
Commit message (Collapse)AuthorAge
...
* Strive to prevent harmless compiler warnings in GCC 4.8.5.drh2019-05-07
| | | FossilOrigin-Name: 8b6691f619ed9a56f6aecbd878ebb447c40984f8767508b248494fd9ec68fbaa
* Earlier detection of a database corruption case in balance_nonroot(), todrh2019-05-02
| | | | | prevent a possible use of an uninitialized variable. FossilOrigin-Name: c509d8a8aebe0da4847e95cf737c21313a665de9a540da2db57b8ed22f98a402
* Fix an assert() that may be false for corrupt databases.dan2019-04-22
| | | FossilOrigin-Name: b2ce5ed175cb5029ac07392ae371c86eeec23c74624aad007dee51cf359f3eeb
* Use an unsigned integer to count free pages in btree.c:freePage2().drh2019-04-09
| | | FossilOrigin-Name: 8820408597341344b308277ce6ef41b47c7514d6c613520789b05ee52cbedae8
* Fix harmless compiler warnings seen with MSVC.mistachkin2019-04-01
| | | FossilOrigin-Name: 6cf8b18ec20f11c25ff7396f29c742404d3a88d5e97a5fd53ccfaff51dec3f33
* Add a call to sqlite3FaultSim(410) inside of btreeRestoreCursorPosition()drh2019-03-30
| | | | | to simplify testing of error scenarios. FossilOrigin-Name: bb643bac535ac7d5fb4c13edb8782cd13540bbc7d2b2deb689f4ca8d1914f422
* The defragmentPage() routine detects corruption in the first-free-slot fieldsdrh2019-03-30
| | | | | at offset 1 in the header and throws an error, rather than asserting. FossilOrigin-Name: fb125bd338ab32b33d02fe61b76497b6d4a2a160056d6e759e15c94903e61a41
* Remove the unused P5 flag from the OP_Rewind opcode.drh2019-03-29
| | | FossilOrigin-Name: c2edbf3b8c643edcd5823eb907fd7531cf5be8a8b6a014fa1b123eb0ea3231cf
* Add support for new window functions related features - GROUPS frames, RANGE ↵dan2019-03-26
|\ | | | | | | | | frames with logical start and end points, the EXCLUDE clause and window chaining. FossilOrigin-Name: c6da39115d3e2b0fd3a03c4bcae8ee8b05a6bbd6b11f8c54712fbff6387f610d
| * Merge latest trunk changes into this branch.dan2019-03-13
| |\ | | | | | | FossilOrigin-Name: 0b904517bd6c4c59082381577246d3d2351b4265fc9151438ee4c33cf16f2eb1
| * | Remove rows from the ephemeral table used by window functions once they are ↵dan2019-03-13
| | | | | | | | | | | | | | | no longer required. FossilOrigin-Name: 6ad553192051eaa0c6d929baacde2de07b93c6d09de861028bbce55a2c9bfdd3
* | | Earlier detection of corruption while added to the freelist.drh2019-03-25
| | | | | | | | | FossilOrigin-Name: 8c80b004cae71aaf820a31dba80c100ed162ef5bae845fb4535ff4d3be407500
* | | Fix a faulty assert() statement in balance_nonroot() - the assert() should usedrh2019-03-25
| | | | | | | | | | | | | | | | | | get2byteNotZero() instead of get2byte() for the corner case where the number cells is zero on a 65536-byte page. FossilOrigin-Name: bcbe7d96df3c9515f679ccf671ca9ba89d081b53501495d4218eb5126196838b
* | | Add an extra test for database corruption to defragmentPage().dan2019-03-21
| | | | | | | | | FossilOrigin-Name: 80e951fce3e5aaa224c8dba6449832d2efabcdc24e86eb6b7833f85cf08ecc00
* | | Fix various harmless compiler warnings seen with MSVC.mistachkin2019-03-20
| | | | | | | | | FossilOrigin-Name: 1c0fe5b5763fe5cbace9773dcdab742e126d0bd035ab13d61f9d134afa0afc0c
* | | When computing the amount of scratch memory needed during a rebalance operation,drh2019-03-19
| |/ |/| | | | | | | | | assume the worst case for the number of cells per page, rather than relying on the BtPage.nCell value, which might be incorrect for a corrupt database. FossilOrigin-Name: a420ebd08f5a96b9e61a37cb42e1b3f346c23505630d9c33fe30ce7882959b36
* | Detect zero-length free slots on btree pages and report that as corruption.drh2019-03-13
|/ | | FossilOrigin-Name: c4f0568fde1d4070e7522ec36c0958be7426076002a7fa2da12a46411ab2e92d
* Patch makes balance_nonroot() slightly smaller and faster and more robustdrh2019-03-08
| | | | | against corrupt databases. FossilOrigin-Name: 174da3c32c9caebd642c31cb594597ccd5bb2a7fc501b1f49aef0b7b4765bfca
* Detect an attempt to drop a btree that is not within the bounds of thedrh2019-03-08
| | | | | | database file and abort early with an SQLITE_CORRUPT error, to avoid problems later on in the process. FossilOrigin-Name: 235a9698f5e9b3c21dc51c9c5042becfb82fc1762a7519a46b9f9fdafe9b0f13
* If the initial byte of a record is a large value, then always used thedrh2019-03-05
| | | | | | generalized record comparison routine sqlite3VdbeRecordCompare() rather than one of the specialized versions that are optimized for shorter records. FossilOrigin-Name: c1ac00706bae45fe9735061ada025880606cdfb8ecfdaa36b4e2d04275820861
* Add an "|| CORRUPT_DB" term to an assert() statement in the btree defragmenter.drh2019-02-28
| | | FossilOrigin-Name: 6bfd8655f006e031c0d4c988356c4b9206efa6bfdb034fde8ffa3361521a4844
* Use unsigned integers to count the number of pages in a freelist duringdrh2019-02-26
| | | | | an integrity_check, to avoid any possibility of a signed integer overflow. FossilOrigin-Name: 05b87e0755638d31f6d8918f8758362f8c3981661449b5171180a8498f66bd9d
* Fix an assert() that might not be true if the database file is corrupt.drh2019-02-19
| | | FossilOrigin-Name: f2d400db4dbfb05e2540178ed3662f97f8c57a95f8129886c7081c35e53adf0d
* Fix an assert() that might be false for a corrupt database.drh2019-02-16
| | | FossilOrigin-Name: 0cfb888723fb8ff0763bbc23acb7d21a53f6d1c40661d8468248644281b29d85
* Improved oversized cell detection when updating ptrmap pages indrh2019-02-14
| | | | | balance_nonroot(). FossilOrigin-Name: aa61435a4c3800f023788081c1342ad6a05a41449a424fa6c039d5ca46072256
* Further performance improvements to btreeInitPage().drh2019-02-12
| | | FossilOrigin-Name: 93ae382e97c23c90312739481e47ef7f9bc475a8382c063a2de2986c950c0aec
* Change an assert() into a NEVER(), since the condition is difficult to provedrh2019-02-12
| | | | | with certainty. Improved comment on the MemPage.nFree field. FossilOrigin-Name: fec071b89df2cbafda365077bb54bc9999e12086f36d6cea8d125662b36638dc
* Do not invoke btreeComputeFreeSpace() when not necessary.drh2019-02-11
| | | FossilOrigin-Name: f11b0ed47402034378ded2c60b82841b81cd1319cdb72d1ef052faef29a5294d
* Improvements to comments. No changes to code.drh2019-02-11
| | | FossilOrigin-Name: 16eb0fc8f8cce51eaa5305ebc9f3bd8c8d935dd3ebebab6820e5629f9292eec2
* Fix test cases. Avoid unnecessary tests for MemPage.nFree less than zero.drh2019-02-11
| | | FossilOrigin-Name: 480a5090befdc29eaeb6f0b22831c980d6ee92438d9b2e766de68b037ded38b8
* Updates to a comment to keep it in alignment to the changes on this branch.drh2019-02-11
| | | FossilOrigin-Name: 7499f74351415e601eb48eff6b6fccd3a78d137f5ea9cd7cac46b904772966de
* Fix a page-cache reference leak in the btree balancer when there is a corruptdrh2019-02-09
| | | | | database. FossilOrigin-Name: 9285899120dec24ff2944431ad455d7ae217ef408ae2f1a3e7bdfb897099028c
* Defer computing the MemPage.nFree value of an in-memory btree pagedrh2019-02-09
| | | | | | | until it is actually needed, since for many pages it is never needed. This checkin works sufficiently to prove the concept, but still has issues with exception handling. FossilOrigin-Name: 1d43ee4000b71f5c6d49244dee96358c567f09ba3451b9d22895a796d3f61ad6
* Small performance improvement and size reduction for pageFindSlot() - thedrh2019-02-08
| | | | | routine in btree.c that locates a free slot for a cell on a btree page. FossilOrigin-Name: 1969372ac72d25cc642a0268f4bb0ae4b59f2dca568c119ef61b67183b3a8bd9
* Early detection of implausibly sized records to avoid unnecessarydrh2019-02-04
| | | | | large memory allocations. FossilOrigin-Name: 2c8769c69f301307db6663adb8b7c0b89f5959516bf6110cb8ff4b21bd903f70
* Improve the strict enforcement of cell sizes in balancing fromdrh2019-02-01
| | | | | | check-in [12713f320b2c1def] so that it also works with table-btrees in addition to index-btrees. FossilOrigin-Name: ef27e7a08728aa7447ae19812803ac5c4a9d80c97541014bd292485792005a3e
* Fix harmless compiler warnings.drh2019-01-29
| | | FossilOrigin-Name: 9a93c68a7673bda2e6c308d3b2798d0fb12fde399996cae24b1f0d5864adf355
* More robust handling of corrupt database file in the rebalance operation ofdrh2019-01-29
| | | | | the btree logic. FossilOrigin-Name: 97704cb7d29fa7cc4ea9a6761a7844c1946d637ea2b22d287fc787ae0f63c407
* Change the definition of the BtCursor.skipNext field so that it is undefineddrh2019-01-28
| | | | | for states CURSOR_VALID and CURSOR_INVALID. FossilOrigin-Name: 6089d5dba73437d787259033e94a38cf1b0c87cac4a89c27e69d8239c22f496e
* Ensure that the btree cursor is correctly set up prior to backing it updrh2019-01-26
| | | | | as part of a delete operation on a divider cell in an index. FossilOrigin-Name: a3ea1a822d3a110f4f186f2fc8550f435c8c98635d058096b7be9d4df7066b8b
* Fix a couple of assert() statments in btree.c that could fail with corrupt ↵dan2019-01-25
| | | | | databases. FossilOrigin-Name: 5eb5e8289fa71e5e29e081d33d4a59c64b463bf6b06d7070c05c46d77d808ad4
* Fix a potential problem with "INSERT INTO ... SELECT * FROM" (or VACUUM) ↵dan2019-01-24
| | | | | statements on a corrupted database. FossilOrigin-Name: db4b4c2c1e9f1adacfb1b2fedb717a4d8bb0a299c3b11835404a99fcd67bf24b
* Use memmove() instead of memcpy() in a place where buffers might overlapdrh2019-01-24
| | | | | | if the database file is badly corrupted, to prevent warnings from ASAN and valgrind. FossilOrigin-Name: 65ad6c55f1ba9bc2f75afffa3adaf19f145fad7ac9a00ccce6372e9a2cc4341b
* Stricter enforcement of cell sizes when doing balancing operations on thedrh2019-01-23
| | | | | btree, in order to catch file corruption sooner. FossilOrigin-Name: 12713f320b2c1def273dd8b7833dddaaad5331aba779d4b1ec9aa949814f38fe
* Enhance the btree search routine so that it does early detection of drh2019-01-21
| | | | | impossibly large keys and thereby avoids a large malloc() call. FossilOrigin-Name: 3ecaaee69f49e43d38047b7d53b82689eba7f7d33541fcac3c32b6dc8a568458
* Make sure the extra bytes allocated for the saved cursor position bydrh2019-01-21
| | | | | check-in [160b1e31c0f27257] are initialized to zero. FossilOrigin-Name: 2737564929e86ead84a3ff6512369268198d38b46e3e02866f8ce34babc76cb9
* Avoid reading off the front of a page buffer when balancing a corruptdrh2019-01-14
| | | | | btree page. FossilOrigin-Name: cb50509020d952fa9efed8df7fa08b07b71ae9bdbdefea216b6e660863291039
* Improved detection of database corruption while balancing pages from andrh2019-01-13
| | | | | auto_vacuum database with overflow pages. Test cases in TH3. FossilOrigin-Name: 35f04235c477501390acea126d07a730d81d03cdf7abcd82d861e397b3f75b0f
* Fix a problem handling a negative value in the "number-of-pages" databasedan2019-01-11
| | | | | | | header field. Also a problem with running "REINDEX tbl" against a virtual table for which the SQL passed to sqlite3_declare_vtab() contains PRIMARY KEY or UNIQUE constraints. FossilOrigin-Name: 556dd8922f65af93084ee725c638b8dc696b611dd508c212a3b507d6ca474031
* Fix PRAGMA integrity_check so that it does not cancel the PRAGMA vdbe_debugdrh2019-01-11
| | | | | setting. FossilOrigin-Name: aaa3a19f8cf5ba7003634e4610abc7832354af91d7c7f65469218678f66bcd46