Commit Graph

5963 Commits

Author SHA1 Message Date
Jussi Saurio
a81d81685f btree: rename divider_cells to divider_cell_payloads for clarity 2025-07-10 15:29:01 +03:00
Jussi Saurio
5d0b410e70 btree: rename constant to mention siblings 2025-07-10 15:28:11 +03:00
Jussi Saurio
78a249c6d0 btree: add MAX_SIBLING_PAGES_TO_BALANCE constant and use it 2025-07-10 15:27:37 +03:00
Jussi Saurio
6ff13113ce btree: add MAX_NEW_PAGES_AFTER_BALANCE constant and use it 2025-07-10 15:24:32 +03:00
Jussi Saurio
10d301c53c btree: use size-related new constants instead of literal numbers 2025-07-10 15:21:00 +03:00
Jussi Saurio
59b4f1310b sqlite3_ondisk: add some size constants 2025-07-10 15:16:37 +03:00
Jussi Saurio
925a252815 Merge 'btree: Improve balance non root docs' from Jussi Saurio
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #2031
2025-07-10 15:07:18 +03:00
Jussi Saurio
0b8c5f7c91 btree/balance: extra doc context for CellArray::cell_payloads 2025-07-10 15:06:27 +03:00
Jussi Saurio
475bced4f7 btree/balance: remove obsolete todo 2025-07-10 14:58:00 +03:00
Jussi Saurio
0316b5a517 btree/balance: rename CellArray::cell_data to cell_payloads 2025-07-10 14:57:45 +03:00
Jussi Saurio
0d973d78a9 btree/balance: add a diagram about divider cell assignment and some comments 2025-07-10 14:56:59 +03:00
Pekka Enberg
6620ca954d testing/sqlite3: Fix NULL handling in tester.tcl 2025-07-10 14:41:33 +03:00
Pekka Enberg
6749af7037 Merge 'core/translate: Return error if SELECT needs tables and there are none' from Mikaël Francoeur
Fixes https://github.com/tursodatabase/turso/issues/1972

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2023
2025-07-10 14:02:57 +03:00
Pekka Enberg
7a259957ac Merge 'properly set last_checksum after recovering wal' from Pere Diaz Bou
We store `last_checksum` to do cumulative checksumming. After reading
wal for recovery, we didn't set last checksum properly in case there
were no frames so this cause us to not initialize last_checksum
properly.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2030
2025-07-10 13:54:15 +03:00
Jussi Saurio
610b743f0d btree/balance: rename CellArray::cell_count to CellArray::cell_count_up_to_page 2025-07-10 13:51:56 +03:00
Jussi Saurio
924482981c btree/balance: rename CellArray::cell_size to CellArray::cell_size_bytes 2025-07-10 13:50:14 +03:00
Jussi Saurio
68cd948056 btree/balance: add extra documentation for page update dual pass 2025-07-10 13:47:08 +03:00
Pekka Enberg
1333fc884c github: Make Antithesis email a secret
I am adding a mailing list address that I prefer not to share.
2025-07-10 13:42:26 +03:00
Pekka Enberg
5a961c0837 Merge 'antithesis: Fix transaction management' from Pekka Enberg
Commit 5216e67d ("bindings/python: Start transaction implicitly in
execute()") fixed transaction management in Python bindings, which means
we now need to execute explicit commit().

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2028
2025-07-10 13:38:12 +03:00
Pere Diaz Bou
832f9fb8a8 clippy 2025-07-10 12:23:33 +02:00
Jussi Saurio
3fc51ed4d9 btree/balance: rename leaf to is_leaf 2025-07-10 13:16:14 +03:00
Jussi Saurio
d88bbd488f btree/balance: rename leaf_data to is_table_leaf 2025-07-10 13:15:29 +03:00
Pere Diaz Bou
9258d33d8b properly set last_checksum after recovering wal
We store `last_checksum` to do cumulative checksumming. After reading
wal for recovery, we didn't set last checksum properly in case there
were no frames so this cause us to not initialize last_checksum
properly.
2025-07-10 12:15:00 +02:00
Jussi Saurio
b306550a69 format 2025-07-10 13:14:57 +03:00
Jussi Saurio
5ef0127409 btree/balance: rename count_cells_in_old_pages to old_cell_count_per_page_cumulative 2025-07-10 13:14:18 +03:00
Jussi Saurio
c31ee0e628 btree/balance: rename number_of_cells_per_page to cell_count_per_page_cumulative 2025-07-10 13:12:17 +03:00
Jussi Saurio
824065a91d btree/balance: rename cells to cell_data 2025-07-10 13:10:31 +03:00
Jussi Saurio
37f2317e49 btree/balance: add comment about divider cell 2025-07-10 13:09:29 +03:00
Jussi Saurio
4d691af3ee btree/balance: clearer variable name 2025-07-10 13:08:58 +03:00
Jussi Saurio
e51f0f5466 btree/balance: improve comment 2025-07-10 13:08:35 +03:00
Jussi Saurio
201edf3668 btree/balance: add comment 2025-07-10 13:05:54 +03:00
Jussi Saurio
fd0a47dc6b btree: simplify pattern match 2025-07-10 13:05:15 +03:00
Jussi Saurio
4dc3e2100f btree: rename balance_non_root related enum variants and add docs 2025-07-10 13:02:50 +03:00
Jussi Saurio
0eeabbb748 Merge 'btree/chore: remove unnecessary parameters to .cell_get()' from Jussi Saurio
we were providing the same damn arguments to `.cell_get()` and
`.cell_get_raw_region()` over and OVER and **OVER** and `O V E R`

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #2021
2025-07-10 12:22:37 +03:00
Pekka Enberg
0f4bd65476 Merge 'core/btree: Make cell field names consistent' from Jussi Saurio
Closes #2025
2025-07-10 10:18:22 +03:00
Pekka Enberg
d7b7d48046 Merge 'Enforce TCL 8.6+ in compatibility tests' from Mikaël Francoeur
The compatibility test suite fails on older versions of TCL, because
they didn't handle characters outside the Basic Multilingual Plane (BMP)
properly. TCL 8.6 fixed this problem ([source](https://wiki.tcl-
lang.org/page/emoji+with+Tcl%2FTk+8.6)).
MacOS comes with an older TCL 8.5.9, so running compatibility tests
locally on the default TCL will give this error:
```
(testing/testing.db)                        Running test: unicode-emoji
Test FAILED: SELECT unicode('🠘 Š ');
returned '240'
expected '128522'
make: *** [test-compat] Error 1
```
This PR adds a target in the Makefile to enforce that TCL 8.6+ is used.
If not, it will fail with a message like this:
```
tclsh 9.0.2 found — need 11.12.13+
make: *** [check-tcl-version] Error 1
```

Closes #2020
2025-07-10 10:17:19 +03:00
Pekka Enberg
bada750135 antithesis: Fix transaction management
Commit 5216e67d ("bindings/python: Start transaction implicitly in
execute()") fixed transaction management in Python bindings, which means
we now need to execute explicit commit().
2025-07-10 10:16:33 +03:00
Pekka Enberg
474c1bff3b Turso 0.1.2-pre.2 2025-07-10 10:10:52 +03:00
Pekka Enberg
b2d40d95d3 Sort partners in alphabetical order in README.md 2025-07-10 09:05:11 +03:00
Pekka Enberg
6418ff6b33 Merge 'Add Nyrkiö to partners section in README' from Henrik Ingo
Hi
I noticed you have some partner logos in the README nowadays, and felt
left out... But then I realized this is open source and I can just send
a PR.  I assume the order is chronological so as Nyrkiö is the oldest of
these three I put it on  top. The order could also be reverse
alphabetical.

Closes #2027
2025-07-10 09:03:49 +03:00
Henrik Ingo
fe4f2e17c3 Add Nyrkiö to partners section in README 2025-07-10 04:54:24 +03:00
Jussi Saurio
c2b699c356 btree: make cell field names consistent 2025-07-09 23:43:03 +03:00
Mikaël Francoeur
89b0574fac return error if no tables 2025-07-09 14:58:24 -04:00
Jussi Saurio
641df7d7e9 improve my mental health by finally refactoring .cell_get() 2025-07-09 19:15:05 +03:00
Jussi Saurio
24219d2eb2 Merge 'Minor refactoring of btree' from meteorgan
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #1917
2025-07-09 19:13:39 +03:00
Mikaël Francoeur
a57c4c1b6e enforce tcl 8.6+ 2025-07-09 11:30:38 -04:00
Pekka Enberg
159710d1c9 Merge 'core: Fix resolve_function() error messages' from Pekka Enberg
We need to return the original function name, not normalized one to be
compatible with SQLite.
Spotted by SQLite TCL tests.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2017
2025-07-09 17:12:58 +03:00
meteorgan
0001348158 Minor refactoring of btree 2025-07-09 22:01:54 +08:00
Pekka Enberg
3f10427f52 core: Fix resolve_function() error messages
We need to return the original function name, not normalized one to be
compatible with SQLite.

Spotted by SQLite TCL tests.
2025-07-09 15:30:57 +03:00
Pekka Enberg
91fff1d2b3 Merge 'bindings/python: Start transaction implicitly in execute()' from Pekka Enberg
We need to start transaction implicitly in execute() for DML statements
to make sure first transaction is actually started.
Fixes #2002

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2013
2025-07-09 14:34:02 +03:00