Commit Graph

2720 Commits

Author SHA1 Message Date
Nikita Sivukhin
a59589844d fix insertion to the parent 2025-02-09 19:19:36 +04:00
Nikita Sivukhin
6c40f52fc8 separate fuzz tests in categories 2025-02-09 18:37:04 +04:00
Nikita Sivukhin
9049c91863 find cell in parent node 2025-02-09 18:36:37 +04:00
Nikita Sivukhin
9e4afd1d13 relax assertion 2025-02-09 18:36:26 +04:00
Nikita Sivukhin
8e6569434a add fuzz 2025-02-09 18:10:59 +04:00
Nikita Sivukhin
a62265eef4 hanle balancing cases when more than 1 level is affected 2025-02-09 18:10:19 +04:00
Nikita Sivukhin
d2251b1dd1 fix 2025-02-09 18:09:53 +04:00
Nikita Sivukhin
e8a585f87a adjust logging 2025-02-09 18:09:43 +04:00
Nikita Sivukhin
8659dbba8e fix pointer structure in case of root split 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
d4bbad161b handle case when we can't balance all cells between current page and one new allocated page
- if we have page which is tightly packed with relatively big cells, we
  will be unable to balance its content if we will insert very big
  (~page size) cell in the middle (because nothing can't be merged with
  new cell - so we will need to split 1 page into 3)
2025-02-09 17:31:39 +04:00
Nikita Sivukhin
ea61f31843 clear overflow_cells 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
6aa10701a4 fix comment 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
eec0493c60 remove misleading comment 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
fc502b86c7 fix defragmentation code a bit 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
5ce3d12f75 fix typo 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
62b4787d3d simplify write_varint_to_vec function 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
3557c8aada adjust fuzz test 2025-02-09 17:31:39 +04:00
Nikita Sivukhin
75e2f01ec4 print btree for debugging 2025-02-08 13:03:38 +04:00
Nikita Sivukhin
55dd108878 setup simple insertion fuzz test 2025-02-08 12:38:32 +04:00
Pekka Enberg
9657920dd7 Merge 'Add java section in README.md' from Kim Seon Woo
Added a section for java in README.md

Closes #923
2025-02-08 09:15:04 +02:00
김선우
cc72439032 Add java section in README.md 2025-02-08 12:09:17 +09:00
Pekka Enberg
a9c76dd2c5 Merge 'simulator: add delete support' from Alperen Keleş
This PR enables the generation of delete statements in the simulator.
There is still some work to do(I would like to add delete a specific
property).
This version currently hits a corruption error with seed
`3270937128460682661`, if anyone could debug it and let me know if it's
the generation that's wrong or the delete code has a bug, I would be
very grateful.

Closes #921
2025-02-07 17:02:22 +02:00
alpaylan
966c807a64 add delete select property 2025-02-07 08:58:02 -05:00
alpaylan
9c339cb8e1 wip: add delete support to the simulator 2025-02-07 08:19:00 -05:00
Pekka Enberg
8787ed11e2 Merge 'bindings/java: Remove @Disabled from working test ' from Kim Seon Woo
Closes #919
2025-02-07 14:04:13 +02:00
Kim Seon Woo
9f7d23df6e Remove @Disabled from working test 2025-02-07 20:41:49 +09:00
Pekka Enberg
808ae4e7bf Merge 'simulator: add more properties and make the generated queries more complex' from Alperen Keleş
We have been working with a very small subset of SQL so far. As a rather
lightweight next phase, I propose that we make the generated queries
more realistic, slowly converging into the type definitions in
`limbo/core`. This PR will gradually implement such advances, the first
commit demonstrates how `LIMIT` is added to `SELECT`.

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

Closes #793
2025-02-07 13:40:23 +02:00
Pekka Enberg
8c0c967ea2 Merge 'Implement json_quote' from Pedro Muniz
Hi! This is my first PR on the project, so I apologize if I did not
follow a convention from the project.
#127
This PR implements json_quote as specified in their source:
https://www.sqlite.org/json1.html#jquote. It follows the internal doc
guidelines for implementing functions. Most tests were added from sqlite
test suite for json_quote, while some others were added by me. Sqlite
test suite for json_quote depends on json_valid to test for correct
escape control characters, so that specific test at the moment cannot be
done the same way.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Reviewed-by: Sonny (@sonhmai)

