aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
Commit message (Collapse)AuthorAge
...
* Remove a NEVER macro in defragmentPage() that dbsqlfuzz discovered can bedrh2022-09-18
| | | | | true. crash-32d9312f145cdce41613573f6431d9a3e439e3d7 FossilOrigin-Name: 90403759e1cf30f7c11fa8170d6df59a0dd138e1de59d2b60bec7ba15d74f67c
* Enhance the b-tree page sorting code to ensure that sqlite3PagerRekey() neverdrh2022-08-31
| | | | | | overloads a page number and uses only the PENDING_BYTE page for temporary storage. FossilOrigin-Name: 5007742886bd20de20be3973737cf46b010359911615eb3da69cd262bd9a2435
* Ensure that every pcache page always has either the PGHDR_DIRTY or thedrh2022-08-27
| | | | | | PGHDR_CLEAN bit set, even during transient page reshuffling during btree balancing. FossilOrigin-Name: e67f03c166277951725c194674c84da61c152a5820aa6df55a726f7dda838e92
* Omit a unused variable initialization in order to suppress a harmless compilerdrh2022-07-26
| | | | | warning. FossilOrigin-Name: 2d703c5e941cac72efc21d58e1e35c446b338b2927a42f587ab788826fd7f3f1
* Very small size reduction and performance increase in btree.c.drh2022-07-07
| | | FossilOrigin-Name: 9a7c031a822246ee36bc440c7492e9c8ebeec6bc7066e56f114756b1881b2eb8
* Size reduction and performance increase in defragementPage() of btree.c.drh2022-07-07
| | | FossilOrigin-Name: 1b03f197b5572084177012a58990f8dba7ff10382ff5657fda62867a4d0b1af9
* Size reduction and performance increase in the pageFindSlot() routine ofdrh2022-07-07
| | | | | btree.c. FossilOrigin-Name: 5d247e38560b97975568e8a48324acaca1002ec2ef7fa3efc9c8aa7d83412aad
* Size reduction and performance increase in the freeSpace() routine of btree.c.drh2022-07-07
| | | FossilOrigin-Name: 7d7aed053f600659c63d8bac6d5da77879936c3fc57bfd058a4943b3bc530575
* Fix an assert() in btree to be more precise, as the previous form of thatdrh2022-07-05
| | | | | asser might fail due to recent performance optimizations. FossilOrigin-Name: 4774938134d0105423720bdc1b4e82164a1e28d993c5cd81c1b03f1f0878427e
* Remove debugging code that has always been commented out. Cosmetic change.drh2022-07-03
| | | FossilOrigin-Name: b54064170c51a2c905f98737c224e19c06dc728342ca2224e32ebeb47f803bcd
* Follow-up to check-in [0057bbb508e7662b] - ensure that the database pagedrh2022-06-19
| | | | | | | has been initialized prior to continuing with the optimization. If the page is not initialized, that indicates that the database is corrupt. dbsqlfuzz 09ee46becd5e6d1b2a55c9f8ad767335a90aadb0. FossilOrigin-Name: 11162446f12ae3af6e4a63bb5c374129b2505f6006f91d4028c7165f05fe9651
* When running an incremental vacuum, detect growth in the size of the databasedrh2022-06-15
| | | | | file (which can only occur if the file is corrupt) and fail with SQLITE_CORRUPT. FossilOrigin-Name: cd7a44124558ea6a43c89b1cba4402d7bf6a6ccb83be0eeb7dd01b56933bca73
* Fix an assert that is incorrect for a corrupt database.drh2022-05-31
| | | FossilOrigin-Name: fe0a840805b435efd38a953a8aae60e29a35289f9d9955472a8bab2bce7051c8
* Avoid an assert() failure in allocateSpace() triggered by a corrupt ↵dan2022-04-18
| | | | | database. dbsqlfuzz f022eb0ce64d27808574d1dcde5cf7d002dabde8. FossilOrigin-Name: 2de7f8cc7fe18f0828bb53f1fd11f5eb828faf4d6dfaf39693dff4f8926c1c7a
* Fix an assert() in btree.c that might not be true for a corrupt database file.drh2022-04-13
| | | FossilOrigin-Name: dbd8e2e46cfb2de0ebdbb62cda2fe669df3eda98f5d6112d541f581995b1361d
* Earlier detection of corruption in balance_nonroot(). dbsqlfuzz ↵dan2022-04-12
| | | | | 9191ade77ebd3b7a3356e074957aa85b0c669d14. FossilOrigin-Name: bff4f083eb1c35544988493a5d73a42e646c4250b841f5aae38c2183f0867a0e
* The putVarint32() macro does not optimize well. So expand it into in-linedrh2022-04-01
| | | | | code in places were performance is an issue. FossilOrigin-Name: 390c239e53cf936a97b268dce8171f0b17050542ae64735ca8ef375fec2c9544
* Fix harmless compiler warnings.drh2022-03-31
| | | FossilOrigin-Name: b916087aacba53530d2bd19eef2a4fd7a253bf7fa87b49e0df17f7987d7164ae
* Avoid unnecessary calls to balance() from sqlite3BtreeDelete().drh2022-03-29
| | | FossilOrigin-Name: d0966d1bdd474e27cb048884d340184f0e81a4fab65eb6b74682b20630caddf8
* Ensure that database corruption does not cause the cursor passed intodrh2022-03-22
| | | | | | sqlite3BtreeDelete() to be invalid. dbsqlfuzz 209bf3de9ee11ae440848ab9bc9c13858f9be2e4. FossilOrigin-Name: a85126f96614c53b030c6e6c43ff239eae458048597a10e9a0361fcec8628ecf
* Some branches are no longer reachable after the previous change. Mark themdrh2022-03-21
| | | | | accordingly. Also improve comments. FossilOrigin-Name: 88d69f60cceb22bde42cfe43c23259c7bad47b8e06f918a79bd089a77b480d46
* Strengthen the defenses against corrupt databases in thedrh2022-03-21
| | | | | | sqlite3BtreeInsert() function of the btree module. [forum:/forumpost/c7ec29905f|Forum post c7ec29905f]. FossilOrigin-Name: 4df301c8610c4c36b4eb360d49ccaef873c63ea719ccb14b357754ff0b3ea5ef
* Fix a harmless compiler warning and restore performance in thedrh2022-03-11
| | | | | sqlite3BtreeIndexMoveto() last-page optimization. FossilOrigin-Name: 8b032293b384c3728c27b0658ee634c028c0d231d067de8b747d2e9e4ae704a7
* Another corruption detection case in the sqlite3BtreeIndexMoveto()drh2022-03-10
| | | | | last page optimization. FossilOrigin-Name: 531e6ad0389c6c820bb8c64db5049fb6b0bffd30bd394fd8ee7412959b1752e2
* In the sqlite3BtreeIndexMoveto() last-page optimization, make sure to returndrh2022-03-10
| | | | | SQLITE_CORRUPT if corruption is detected. FossilOrigin-Name: 4ef19ba9b5cbda435c0bb9f2faddf8f7fac5d51399ff69bd049571c2ca3d9357
* Fix compiler warnings.drh2022-03-08
| | | FossilOrigin-Name: 5e30c6ea707f9d381127e8b2bb59e0b39bc00997da2c14d32a0e302d0121203b
* Disable an assert in moveToRoot() when the database is corrupt.drh2022-03-07
| | | | | [forum:/forumpost/e9a176b7bd|Forum post e9a176b7bd]. FossilOrigin-Name: ae464a18d74bf44fc95bc335e75e6a57dc974f6d6a3d603133594039fb589af2
* In the stay-on-last-page optimization for sqlite3BtreeIndexMoveto()drh2022-03-07
| | | | | | | (check-in [0057bbb508e7662b] about 16 hours ago), be sure to clear the BTCF_ValidOvfl flag, since the overflow cache is invalidated by the search on the last page. OSSFuzz issue 45329. FossilOrigin-Name: 0021bebc162e001b788786703ce634e7b8fcd3976f7047a5956e82140791e765
* Optimizations to sqlite3BtreeIndexMoveto() avoid unnecessary comparisons ifdrh2022-03-07
| | | | | | | the cursor is already near the end of the table and is not moving far. This case is more common that you would expect. The optimization saves almost 4 million CPU cycles. FossilOrigin-Name: 0057bbb508e7662b0da19e981c07ef10236cb616bda952745de3aa2d1c286289
* Fix obsolete but harmless comments in btree. No changes to code.drh2022-03-06
| | | FossilOrigin-Name: 4838b888e431f794b8a5ee65e797b3bf0616c03261de4e1fc9499287eb3e1265
* Make sure the xParseCell and xCellSize methods of the MemPage object aredrh2022-03-03
| | | | | | initialized consistently even if the page is detected as being corrupt. dbsqlfuzz fd21f341f3b4f582401d2feb2a1c0c4cc2c26caa. FossilOrigin-Name: 725a06434b886c96bb816340ef236530672a4593f0ceb3230ce69c8367beb997
* The MemPage.aDataEnd field should point to the end of the data buffer fordrh2022-03-01
| | | | | | | | the page, not just the end of the usable portion of that buffer. The purpose aDataEnd is to detect cells that overflow the page, and that won't work on a page with reserved bytes and a cell that starts in the reserved region, unless the boundary is at the very end of the page. Chromium issue 1276294. FossilOrigin-Name: f839c0bc8388a31f6db5081906b66b9e129855ba27a13cf13bd995b083f7386e
* Fix a minor typo in a comment.drh2022-03-01
| | | FossilOrigin-Name: 86ba06aa4c55d3aefe030b19b2b5c08baf46bbb2218b04ac1228ab76682a929b
* Fix two assert() statements in btree.c which were not true in the case ofdrh2022-03-01
| | | | | | a corrupt database file. [forum:/forumpost/14819f2063|Forum post 14819f2063]. FossilOrigin-Name: 3b36ed79d82fae47a08a7d27f4fcefb7978fdf0e7f8c0f4a82f59501f201b32b
* Fix slightly-incorrect assert() statements.drh2022-03-01
| | | | | [forum:/forumpost/f1e83b77b5ff37db|Forum post f1e83b77b5ff37db] FossilOrigin-Name: 3c9f5c9defd7d36684132ae4ade9db2e2148dad4bd91bfe9374620ecafc35348
* Fix an assert() so that it is still valid following OOM with the latestdrh2022-02-24
| | | | | enhancements. FossilOrigin-Name: ecf832f71fbaee36ee10f6da5bde19a8af9f90adbba06e8c5706d18b768bae1f
* Add a new subclass for MemPage.xCellSize specifically for the case of a leafdrh2022-02-23
| | | | | | page in a B+Tree, that is optimized for that cases. This gains a half million cycles or more at the cost of less than 200 bytes of code space. FossilOrigin-Name: 7ad829224adbec5d74ff9e5ab040eb2ad3e17fe45da7a2cf0cca770a0731401a
* Optimize calls to get2byte() in btree.c for almost a one-million cycledrh2022-02-23
| | | | | performance gain and a few bytes less code. FossilOrigin-Name: 41061f29969dc546c2702f7f412127070a4dd54593827692df93a83c939dfb61
* Minor correction to the early corruption detection added bydrh2022-02-14
| | | | | | [a6fda39e81d0da98|check-in a6fda39e81d0da98] so that it works even if the page being cleared in page 1 of the database. FossilOrigin-Name: a5ec16907ef6ab50e041101d87c5756c71469923872a86c3ab383f188673d7a5
* Fix a bad assert() (it needs an "||CORRUPT_DB" term) in b-tree, discovereddrh2022-02-14
| | | | | by dbsqlfuzz. FossilOrigin-Name: f5f263cc626d6a8bea3e85e28bb716e3eac0d9cd199cc060c0c8b0c77b280a45
* Never allow the b-tree layers view of the number of pages in the databasedrh2022-01-17
| | | | | | | file exceed the actual number of pages in the database file, even when PRAGMA writeable_schema=ON. This helps with earlier detection of corruption, and prevents excess memory usage and CPU cycles in some integrity_check ops. FossilOrigin-Name: 0407c8793700491b8519a649b9624f569b0e7e9b94d0db79d4a08139e0ecdb69
* Fix harmless compiler warning seen with MSVC.mistachkin2022-01-12
| | | FossilOrigin-Name: adebb9d7478d092f16fb0ef7d5246ce152b166479d6f949110b5878b89ea2cec
* Remove two NEVER() macros that can sometimes be true if the database isdrh2022-01-05
| | | | | corrupt. dbsqlfuzz 0414d2c18290fc80fd5fb540def7d3e46c1ae9c6. FossilOrigin-Name: b6a82f3c3b9d89fdf628c7f117b6a4a64383a36c84fe84d47c80e845c9bd8a4f
* Remove unnecessary assignment operations in the btree search algorithm,drh2022-01-02
| | | | | for a small size reduction and performance increase. FossilOrigin-Name: 01bd266eb682feed901a0995c2232b62d8444d19dbb227095dfbfe8edeaa5d88
* Performance optimization in btreeParseCellPtr() by unrolling the loop thatdrh2022-01-02
| | | | | decodes the rowid. FossilOrigin-Name: fef72368a2eef5cb68ffc56e4f01be212d5e3318ebdb56a23ab26e1ef454272e
* Small performance optimization and size reduction in sqlite3BtreeDelete().drh2022-01-02
| | | FossilOrigin-Name: da0af4dd9ba4180a16543fac1549fd4ccecdc66dcf6d275f77de21fd80708882
* Earlier detection of corruption in sqlite3BtreeDelete(). Fix fordrh2022-01-02
| | | | | | the assertion fault reported by [forum:/forumpost/9d78389221|forum post 9d78389221]. FossilOrigin-Name: 13e9ff9e84a114374b49986484dbee05953a496f3017dd5089fba6f495a17c40
* Fix harmless compiler warnings seen with MSVC.mistachkin2021-12-31
| | | FossilOrigin-Name: a9bfb621091b6d92d1caeb69134d3809d9e0b43fe764608c5995db277ac785be
* Small performance optimization and code size reduction in moveToRoot().drh2021-12-13
| | | FossilOrigin-Name: cdcde00b2d68eeb35c472fdfd4c4508551f6722054394b43cc97eaf01ad7181d
* Fix unreachable branches resulting from prior optimizations.drh2021-12-03
| | | FossilOrigin-Name: f3d6853ee80be2dc6d7236d98b850beb0e1931a624d4f5b194c8db742cde7ec5