Commit Graph

3218 Commits

Author SHA1 Message Date
Pekka Enberg
f57d2b32af core: Clean up B-Tree creation code
Move page allocation to pager so that we don't need to instantiate a
cursor to create a B-Tree.
2025-03-04 18:38:06 +02:00
Pekka Enberg
d2cf4c42cb Merge 'Cursor cleanups' from Pekka Enberg
Clean up the cursor lookup code in VDBE in preparation for multi-version
cursor support.

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

Closes #1090
2025-03-04 15:38:58 +02:00
Pekka Enberg
f3ee86d784 core/vdbe: Replace get_btree_{table,index}_cursor() calls with get_cursor() 2025-03-04 15:17:57 +02:00
Pekka Enberg
cdcaebb878 core/vdbe: Unify B-Tree cursors 2025-03-04 14:35:40 +02:00
Pekka Enberg
8e56646b12 Merge 'core/vdbe: Kill call_external_function macro' from Pekka Enberg
The call_external_function macro has exactly one call-site and,
therefore, only makes the code harder to read.

Closes #1089
2025-03-04 14:32:20 +02:00
Pekka Enberg
1c0d9c3b46 core/vdbe: Replace get_pseudo_cursor() calls with get_cursor() 2025-03-04 14:18:52 +02:00
Pekka Enberg
c12f2aeca4 core/vdbe: Replace get_sorter() calls with get_cursor() 2025-03-04 13:51:05 +02:00
Pekka Enberg
45539a4fe5 core/vdbe: Replace get_vtab_cursor() calls with get_cursor() 2025-03-04 13:43:49 +02:00
Pekka Enberg
085f93ce79 core/vdbe: Add ProgramState::get_cursor() helper 2025-03-04 12:23:35 +02:00
Pekka Enberg
3aeb11b673 core/vdbe: Add ProgramStatem::get_btree_{table,index}_cursor() helpers 2025-03-04 11:40:43 +02:00
Pekka Enberg
222808ab6c ore/vdbe: Add ProgramState::get_pseudo_cursor() helper 2025-03-04 11:21:24 +02:00
Pekka Enberg
06446b768b core/vdbe: Add ProgramState::get_sorter() helper 2025-03-04 11:18:09 +02:00
Pekka Enberg
e4ebb6d9e1 core/vdbe: Add ProgramState::get_vtab_cursor() helper 2025-03-04 11:16:29 +02:00
Pekka Enberg
dc525dd7d1 core/vdbe: Kill call_external_function macro
The call_external_function macro has exactly one call-site and,
therefore, only makes the code harder to read.
2025-03-04 11:01:09 +02:00
Pekka Enberg
19a348c91a Merge 'Print seed for failed fuzz tests' from Pedro Muniz
Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #1047
2025-03-04 10:25:47 +02:00
Pekka Enberg
ddb188132c Merge 'Clean up extension types API, introduce json text subtype' from Preston Thorpe
This PR cleans up some comments in the extension API and prevents
extensions themselves from calling 'free' on Value types that are
exposed to the user facing traits, as well as changes the `from_ffi`
method for OwnedValues to take ownership and automatically free the
values to prevent memory leaks.
This PR also finds the name of the `args: &[Value]` argument for scalar
functions in extensions, and uses that in the proc macro, instead of
relying on documentation to communicate that the parameter must be named
`args`.

Closes #1054
2025-03-04 10:24:19 +02:00
Pekka Enberg
13ae224cf7 Merge 'Minor improvements to extension docs' from Pedro Muniz
Reviewed-by: Preston Thorpe (@PThorpe92)
Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #1059
2025-03-04 10:23:38 +02:00
Pekka Enberg
2e4c18dca2 Merge 'Escape character is ignored in LIKE function' from lgualtieri75
Fixes #1051

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #1074
2025-03-04 10:23:09 +02:00
Pekka Enberg
01f121b567 Merge 'adding limbo.quit to cleanly quit the subprocess in python tests' from Pedro Muniz
Closes #1071
2025-03-04 10:21:49 +02:00
Pekka Enberg
cedfa92b22 Merge 'Add sqlean ipaddr extension' from EmNudge
Relatively simple one, although I notice we don't have a lot of testing
here. The extensions have all their tests in the python cli extension
tests. Do we want to keep it that way or motivate inline rust tests for
these modules?

Closes #1081
2025-03-04 10:21:11 +02:00
Pekka Enberg
8a3bdbfdf3 Merge 'Add "dump" and "load" to the help menu' from EmNudge
These 2 were missing from the help menu and are both pretty useful.
Noticed `.exit` is also missing, ambivalent about this one since it's
rarely needed.
Also removed all ending periods to make these consistent (sqlite uses
this punctuation style as well)

Closes #1072
2025-03-04 10:16:59 +02:00
Pekka Enberg
bb79aeeb08 Merge 'bindings/java: Implement returning updated counts and version information ' from Kim Seon Woo
### Purpose
- Do some minor nits
  - Implement logic that returns updated count when running
executeUpdate
  - Implement version related functions
### Reference
- https://github.com/tursodatabase/limbo/issues/615