Closes #763
2025-02-07 13:33:05 +02:00
Pekka Enberg
400dd6dd42 Merge 'bindings/java: Implement custom logger ' from Kim Seon Woo
## Purpose of the PR
- As bindings/java is just a library, we shouldn't have to add specific
library dependency(such as slf4j) to itself
- In order to load bindings/java to 3rd party software(such as
Datagrip), we shouldn't provide a library with slf4j included
## Changes
- Remove slf4j, logback dependency and files
- Add custom logger implementation
## ETC
We can now connect to Datagrip(but there are some errors though)
![image](https://github.com/user-
attachments/assets/ec8becf1-b9a8-415a-8943-74edee9b29c3)
## Reference
[Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #915
2025-02-07 12:37:56 +02:00
Pekka Enberg
0841ed2bdb Merge 'bindings/java: Implement basic functionality of PreparedStatement ' from Kim Seon Woo
## Purpose of this PR
- Implement basic functionality of `PreparedStatement`
  - `connection.prepareStatement(...)`
  - `setNull`, `setBoolean`, `setInt`, `setDouble` ...
## Changes
- Add binding functions in rust side
- Implement `JDBC4Connection`'s `prepareStatement(sql)`
- Implement basic methods of `JDBC4PreparedStatement`
## TODO
- We can improve the performance of batching the binding operations(and
not execute immediately). For example, we can defer calling limbo's
`bind_at` when query is actually executed.
## Reference
[Issue](https://github.com/tursodatabase/limbo/issues/615)

Closes #913
2025-02-07 12:37:25 +02:00
Pekka Enberg
7169706809 Merge 'Add support for delete row' from Krishna Vishal
**Core delete tasks**:
- [x] Implement free page functionality
- [x] Clear overflow pages if any before deleting their cells using free
page.
- [x] Implement delete for leaf page
- [ ] Balance after delete properly
**Auxiliary tasks to make delete work properly**:
- [x] Implement block coalescing in `free_cell_range` to reduce
fragmentation.
- [x] Track page fragmentation in `free_cell_range`.
- [x] Update page offsets in `drop_cell` and update cell pointer array
after dropping a cell.
- [x] Add TCL tasks
Closes #455
--------
I will add support for balancing after delete once `balance_nonroot` is
extended. In the current state of `balance_nonroot` balancing won't work
after delete and corrupts page.
But delete itself is functional now.

Closes #785
2025-02-07 12:36:23 +02:00
Pekka Enberg
da3981d99c Update README.md 2025-02-07 10:55:46 +02:00
Jussi Saurio
b37745ec14 Merge 'Add quickcheck tests for generate_series() and refine implementation' from Jussi Saurio
Adds `quickcheck` property based tests to the recently merged
`generate_series` implementation and fixes various issues in it:
- `0` for `step` should be treated as `1`
- missing `step` should be treated as `1`
- a string like `a` for `step` should be treated as `1`
- saturating overflow
- return an empty series for a variety of invalid inputs, instead of
erroring
For the future:
We should have e2e/fuzz tests comparing sqlite implementation to limbo
implementation

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #910
2025-02-07 10:40:25 +02:00
Jussi Saurio
49e08c43b7 remove invalid comments 2025-02-07 10:11:31 +02:00
Jussi Saurio
cb9d929eab call cursor methods instead of duplicating logic 2025-02-07 10:09:42 +02:00
Pekka Enberg
7809df913a core/mvcc: Rename Database to MvStore 2025-02-07 07:40:33 +02:00
김선우
cd8f580f54 Nit 2025-02-07 13:50:00 +09:00
김선우
edc964a2cb Implement logger 2025-02-07 13:49:07 +09:00
김선우
f88daf2803 Fix lint 2025-02-07 12:44:24 +09:00
김선우
eeb457f7a1 Implement basic functionality of JDBC4PreparedStatement 2025-02-07 12:33:13 +09:00
pedrocarlo
c3cad5dfdd corrected to use newly created as_str function to convert to string slice 2025-02-07 00:07:51 -03:00
pedrocarlo
8fe71309c0 cargo fmt 2025-02-06 23:46:00 -03:00
pedrocarlo
c8bb1fd353 unreachable to agg and record types, as it should not be possible to pass them to json_quote 2025-02-06 23:43:30 -03:00
김선우
f5c4f4e8a1 Implement JDBC4Connection#prepareStatement 2025-02-07 11:42:36 +09:00
pedrocarlo
b678375c69 increasing string capacity to reduce allocations 2025-02-06 23:37:30 -03:00
pedrocarlo
90ecaf40b5 removed unnecessary string allocations for escaped json value 2025-02-06 23:37:30 -03:00
pedrocarlo
eb40505c31 some tests in sqlite rely on commands not implemented in limbo yet 2025-02-06 23:36:02 -03:00
pedrocarlo
26388cc802 fix: cargo fmt 2025-02-06 23:36:02 -03:00
pedrocarlo
782a18d4bd modify COMPAT.md 2025-02-06 23:36:02 -03:00
pedrocarlo
303a687e65 rebase to main 2025-02-06 23:35:58 -03:00