aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
Commit message (Collapse)AuthorAge
...
* Performance optimization in the B-Tree cursor allocator btreeCursor(), makingdrh2021-12-03
| | | | | | it about 800K CPU cycles faster in speedtest1, and reducing the executable size by about 100 bytes. FossilOrigin-Name: 9df939716ace8cfe60340bbe83fc52d452ea40c29c856c588f9a1b8973282391
* Remove a NEVER() that was add yesterday. The fuzzer found a new test casedrh2021-11-11
| | | | | to make it happen. FossilOrigin-Name: 83e6ac71073edfa0cd73788c30bdd5f09cb04c8a6a7d5123123dbcd354f430b8
* Make SQLITE_CORRUPT sticky: If a CORRUPT error is returned, all subsequentdrh2021-11-10
| | | | | | write statements within the same transaction also fail early with SQLITE_CORRUPT. FossilOrigin-Name: 3feb0f1c3840904d28fc9a61262820e2b9b764addc1dd178aecc2cd0f952042c
* Merge trunk changes into this branch.dan2021-10-30
|\ | | | | FossilOrigin-Name: 638c1b0c50229800067eb1ba29d829b4d6e008256c21a1f67b4ce4d19ea307b3
| * Remove a NEVER() in rebuildPage that is reachable, as is demonstrated bydrh2021-10-25
| | | | | | | | | | dbsqlfuzz case beac09b2756b5d285aa68f9737fdb06c972f159a. FossilOrigin-Name: ac3f617827e06800d26ef688c5f5480b9621676f141d2eac134f877e0c454149
* | Merge trunk enhancements into the autovacuum-pages-callback branch.drh2021-10-19
|\| | | | | FossilOrigin-Name: c26c9e5040ef4c52f2a99597e3a7c3eabd52c905d874fc76ca10fd54b749fa97
| * Add NEVER() macros on branches that become unreachable due to thedrh2021-10-16
| | | | | | | | | | previous check-in. FossilOrigin-Name: 5fa272cc033216ed2d3b16078db58accf4d9a3d10e6dd64d362ef844b3e267b6
| * Have the btree layer detect when a "DELETE FROM tbl" statement is clearing a ↵dan2021-10-16
| | | | | | | | | | database page that is still in use (due to database corruption) and report SQLITE_CORRUPT. FossilOrigin-Name: a6fda39e81d0da98dd6b60b32e6df786f0089c1f4ac7f3a2936afd118bd04353
* | Demostrate a prototype sqlite3_autovacuum_pages() interface.drh2021-10-15
|/ | | FossilOrigin-Name: bb6f2b8b486c225043bc64e5f74ff6bbad6c5d1f337f0c81eeb6172b087bb943
* Convert an assert() into a corruption detection branch indrh2021-10-13
| | | | | sqlite3BtreePayload(). dbsqlfuzz 848171b5d58f6e4a62257466e0e7de16696d4f02. FossilOrigin-Name: f038d7f90e04838479e44ded00f627ec5ad8e1bd477edea8e87e66dd37485f30
* Fix an over-zealous assert().drh2021-10-11
| | | FossilOrigin-Name: e2bb82a4095427eb810903180fa27fb85b52144bdcfe33388352638428d017f5
* Remove a "harmless()" macro that is no longer relevant.drh2021-10-08
| | | FossilOrigin-Name: 87c357c60168fdc52c82382aa7288d66886f5fbe2ae6af68344dbcfdbca9069b
* Improved detection of database corruption.drh2021-10-08
| | | FossilOrigin-Name: c7fae46c8a3bd78adc5a01340eff6c1efa75f9384dc7f42cb81717b029e7c56f
* Fix a harmless typo in a comment. drh2021-10-05
| | | | | [forum:/forumpost/218c116fdf|forum post 218c116fdf]. FossilOrigin-Name: 8ca0c7d826622c9660ecbd9664eba2bac9bb1b850f96f35d6c959d0acde2309b
* Fix harmless static-analyzer warnings.drh2021-10-04
| | | FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
* Try to fix a harmless static-analyzer warning in sqlite3BtreeTransferRow().drh2021-10-02
| | | FossilOrigin-Name: 5906a0152deded614d965e790a33c67832890828a4835451d65c06414ba71f8b
* Fix harmless compiler warnings.drh2021-10-01
| | | FossilOrigin-Name: 94b59691ee50a4666b25e36d1529fc52f714bbe94c3e8ccb35bf0a4ea11050db
* Back out changes [00286ca5d998d802] and [6844ede29e1dac93] (replacing thedrh2021-09-10
| | | | | | | | | associated branches with NEVER()) and add a single new test to btreeOverwriteCell() that detects when an overflow pages is also mapped into a b-tree page and raises and immediate SQLITE_CORRUPT error before making any changes. dbsqlfuzz 81791bd980fe6935ff2c7334ec8bef11c1c12b82 and others. FossilOrigin-Name: 32210fa4ac4f06e1705ef808731c7be040a23f9a8630986440100c5d4e76dc07
* Remove a NEVER() in btree that is sometimes reachable.drh2021-09-09
| | | | | dbsqlfuzz b9140023005430654c8fe544cf0a082ef8d561c1. FossilOrigin-Name: 6844ede29e1dac93a392dfb1e7e676bb9d0a2e7bbec0a4a5804ffc2025a99b66
* Improved database corruption detection in the editPage() subroutinedrh2021-09-09
| | | | | | of the btree rebalancer. dbsqlfuzz f035b1b5a100a5f0cffb95c958b6c67d7c5eaf1f. FossilOrigin-Name: 00286ca5d998d80214d5e8d501a3b305f432cda1c0ef67ca530e1219565909b7
* Fix a typo in a comment. No changes to code.drh2021-08-23
| | | FossilOrigin-Name: d953646a63bf96a8e6e57fefaa60ae1487e5e4eb776fb38cd9c4ce002e74d016
* Add the sqlite3_changes64() and sqlite3_total_changes64() API functions.dan2021-06-22
| | | FossilOrigin-Name: 48fdec22c966003f5577e0bf52906ef90df11e4e395723a646304e67ed976f37
* Fix a problem causing sqlite3_changes() to return an incorrect value ↵dan2021-06-22
| | | | | following a "DELETE FROM tbl" command on an intkey table (because internal b+tree cells were being included in the count). FossilOrigin-Name: f662ff4746aaa43e63e20710b8cbfeeceab3183e953ac1685c41846d2e9d124c
* Ensure that the cell array used in balance_nonroot() is always large enough, ↵dan2021-06-22
| | | | | even if the pages being balanced are corrupt. FossilOrigin-Name: 53f64e83b39cb56ac7211ffc80d06da13318e1da9dbca7b9123954f5be229a0d
* Remove a NEVER() that is reachable by a corrupt database.drh2021-06-20
| | | | | dbsqlfuzz 8456a0f88e39a49fb675d8f77394979ebb2a03c1. Test case in TH3. FossilOrigin-Name: 1c41e86fa102ec2b73fb7a55357ba6328fda37af316215e8808be88e2d1fd75f
* Do not allow an SQLITE_CORRUPT error to mask a prior SQLITE_IOERR indrh2021-06-20
| | | | | balance_nonroot(). dbsqlfuzz 5e1c86e7f18023f2b9abe3429977d7ea726f50d8 FossilOrigin-Name: 50e818767e423991b99b3155cb15a0d1c1b744ab6139a8273f9348aab9a53d9c
* Remove unnecessary (redundant) variable initialization fromdrh2021-06-19
| | | | | sqlite3BtreeInsert() for a small size reduction and performance increase. FossilOrigin-Name: 70d1836474207fa045ff7aa513839c9df26ea6e180eb898b30d89bd5b3833f58
* Split the sqlite3BtreeMovetoUnpacked() routine into two separate routinesdrh2021-06-19
| | | | | | | sqlite3BtreeTableMoveto() and sqlite3BtreeIndexMoveto(), since we usually know the type of btree in advance. This results in less branching and better performance. FossilOrigin-Name: 3b0d34e5e5f9a16c3397e4551f3b534729b1b375770f05f6ed5847818b1f4c0b
* Avoid use of uninitialized memory while running defragmentPage() on adrh2021-06-07
| | | | | | corrupt database file. dbsqlfuzz 4c45cecc0b255aaf2ea85453ccd17e814fd0b6b2 FossilOrigin-Name: 35e40d75754ec6fb93fe57c6ecbe731104e77c997d7e17ef1a22984837dfcab2
* Fix the truncate optimization so that PRAGMA count_changes and changes()drh2021-06-03
| | | | | | return correct values even for a WITHOUT ROWID table. [forum:/forumpost/07dedbf9a1|Forum post 07dedbf9a1]. FossilOrigin-Name: 820ae3b117c2d8c117c0c5a4e440a7d06886772516c7fc0a84606388f91be195
* Fix harmless compiler warnings.drh2021-05-17
| | | FossilOrigin-Name: ace12a3912a4fdc2f0e741361ec705652a11b6f5e3548d54bd6f273671ba1e09
* Performance optimization to the clearCell() routine inside of btree.drh2021-05-15
| | | FossilOrigin-Name: c4e02619a4dc8b07f658e7c88011991a086eb1e760d920b9024a11437daaabfd
* Small performance improvement for sqlite3BtreeInsert().drh2021-05-14
| | | FossilOrigin-Name: 4ae64484c57740333322cebd713b50b01a5a5838d41c65f67e26d65769770789
* Fix a NEVER() that can sometimes be true.drh2021-05-11
| | | | | dbsqlfuzz 9a86fb3830977e216fde061bfbe1c1e5c2e9bfc4 FossilOrigin-Name: f39666e64d6d32420170c54f874d8314eb8c6f91df625f7b28f9ccffb9474dc0
* Improved detection of oversized cells in balance_nonroot(), especially indrh2021-05-06
| | | | | | index b-trees when a cell is being moved from a child page into the parent page in order to become a new divider cell. FossilOrigin-Name: 9080d3d5f5aaddbb3410158bcc446649651b7dce3940eb3491620ec9208914b4
* Fix a problem that could cause a crash in sqlite3BtreeDelete() when ↵dan2021-04-26
| | | | | operating on a corrupt database file. FossilOrigin-Name: 6c6334660dfe81cc33a14b87b25d748b1c98b0702b7bc6db2e3ced16dc992740
* Change a memcpy() into a memmove() to prevent a warning about overlappingdrh2021-04-22
| | | | | | regions passed to memcpy() in case of some obscure and unlikely database corruption. FossilOrigin-Name: bab132cbd18a529389a0315e60f30ccf1b565823116e0ec9b4f7684db1914c80
* Remove a testcase() that is no longer relevant due to the previous check-in.drh2021-04-20
| | | FossilOrigin-Name: ca70c8ac72c9fe3b92f8e63151229bebdccc769c5c4d603ad4f466dc4bcd11e0
* More aggressive detection of database corruption in the rebuildPage() routine.drh2021-04-20
| | | FossilOrigin-Name: a18c65068b16eae3c0725356d7f4775774b23e248c700cef8c15f23459fba68f
* Update an assert() in btree.c that may fail with a corrupt database.dan2021-04-20
| | | FossilOrigin-Name: d74bf88c5a027cf080a2892a3538fe5104952b5b3759a6eba1b1a98a75ddf5f4
* Avoid an uninitialized-memory valgrind error by tightening up corruptiondan2021-04-10
| | | | | detection in internal routine defragmentPage(). FossilOrigin-Name: 8096f7aee497f852b1404e13cdc8bafb54fcf6c540cd58addbc01eb2e27011b3
* Add NEVER() to a branch that became unreachable with drh2021-04-10
| | | | | check-in [58f36af2271517ab]. FossilOrigin-Name: e07ce463967521ab53463b21f80c8f90c337c15c250f69c3fccc1305f54f32df
* Remove a NEVER() in a corruption detection conditional in allocatePage().drh2021-04-09
| | | | | dbsqlfuzz 9c61c33802600b2b01dfb09b0386ceb4ade02a19 FossilOrigin-Name: c174f5d32b8c6bbad102065b2d5acae70ddb153f863a2842da836cf7db3f683f
* Handle the corruption fixed by the previous commit in a different way so as ↵dan2021-04-08
| | | | | to also fix dbsqlfuzz crash 753de0a0ac5b25b18f1e4d41e650d3333cdc270c. FossilOrigin-Name: cb27ce25095ab9b5acbe4bf010c7f6d8a71191c2f79b3bf3e63d8655b4fe0769
* Handle a special case of corruption that can present if "PRAGMA ↵dan2021-04-08
| | | | | writable_schema=1" is set. Fix for dbsqlfuzz test case 6229ad63de49e3ba0630aaf0058868f36008bcca. FossilOrigin-Name: 58f36af2271517abafa9f4a46f2a5f97e66c001675c17868282197d599603d1b
* Earlier detection of page 1 on the freelist (which is impossible) anddrh2021-04-07
| | | | | | reporting of that as database corruption. dbsqlfuzz 6fe6c504b320be5e3eed66896cb0db28bfb38a93. FossilOrigin-Name: b1bf0d987578160f002035ff41ec7c82011288f1c0449414a4b3da39b20f871c
* Update an assert statement that could fail when using "PRAGMA ↵dan2021-04-06
| | | | | writable_schema = 1" to access a database with a corrupt schema. FossilOrigin-Name: 55cad6f628a4313c6652b36474c3397f097ac5c2503ae94605c030a54dc40916
* Fix an assert() in sqlite3BtreeLast() that needs an "|| CORRUPT_DB" term.drh2021-04-04
| | | | | Dbsqlfuzz case b92b72e4de80b5140c30ab71372ca719b8feb618. FossilOrigin-Name: ad718388a1f6e25ceba43a40160fac0d9d9d3f26888e98d7b9db478c0b1780be
* Fix the OP_OpenDup opcode so that it is able to duplicate a cursor thatdrh2021-03-18
|\ | | | | | | | | | | was itself opened by OP_OpenDup. Add additional verification of ephemeral tables. Fix for ticket [bb8a9fd4a9b7fce5]. FossilOrigin-Name: bcbe5308f3a3b94f965b0f5627cb29cce2e09343b86d757e2de889f7773576e7
| * Remove unnecessary code from sqlite3BtreeClose() and add test cases.drh2021-03-18
| | | | | | FossilOrigin-Name: edbfdcaefae1e9a42c046c058341bf5b0f533c0b0cbd39543fcaa2a83d67561d