Commit Graph

2969 Commits

Author SHA1 Message Date
Pere Diaz Bou
b5ec5186ea fix divider cell on leaf data 2025-02-16 18:30:42 +01:00
Pere Diaz Bou
177dbcd403 simplify balance_root 2025-02-16 18:01:33 +01:00
Pere Diaz Bou
f9d979575b fix defragment_page cell payload size calculation 2025-02-15 16:51:52 +01:00
Pere Diaz Bou
d3574f1e55 fix root offfset handling 2025-02-15 16:51:52 +01:00
Pere Diaz Bou
8ba7022e0b remove dbg prints 2025-02-15 16:51:52 +01:00
Pere Diaz Bou
1b96bd8a30 fix free_cell_area offset check 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
7e55f46b26 fix defragment 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
c65dce6cfd re implemenet free cell range 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
9d2aaea439 add no offset write and read u16 from page 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
4907de6e21 fix rightpoitner load + some stuff 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
5ff66b8c62 fix reset content area in drop_cell 2025-02-15 16:42:26 +01:00
Pere Diaz Bou
78e7364f45 fuzz test 2025-02-15 16:30:59 +01:00
Pere Diaz Bou
ea77902e24 add defragment test after deletion of odd cells
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
2025-02-15 16:30:59 +01:00
Pere Diaz Bou
0274f74f32 fix drop cell and add some tests 2025-02-15 16:30:59 +01:00
Pere Diaz Bou
44857cdd17 fix insert test 2025-02-15 16:21:33 +01:00
Pere Diaz Bou
0aa70929f2 fix usable size btree init 2025-02-15 16:21:33 +01:00
Pere Diaz Bou
48f0fe0904 multiple cell insert test 2025-02-15 16:21:33 +01:00
Pere Diaz Bou
c4c5a74e16 add a bit of testing 2025-02-15 16:21:33 +01:00
Pere Diaz Bou
7e3470fb8e fix rebase 2025-02-15 16:18:04 +01:00
Pere Diaz Bou
915bb42412 fix rightmost pointer update 2025-02-15 16:18:04 +01:00
Pere Diaz Bou
0c015e43a2 some fixes 2025-02-15 16:18:04 +01:00
Pere Diaz Bou
05ca716f82 up to finish without fixing stuff 2025-02-15 16:11:29 +01:00
Pere Diaz Bou
0035b9d1bd up to edit 2025-02-15 15:55:42 +01:00
Pere Diaz Bou
1266994a0a balance sibling pages 2025-02-15 15:37:13 +01:00
Pekka Enberg
d9f4558255 build: Clean up top-level Cargo.toml 2025-02-14 12:43:17 +02:00
Pekka Enberg
a302828376 core/transalte: Fix invalid sqlite3_parser import 2025-02-14 12:27:57 +02:00
Pekka Enberg
43574528c9 Merge 'Switch to workspace dependencies' from Pekka Enberg
...makes it easier to specify a version, which is needed for `cargo
publish`.

Closes #991
2025-02-14 12:21:24 +02:00
Pekka Enberg
64cdfd829e Merge 'core/translate: BEGIN EXCLUSIVE support' from Pekka Enberg
After reading the fine print, SQLite documentation explains that `BEGIN
IMMEDIATE` and `BEGIN EXCLUSIVE` are the same thing in WAL mode:
https://www.sqlite.org/lang_transaction.html
As that's the only mode we support, let's just add code generation for
`BEGIN EXCLUSIVE`.
Fixes #1002

Closes #1003
2025-02-14 12:20:22 +02:00
Pekka Enberg
20e881ae0d testing: Disable transaction tests for now 2025-02-14 12:19:58 +02:00
Pekka Enberg
e3925c4531 core/vdbe: Fix Program::halt() to respect autocommit state 2025-02-14 12:11:37 +02:00
Pekka Enberg
b949ef5360 Update COMPAT.md 2025-02-14 11:58:54 +02:00
Pekka Enberg
76bdbb54ef core/translate: BEGIN EXCLUSIVE support
After reading the fine print, SQLite documentation explains that `BEGIN
IMMEDIATE` and `BEGIN EXCLUSIVE` are the same thing in WAL mode:

https://www.sqlite.org/lang_transaction.html

