Jussi Saurio
480f0a04b5
make clippy happy about mutating database_size immediately after default construction
2025-06-24 14:41:50 -03:00
Jussi Saurio
f21cde9501
post-rebase fixes
2025-06-24 14:41:50 -03:00
Jussi Saurio
920e88a6a9
clippy
2025-06-24 14:41:50 -03:00
Diego Reis
1921fcb943
Add comments to clarify current behaviour
2025-06-24 14:41:50 -03:00
Diego Reis
6ae196d7b3
Add mutex to allocating page1
...
This is to prevent race conditions where two threads could try to initialize database at the same time
2025-06-24 14:41:50 -03:00
Diego Reis
a1b7b3c6f6
Fix clippy complains
2025-06-24 14:41:50 -03:00
Jussi Saurio
a5d71a65be
clippy doesnt get it
2025-06-24 14:41:50 -03:00
Jussi Saurio
133d498724
Implement a header_accessor module so that DatabaseHeader structs arent initialized on every access
2025-06-24 14:41:50 -03:00
Jussi Saurio
ad20e306f7
dont panic on cache clear error
2025-06-24 14:41:50 -03:00
Jussi Saurio
ba3bfa058d
Delete unused stuff
2025-06-24 14:41:50 -03:00
Jussi Saurio
6091d5abd7
Add todo comment
2025-06-24 14:41:50 -03:00
Jussi Saurio
fcc070c27e
Remove unused method
2025-06-24 14:41:50 -03:00
Jussi Saurio
8d4ed110c0
alloc page1 on first tx (read OR write) - otherwise e.g. select * from sqlite_schema panics
2025-06-24 14:41:50 -03:00
Jussi Saurio
d05030ed64
fix autovacuum test
2025-06-24 14:41:50 -03:00
Diego Reis
af193ef76a
Move first page allocation logic to begin_write_tx
2025-06-24 14:41:50 -03:00
Jussi Saurio
acafe71d9e
Dont allocate fresh page1 if it's in the WAL
2025-06-24 14:41:50 -03:00
Diego Reis
f0f9ad4844
core: Get rid of maybe_init_database_file
...
Initialization now only occurs in the first write transaction
2025-06-24 14:41:50 -03:00
Diego Reis
2f33c799e3
core: Set default database_size to 0
2025-06-24 14:41:49 -03:00
Diego Reis
75fdbd73c6
core: Add count of pages in Pager and fix page1 initialization
2025-06-24 14:41:49 -03:00
Diego Reis
9c7330c01c
core: Add size method to DatabaseStorage trait
2025-06-24 14:41:49 -03:00
Jussi Saurio
cc2e14b11c
Read page 1 from pager always, no separate db_header
2025-06-24 14:41:49 -03:00
Jussi Saurio
bdfbb8fe54
Fix erroneous early return
2025-06-24 11:26:00 +03:00
Jussi Saurio
5878724d0e
fix/btree: balance and seek after overwritten cell overflows
2025-06-24 11:08:22 +03:00
Nils Koch
2827b86917
chore: fix clippy warnings
2025-06-23 19:52:13 +01:00
pedrocarlo
74beac5ea8
ephemeral table for update when rowid is being update
2025-06-20 16:28:10 -03:00
Pere Diaz Bou
10d02525d6
introduce concurrent write test
...
The idea is quite simple: write with 4 concurrent writers and once all
are finsihed, check the count of rows written is correct.
2025-06-18 17:40:53 +02:00
Pere Diaz Bou
34592b172c
run index tests with flags instead of ignore
2025-06-17 19:33:23 +02:00
pedrocarlo
20115c1e74
return parse error when calling unimplemented pragma checkpoint modes
2025-06-17 11:42:20 -03:00
Pekka Enberg
4496a0d08a
core: Clean up integrity_check()
...
Suggested by Jussi.
2025-06-16 14:46:36 +03:00
Pekka Enberg
882c5ca168
Merge 'Simple integrity check on btree' from Pere Diaz Bou
...
This PR adds support for the instruction `IntegrityCk` which performs an
integrity check on the contents of a single table. Next PR I will try to
implement the rest of the integrity check where we would check indexes
containt correct amount of data and some more.
<img width="1151" alt="image" src="https://github.com/user-
attachments/assets/29d54148-55ba-480f-b972-e38587f0a483" />
Closes #1719
2025-06-16 13:46:26 +03:00
Pekka Enberg
90c1e3fc06
Switch Connection to use Arc instead of Rc
...
Connection needs to be Arc so that bindings can wrap it with `Mutex` for
multi-threading.
2025-06-16 10:43:19 +03:00
PThorpe92
33b52bfb84
Replace refcel in wal sync, add counter timeout to conn close shutdown
2025-06-13 11:12:42 +03:00
PThorpe92
eecf6ae6e6
Wait till we write the page to increment current page in wal checkpoint
2025-06-13 11:11:30 +03:00
PThorpe92
9f966910bc
Add manual wal sync before checkpoint in connection Drop
2025-06-13 11:11:30 +03:00
pedrocarlo
8dbf09bb42
betters instrumentation for btree operations
2025-06-11 23:34:32 -03:00
Pere Diaz Bou
9edbfa436a
fmt again
2025-06-11 19:12:19 +02:00
Pere Diaz Bou
3f3e91927f
fmt
2025-06-11 19:02:23 +02:00
Pere Diaz Bou
a24e1b775c
check order of rowids
2025-06-11 17:56:19 +02:00
Pere Diaz Bou
d3c646378a
Cell coverage checker
...
We check cells and freeblocks do not overlap and the fragmentation is
correct.
2025-06-11 16:50:30 +02:00
Pere Diaz Bou
9383ba207d
introduce integrity_check pragma
2025-06-11 11:14:29 +02:00
Jussi Saurio
ace1e02fc0
Remove leftover info trace
2025-06-10 16:51:34 +03:00
Jussi Saurio
f8df870fb7
Fix implementation of InteriorNodeReplacement(interior index cell being deleted)
2025-06-10 14:16:26 +03:00
Jussi Saurio
6d2ca58235
get_prev_record() small fixes
2025-06-10 14:16:26 +03:00
Jussi Saurio
9caa8334be
add FIXME about balance after interior node replacement
2025-06-10 14:16:26 +03:00
Jussi Saurio
10caca25c9
advance in balance_non_root() if -1 idx
2025-06-10 14:16:26 +03:00
Jussi Saurio
d827eeade0
For now always calculate post-balance seek key
2025-06-10 14:16:26 +03:00
Jussi Saurio
58172641fd
Use SeekOP:LT after post-deletebalancing to end up pointing to the left of the deleted row
2025-06-10 14:16:26 +03:00
Jussi Saurio
e1bc268a65
fix CREATE TABLE hang
2025-06-10 14:16:26 +03:00
Jussi Saurio
a5aeff9a3d
Fix index insert accidentally double-inserting after balance
2025-06-10 14:16:26 +03:00
Jussi Saurio
04e89c0c4a
actually fix drop table
2025-06-10 14:16:26 +03:00