Closes #1086
2025-03-04 09:38:32 +02:00
Pekka Enberg
fb91477e51 Merge 'Display blobs as blob literals in .dump' from Mohamed Hossam
Fixes [#1084](https://github.com/tursodatabase/limbo/issues/1084),
displays blobs as blob literals for the `.dump` command:
```
limbo> CREATE TABLE IF NOT EXISTS files (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    data BLOB
);
INSERT INTO files (data) VALUES (X'89504E470D0A1A0A0000000D49484452000000');
limbo> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE files (id INTEGER PRIMARY KEY AUTOINCREMENT, data BLOB);
INSERT INTO files VALUES(1,X'89504e470d0a1a0a0000000d49484452000000');
COMMIT;
```

Closes #1087
2025-03-04 09:37:51 +02:00
Pekka Enberg
3204c889eb Merge 'Antithesis testing' from Pekka Enberg
Closes #1063
2025-03-04 09:34:18 +02:00
Pekka Enberg
be4014a1df Initial pass on Antithesis testing
This adds a "limbo_stress" tool for stress testing Limbo in
non-deterministic way together with support code to run the tests under
Antithesis (which makes them deterministic). The stress tester does not
really do anything useful yet, this is just a step to make sure we can
run tests under Antithesis.
2025-03-04 09:29:57 +02:00
m0hossam
37df657b87 Use fold() and write! macro instead of format! 2025-03-03 17:31:49 +02:00
m0hossam
dbe0a64d50 Display blob literals in .dump 2025-03-03 16:43:21 +02:00
김선우
412bdf5585 Apply cargo formatting 2025-03-03 21:55:10 +09:00
Pere Diaz Bou
c393ce896a Merge 'Add BalanceInfo into WriteInfo' from Pere Diaz Bou
This PR is a cleanup of stuff that I found while eating a burguer:
* `WriteInfo` now includes `BalanceInfo` to hold balance information so
that we can release it at will.
* Remove: `new_pages` and `scratch_cells`
* Once `balance_non_root` completes, it now resets state to
`BalanceStart` so that we can trigger other balance if needed. (we need
to add tests for this).
* Remove extra allocation of divider cells.

Closes #1082
2025-03-03 11:38:13 +01:00
김선우
f8052a9860 Implement totalChanges 2025-03-03 14:35:23 +09:00
김선우
6b223421ae Extract LimboPropertiesHolder 2025-03-03 14:35:23 +09:00
Pere Diaz Bou
1de4861414 fix balance_non_root should trigger balance again 2025-03-02 23:16:32 +01:00
Pere Diaz Bou
10824e3eb3 remove new_pages, remove extra divider_cells and cells capacity 2025-03-02 22:49:20 +01:00
Pere Diaz Bou
0da12df67c Introduce BalanceInfo to hold all balance procedure information 2025-03-02 22:42:48 +01:00
EmNudge
116350d139 Add ipaddr extension 2025-03-02 16:03:46 -05:00
Pere Diaz Bou
482d7b639e Merge 'Minor improvements and cleanups in btree' from Preston Thorpe
This PR does the following:
1. Replaces a couple `RefCell`'s on the cursor and page stack with
`Cell` since the types implement `Copy`
2. Adds a `return_corrupt!` macro to handle the frequent error
3. Removed `Result` return type from cursor `record` method
4. Removed a couple clones and very minor refactoring (a few clippy
suggestions)

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #1075
2025-03-02 22:02:58 +01:00
Pekka Enberg
aa43cad082 Merge 'CODEOWNERS' from Pere Diaz Bou
@PThorpe92 @penberg @jussisaurio please let me know if you want any
change, this is just a simple way for me to know if a pr is made in
core, maybe I should have a `/core/translate` and `/core/storage` too.

Closes #1068
2025-03-02 20:44:41 +02:00
Pere Diaz Bou
b2a22b7f49 comment out codeowners without write access 2025-03-02 19:01:05 +01:00
Pere Diaz Bou
04720051ce remove krishvishal for now until write access granted 2025-03-02 18:53:49 +01:00
Pere Diaz Bou
4e0eaf2401 add bindings/{go,java}, simulator and extensions 2025-03-02 18:51:07 +01:00
EmNudge
57c0341682 Add .dump and .load to help menu 2025-03-01 22:39:14 -05:00
PThorpe92
588e43c5aa Minor improvements and cleanups in btree 2025-03-01 15:48:42 -05:00
PThorpe92
19d35882f9 Add convenience function for creating json ext value type 2025-03-01 14:34:51 -05:00
PThorpe92
741c4e8037 Add json subtype for extension value text type 2025-03-01 14:27:33 -05:00
PThorpe92
c2fe1f631c Remove confusing comment from ext types 2025-03-01 14:27:33 -05:00
PThorpe92
5b8efd92a4 Update extension ownership cleanups for new vtab module 2025-03-01 14:27:33 -05:00
PThorpe92
04abb200a7 Get name of argument for scalars in extensions to allow for less rigid naming 2025-03-01 14:27:33 -05:00
PThorpe92
e7713e87ec Prevent extensions from accidentally freeing value types, fix comments 2025-03-01 14:27:33 -05:00
l.gualtieri
6449c79e93 Escape character is ignored in LIKE function #1051 2025-03-01 18:32:09 +01:00
pedrocarlo
2bdb682a49 adding limbo quit to cleanly quit the subprocess 2025-02-28 22:18:05 -03:00