As that's the only mode we support, let's just add code generation for
`BEGIN EXCLUSIVE`.

Fixes #1002
2025-02-14 11:52:18 +02:00
Pekka Enberg
567a2e9a9f Merge 'BEGIN IMMEDIATE + COMMIT support' from Pekka Enberg
Closes #1000
2025-02-14 11:48:38 +02:00
Pekka Enberg
ae3c6b7ec5 core/vdbe: Fix AutoCommit instruction to halt the VM
Pointed out by Jussi
2025-02-14 11:43:16 +02:00
Pekka Enberg
948585bb42 core/vdbe: Extract Program::halt() helper
We need this for AutoCommit opcode too.
2025-02-14 11:42:24 +02:00
Pekka Enberg
4b7270de11 Merge 'fix some typo' from meteorgan
Closes #999
2025-02-14 10:37:40 +02:00
Pekka Enberg
a8cadf205c Merge 'doc: Use limbo_cli as package instead for running limbo cli' from Takayuki Maeda
I found invalid option while reading CONTRIBUTING.md and trying some
commands in it.
error:
```
$ cargo run --package limbo --bin limbo database.db
error: no bin target named `limbo`.

$ rustc --version
rustc 1.83.0 (90b35a623 2024-11-26)
```
ref: https://github.com/tursodatabase/limbo/blob/291637cc7120303fd7337c3
42cf5dbc9363faa85/cli/Cargo.toml#L17

Closes #995
2025-02-14 10:35:42 +02:00
Pekka Enberg
076331d8cf testing: Basic BEGIN + END test 2025-02-14 10:26:55 +02:00
Pekka Enberg
5626ca450f core/translate: COMMIT support
```
limbo> EXPLAIN COMMIT;
addr  opcode             p1    p2    p3    p4             p5  comment
----  -----------------  ----  ----  ----  -------------  --  -------
0     Init               0     3     0                    0   Start at 3
1     AutoCommit         1     0     0                    0   auto_commit=true, rollback=false
2     Halt               0     0     0                    0
3     Goto               0     1     0                    0
```
2025-02-14 10:26:55 +02:00
Pekka Enberg
9fff9f6081 core/translate: BEGIN IMMEDIATE support
Emit the following code sequence for `BEGIN IMMEDIATE`:

```
limbo> EXPLAIN BEGIN IMMEDIATE;
addr  opcode             p1    p2    p3    p4             p5  comment
----  -----------------  ----  ----  ----  -------------  --  -------
0     Init               0     4     0                    0   Start at 4
1     Transaction        0     1     0                    0
2     AutoCommit         0     0     0                    0   auto_commit=false, rollback=false
3     Halt               0     0     0                    0
4     Goto               0     1     0                    0
```

Please note that SQLite emits *two* transaction instructions -- one for
main database and one for temporary tables. However, since we don't
support the latter, we only emit one transaction instruction.
2025-02-14 10:26:31 +02:00
Pekka Enberg
34b0c7c09a core/vdbe: AutoCommit instruction 2025-02-14 10:26:31 +02:00
Takayuki Maeda
291637cc71 use limbo_cli instead 2025-02-14 01:45:33 +09:00
meteorgan
744df6eedf fix some typo 2025-02-13 23:03:41 +08:00
Takayuki Maeda
e9b4d933b5 remove unnecessary option for running limbo cli 2025-02-13 05:00:43 +09:00
Pekka Enberg
248a369afc Merge 'build: Update cargo-dist to latest' from Pekka Enberg
Closes #992
2025-02-12 18:13:05 +02:00
Pekka Enberg
d63be7492d build: Update cargo-dist to latest 2025-02-12 17:30:02 +02:00
Pekka Enberg
ac54c35f92 Switch to workspace dependencies
...makes it easier to specify a version, which is needed for `cargo publish`.
2025-02-12 17:28:04 +02:00
Pekka Enberg
e464f99234 Revert "github: Update to "ubuntu-22.04" image"
This reverts commit bb8ab4088b. We need `cargo-dist` to do this...
2025-02-12 17:20:33 +02:00
Pekka Enberg
d1e8bb986f Fix RustDoc imports 2025-02-12 17:17:33 +02:00
Pekka Enberg
2e5fc62c45 bindings/rust: Add example.rs 2025-02-12 16:55:05 +02:00