aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
Commit message (Collapse)AuthorAge
* Tamp down various harmless compiler warnings. Use "int" in places insteaddrh2025-02-22
| | | | | | of "u16" or "i16" since the compiler complains less and generates faster code. FossilOrigin-Name: 742827f049768c4f69ccdfaadfad339aaad3bc126d3a68b90cfea01d825bf7ce
* Code changes that make it easier to prove that no 32-bit integer overflowsdrh2025-02-17
| | | | | | happen during memory allocation. No problems fixed; this change is just to make future maintenance easier. FossilOrigin-Name: 215650a5a1d55bdbca9c92524804a1a54456a17f42a17e53747b21a6507506f5
* New assert() statements to validate OP_OpenEphemeral logic.drh2024-10-18
| | | FossilOrigin-Name: 6d55c3e238e06c6727f3e816a9268b6222ebfc90ec745bbbd48430bf7b16664c
* Fix a case where the BTCF_AtLast flag was being left set incorrectly. This ↵dan2024-08-29
| | | | | was causing obscure window function queries to fail. FossilOrigin-Name: e042eb024738a83eed92cd2dfac3d2a50d2589715a3d81b1a494564dd7d8e7fa
* The previous check-in was a little two aggressive about skipping thedrh2024-05-27
| | | | | initialization of entries in the CellArray.ixNx array. Fixed here. FossilOrigin-Name: 1b6d1fbcdecf14bc79dc7b5df50e585d2fcc1484a9987b863c190e8f7ba2c39f
* Very small performance increase and size reduction by removing unnecessarydrh2024-05-27
| | | | | | ALWAYS() macros from the btree balance logic and replacing them with special initialization of CellArray and some assert()s. FossilOrigin-Name: 32b79041d9b6858e4ffade5841898619c7d25d20c4638bf85447a2ca9cc4a3d3
* Add new assert() statements to help out a static analyzer. Response todrh2024-05-27
| | | | | [forum:/forumpost/17fe8ac32e0de4f5|forum post 17fe8ac32e0de4f5]. FossilOrigin-Name: 857f6d530949221d154b5120ecc2aa906418bec6f69d1c13197a432ba3cad8eb
* The first assert() added in [0ebc65481f4a3e79] is not necessarily true in adrh2024-04-15
| | | | | corrupt database file. So add a term to make it true. FossilOrigin-Name: 6b21cccdeec92db9f6ce3dd7ea5e61b8b46650cc1e550271aa51bdc619f55b11
* Add assert() statements to help verify the overflow page cache.drh2024-04-12
| | | FossilOrigin-Name: 0ebc65481f4a3e7974558adea51c620a025bc0e76c0a139e549b56c5abe0cabb
* New assert() statements to verify the correctness of the BTCF_AtLast flagdrh2024-04-12
| | | | | on btree cursors. FossilOrigin-Name: 4efecd6167de71500c90b63155eba1b8567c90e9d1e282fbea54130f9ee21813
* Mark the BTree cell overflow cache as invalid whenever the rowid goes invalid.drh2024-04-12
| | | FossilOrigin-Name: 74c9e19c92c887012aebbe96450f6ed7a60ba22d6e3edbaa39a0f989fb7f2901
* Add an assert() to help scan-build recognize that a variable is initialized.drh2024-02-27
| | | FossilOrigin-Name: 10d26f1ee8e7624cbb957332b4397d2f1fcdaf916acec93077f2ddd33e01f1d8
* Remove unreachable branches from the PRAGMA integrity_check enhancement ofdrh2024-02-27
| | | | | [b736519d3d2e93c7]. FossilOrigin-Name: 6d02fb233fb86f9907cc374d06a7ed71a638091d6e75abc199001c42eab51e5c
* Have "PRAGMA quick_check" compare the number of entries in tables and indexes.dan2024-02-27
|\ | | | | FossilOrigin-Name: b736519d3d2e93c76fa36253143f2664b9dd12e26acba555f0bf9c4d44705499
| * Have "PRAGMA quick_check" compare the number of entries in tables and indexes.dan2024-02-02
| | | | | | FossilOrigin-Name: cc294c041b4c7a044ff344989f872415ced5263a0b654112371b2da7c852a688
* | When inserting a 3-byte cell into a btree, ensure that the extra padding bytedrh2024-02-26
| | | | | | | | | | | | is 0x00. This is not necessary for security, as far as I can tell, but it seems like a reasonable precaution. FossilOrigin-Name: 5766f1279dab91e030d4dcf5133659e5cedf914a1628ccf00d67d8e50a9957fd
* | If a table has one or more rows and it has a partial index has zero rows,drh2024-02-19
| | | | | | | | | | | | still make an entry in the sqlite_stat1 table for the partial index, so that we know that "PRAGMA optimize" does not need to redo the whole table. FossilOrigin-Name: e147b18991dd462fff367442acb0504fdf193a31843ed34ec8c1ced30747bf8a
* | Add a new sqlite3FaultSim() call in the btree logic, for testing.drh2024-02-12
| | | | | | FossilOrigin-Name: e0558f79b8184ea6741fb20b710dab854f5bdb71aa47d5a6701eeb7389540c8c
* | More extensive use of SQLITE_CORRUPT_PGNO.drh2024-02-02
|/ | | FossilOrigin-Name: 3838332cffb87f77a7c6b357066a59b9dc4f65ef4b3496767ad7ad7c14a77be2
* Add tracing logic to the shared-cache locks in btree.c. The tracing isdrh2024-02-01
| | | | | | off by default. Enable by changing a single "#if 0" into "#if 1" and recompiling. Debugging code only - no changes to release builds. FossilOrigin-Name: f2b943f97ad7e47848ac6df3a3a1eba134b9e63c4a631f8eaf8bda77cc02ba7b
* Apply the same fix found in [99057383acc8f920] to descending scans.drh2024-01-28
| | | | | dbsqlfuzz afd1d61fc27d14938a0d78a50970fa1e9fbfee5. FossilOrigin-Name: e1d463c2d6e93e0ae0a60a05a79cd346bd07142de2fe631b370a9b946763b5d6
* Back out [b517a52fa36df0a0] which is no longer reachable due to earlydrh2024-01-02
| | | | | error detection enhancements in [166e82dd20efbfd3]. FossilOrigin-Name: 704943e96f2620b99260667ac9922c2f72bc3e92e2dfe1d9c2a91c7b704564d9
* Cleanup shell.c comments. Hide -utf8 option, as it is undocumented and ↵larrybr2023-10-27
| | | | | accepted only for backward compatibility. No functional changes except for -help content. FossilOrigin-Name: 3a87995560b5acbebeb5af407aa9eddf4c37c6a27ec9429ece0ea931918f9d9c
* Back out [2904fcbeebba9189], mostly. The page bitmap is needed even for adrh2023-10-27
| | | | | | partial integrity_check in order to avoid an infinite loops while walking the database. FossilOrigin-Name: dd6e03b37356e2961abd97f636402c09744c98c3033f3435503958c6219f9121
* Fix various harmless scan-build warnings.drh2023-10-24
| | | FossilOrigin-Name: 54be9af4469d7e31ee852f67e5aa32996557c10de654a60103fd165d2fedf311
* Avoid an unnecessary malloc() for the page usage bitmap when runningdrh2023-10-21
| | | | | a partial integrity_check. FossilOrigin-Name: 2904fcbeebba9189cebc48e58d12fc46f78ee23d8c4d46644606691f8cabb80c
* Earlier detection of a host of errors in CREATE TABLE, such the CREATE TABLEdrh2023-10-13
| | | | | | statement itself fails, rather than generating an error on the first attempted use of the created table. FossilOrigin-Name: 348fa7aaf7958b3fb689ed023d946064ae8d92718a497a346e95114a2410cbf5
* Improved detection of corrupt databases in balance_nonroot().drh2023-10-05
| | | | | dbsqlfuzz d1cf013c50a620b68c2a5bd240d29afd65e5f58e. FossilOrigin-Name: a2464bbb825b5976ef974a2e6c17ea150f5e6fcd0dd0f144b9f9c1c22a9c9c82
* Remove a stray blank line from the beginning of btree.c. No functionaldrh2023-10-05
| | | | | code changes. FossilOrigin-Name: c89983dcfc208faa86b31717144c069572598e9770228264d69a044a84bde277
* Remove a NEVER() in btree.c that could actually be reached, with the approriatedrh2023-09-17
| | | | | database corruption. FossilOrigin-Name: d1fd00e0875f881cacdc581a75215ec1872a81969ac07b8ebe3aaa707a9a3640
* The OP_Column opcode caches large column values coming from overflow pages.drh2023-07-27
| | | FossilOrigin-Name: ab1edcc7fedcf27922d5db4bc1bc673b1495ca9c66eb6debdda7b7776c068888
* Fix an off-by-one error in tests for cells overflowing the end pages. Thedrh2023-07-13
| | | | | | | error is completely harmless for the default page cache, but might cause problems for application-defined page caches that pack pages tightly together. FossilOrigin-Name: ce6793e954f291b6f5c29175baf730ce217328de1f0601b8935daac62af5f448
* Fix harmless scan-build warnings.drh2023-07-08
| | | FossilOrigin-Name: beab3c98639be531744e60440223bb9ee76bc15234aff05e5efb273c8241dfd8
* Simplification to the getAndInitPage() routine that results in improveddrh2023-06-22
| | | | | performance. FossilOrigin-Name: 2e9734c2335d8c06fedc9f4cca02baaf326f7fa276bd464f3214f383715a48d6
* Improved comment on the getAndInitPage() in btree.c. No code changes.drh2023-06-21
| | | FossilOrigin-Name: dc468cfdb825083b3a4b6cb95c913961e9312e22103c5a0cd923b75c83c65e13
* Address various harmless compiler warnings fromdrh2023-06-16
| | | | | [forum:/forumpost/d526da8ee4|forum post d526da8ee4]. FossilOrigin-Name: 365caf2f97e8f15842f52536e8d05d359e9d6e863182e020ce14a9a9f27ee057
* Check-in [70e12efd1b189560] left a path through lockBtree() that failed todrh2023-06-12
| | | | | | set the BTS_PAGESIZE_FIXED flag. That omission is fixed by this check-in. dbsqlfuzz 02c9ab74eb0619c9ae3b894ce157fae1d7f94645 FossilOrigin-Name: 30dcc872eb1c9549708009c86357826c4f15ffa17e379dab5cd4aec596643728
* Defer setting the BTS_PAGESIZE_FIXED flag until after we are certain theredrh2023-06-10
| | | | | are no errors and the page size has been set. FossilOrigin-Name: 70e12efd1b189560e07f59db03a20b8c1ab19224aae4fc3d7c0bdfd2568064ea
* Simplify a memcpy() in defragmentPage(). It now might copy more content thandrh2023-06-09
| | | | | | | | | is strictly necessary, but runs faster and uses less code space. Possible reasons for the improved performance: (1) the copy is now always 8-byte aligned, (2) fewer intermediate results are required which means less register pressure which helps the compiler to optimize the subroutine. FossilOrigin-Name: 6e5607ae4d872954483a8d7a5c866aa41e4af70fae9652fb7eb211b316ab724d
* Fix straggler misspellings and tidy the custom dictionary. Also include ↵larrybr2023-06-07
|\ | | | | | | | | pickups from [forum:/info/c61fb09afd|forum post c61fb09afd]. FossilOrigin-Name: 8c291d99946eb32b20b743921202f9c7cfb716268ff526817b27adbb7942e40b
* | Add a C-source spell-checking facility. make misspell (on Nix)larrybr2023-06-07
|/ | | FossilOrigin-Name: 26c1bb4bd9e9f56613c3aa87407a7f562fd4ebde5bfd6dece02078001d9a45f8
* Fix incorrect b-tree root page reports from the enhanced PRAGMA integrity_checkdrh2023-05-18
| | | | | output introduced in version 3.42.0. FossilOrigin-Name: 9b538f62539bcde7d7d7ad06eccdc558ecbd3f9160db35197568f4d3b4247c76
* Fast-path the btree transaction start for the common case where adrh2023-05-17
| | | | | transaction is already active. FossilOrigin-Name: 798c3ff20c606b5f9fde16dc67781f238370a7c450bc239c3a98d0f4ca370399
* In editPage(), if an attempt is made to edit an empty 64KB page, then takedrh2023-05-08
| | | | | | | the slow path through rebuildPage(), in order to maintain strict invariants in the editPage() code. [forum:/forumpost/0f37727c0d|Forum post 0f37727c0d]. FossilOrigin-Name: a865e574e510c1ca192d0bd5293fb583def90f7ed086af2c89ca856ce93d115b
* Fix harmless compiler warnings.drh2023-05-01
| | | FossilOrigin-Name: 342af5b4fa0bd7c699e5497161db13d0cf795c7a5875ae30d666122e518f213b
* Fix an incorrect assert() statement in btree.c as found bydrh2023-04-22
| | | | | [forum:/info/d03345d572713fe6|forum post d03345d572713fe6]. FossilOrigin-Name: cd485b302c54aef066d751a153df34eea0cd23e54a414e291f636ad9929fe78a
* New assert() statements to validate the parameters todrh2023-04-10
| | | | | | | sqlite3BtreeCursorHint(). Fix a problem with the construction of those parameters discovered by [forum:/forumpost/0b53708c95|forum post 0b53708c95]. FossilOrigin-Name: 4c5a3c5fb351cc1c2ce16c33314ce19c53531f09263f87456283d9d756002f9d
* Guard against oversized cells in the newly enhanced pageFreeArray().drh2023-04-07
| | | FossilOrigin-Name: 2dcdbb50356edbd3a79e53fa0bee4e700c2bdea78e27173b62ddabe44b066726
* Add NEVER on an unreachable branch.drh2023-04-07
| | | FossilOrigin-Name: 9b3febbd988be05807ada20146d3e196ae17c966722fff049feb32292157bff2
* Fix an assert().drh2023-04-07
| | | FossilOrigin-Name: 7eff46ba97dd8a3d6a5d01d5d61e98a2805deceafa47335eded7d784a8304525