Commit Graph

989 Commits

Author SHA1 Message Date
jussisaurio
8563d620af renaming 2024-10-07 17:03:50 +03:00
jussisaurio
fc71f2b32f traverse index properly
interior index cells have values that are not in the leaves, e.g.

     (interior: 3)
    /            \
(leaf: 2)     (leaf: 4)

so their values need to be emitted after the left subtree is emitted.
2024-10-07 13:04:03 +03:00
jussisaurio
e5cf052f07 Why do sqlite btree child keys have <= keys and not < keys 2024-10-06 23:48:59 +03:00
jussisaurio
15a66ea662 single seek function in cursor trait 2024-10-06 09:21:15 +03:00
jussisaurio
6e7db36121 reorder 2024-10-06 00:58:32 +03:00
jussisaurio
af9a751d36 Single seek function 2024-10-06 00:56:18 +03:00
jussisaurio
1ae8d28669 Use same move_to() function for tables and indexes 2024-10-06 00:51:14 +03:00
jussisaurio
37f877109e Reduce duplication in btree.rs 2024-10-06 00:39:50 +03:00
jussisaurio
bb1c8b65e8 fmt 2024-10-06 00:22:12 +03:00
jussisaurio
dde10d2dd7 Better EXPLAIN QUERY PLAN for Operator::Search 2024-10-06 00:19:56 +03:00
jussisaurio
47534cb8df Get rid of Seekrowid operator in favor of a unified Search operator 2024-10-06 00:11:38 +03:00
jussisaurio
d3e797f59e rewind_labels was renamed to scan_loop_body_labels 2024-10-05 18:27:18 +03:00
jussisaurio
d22dbe9840 remove garbage comment 2024-10-05 18:25:04 +03:00
jussisaurio
3826d4e1ff Add comment about code duplication 2024-10-05 18:25:04 +03:00
jussisaurio
d2233d69d3 Dont assume the rowid is the second column - it's the last 2024-10-05 18:25:04 +03:00
jussisaurio
db0e2ea54f Change another compat test to work around sqlite's weird choice to use the age index 2024-10-05 18:25:04 +03:00
jussisaurio
d8a695a991 rename tests 2024-10-05 18:25:04 +03:00
jussisaurio
43015f6949 Workaround for compat test 2024-10-05 18:25:04 +03:00
jussisaurio
9169f6e39b same thing 2024-10-05 18:25:04 +03:00
jussisaurio
fe90aacd35 Handle CursorResult in deferred seek 2024-10-05 18:25:04 +03:00
jussisaurio
02d6fa31d3 Fix .schema users not displaying indexes on the users table 2024-10-05 18:25:04 +03:00
jussisaurio
3a11887122 fixerinos 2024-10-05 18:25:04 +03:00
jussisaurio
ed19f47762 fix 2024-10-05 18:25:04 +03:00
jussisaurio
ff236c7781 Fix not advancing the cell index of pages 2024-10-05 18:25:04 +03:00
jussisaurio
99871bbeea yield on io 2024-10-05 18:25:04 +03:00
jussisaurio
e118b70127 fmt 2024-10-05 18:25:04 +03:00
jussisaurio
3d56fbd91c stuff 2024-10-05 18:25:04 +03:00
jussisaurio
f02da18acd index scan wip foo doesnt work yet 2024-10-05 18:25:04 +03:00
jussisaurio
d3015ad854 Merge 'Fix NextAwait's next instruction; rename rewind_labels' from Arpit Saxena
Closes #351
NextAwait's next instruction was pointing to RewindAwait earlier which
is not current. The instruction now points to the instruction after
RewindAwait, which will be the loop body. Hence, rename rewind_labels to
scan_loop_body_labels to make it clearer

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

Closes #354
2024-10-05 18:23:37 +03:00
Pekka Enberg
765870ce69 Update CHANGELOG.md 2024-10-03 10:35:56 +03:00
Pekka Enberg
fd6c27ab72 Merge 'Add randomblob(N) scalar function' from Lauri Virtanen
Relates to issue #144

Closes #355
2024-10-03 10:35:23 +03:00
Lauri Virtanen
9e80a0c4a8 Add randomblob(N) scalar function
Relates to issue #144
2024-10-03 00:05:23 +03:00
Pekka Enberg
b7656c265c Fix source formatting with cargo fmt... 2024-10-02 11:06:38 +03:00
Pekka Enberg
6fcd818160 Merge 'Add unhex(X) scalar function' from Lauri Virtanen
This commit adds `unhex(X)` scalar function. Function with `unhex(X,Y)`
two arguments is not implemented yet.
Relates to issue #144

Closes #353
2024-10-02 11:01:15 +03:00
Pekka Enberg
b2fd509ecc Merge 'Add zeroblob(N) scalar function' from Lauri Virtanen
Relates to issue #144

Closes #352
2024-10-02 10:59:22 +03:00
Arpit Saxena
47c8fd1964 Fix NextAwait's next instruction; rename rewind_labels
Closes #351

NextAwait's next instruction was pointing to RewindAwait earlier which
is not current. The instruction now points to the instruction after
RewindAwait, which will be the loop body. Hence, rename rewind_labels to
scan_loop_body_labels to make it clearer
2024-10-02 11:58:42 +05:30
Lauri Virtanen
adc6f9b6cd Add unhex(X) scalar function
This commit adds `unhex(X)` scalar function. Function with `unhex(X,Y)`
two arguments is not implemented yet.

Relates to issue #144
2024-09-30 00:13:43 +03:00
Lauri Virtanen
f612ead8a3 Add zeroblob(N) scalar function
Relates to issue #144
2024-09-29 23:39:53 +03:00
Pekka Enberg
b8dffbf7f9 Merge 'Maintain pending io_uring ops count for early return on run_once' from Arpit Saxena
Add a `pending_ops` field to `InnerLinuxIO` struct which is incremented
for each operation submitted to the ring and decremented when they are
taken off the completion queue. With this, we can exit from run_once if
there are no pending operations. Otherwise, in that case, it would hang
indefinitely due to call of `ring.submit_and_wait(1)`

Closes #349
2024-09-27 12:22:51 -07:00
Arpit Saxena
b7debabd81 Wrap IoUring to ensure pending_ops is always correctly updated
Adds a struct WrappedIOUring which contains a IoUring and a pending_ops
field. Entry submission and popping from the queue is done through
functions operating on it, which also maintains pending_ops count

NOTE: This is a bit weird/hacky since in get_completion we create a
CompletionQueue and just call its next(). If it were a normal iterator
it would always return the same first item. However it is a queue posing
as an iterator which makes this work.
2024-09-28 00:10:05 +05:30
Arpit Saxena
a7d735d368 Maintain pending io_uring ops count for early return on run_once
Add a `pending_ops` field to `InnerLinuxIO` struct which is incremented
for each operation submitted to the ring and decremented when they are
taken off the completion queue. With this, we can exit from run_once if
there are no pending operations. Otherwise, in that case, it would hang
indefinitely due to call of `ring.submit_and_wait(1)`
2024-09-27 23:32:19 +05:30
Pekka Enberg
34e69731c5 Merge 'Improve Simulator IO by handing RowResult::IO' from Arpit Saxena
This is not related to any open issue (atleast from the ones I saw).
This is related to an issue I saw when running the simulator as it was
calling `io.run_once()` even before submitting any read/write job. This
would lead to it hanging since io_uring's submit_and_wait would keep
waiting for a completion event.
I've tried to improve the simulator's IO handling a bit:
We inject a fault before calling next_row() through which we'll get
pread faults. Also we call io's run_once on getting RowResult::IO. This
is run with a fault probability of 1%. This is less because a fault here
would result us in terminating the entire loop iterating on rows, and
also because realistically we'll expect less faults here.
PS: I think run_once() should not hang either when no operation is
pending in io_uring. Opened #349 for fixing that.

Closes #348
2024-09-26 14:13:49 -07:00
Arpit Saxena
93092fb552 Improve Simulator IO by handing RowResult::IO
We inject fault before calling next_row() through which we'll get pread
faults. Also we call io's run_once on getting RowResult::IO. This is run
with a fault probability of 1%. This is less because a fault here would
result us in terminating the entire loop iterating on rows, and also
because realistically we'll expect less faults here
2024-09-26 20:00:55 +05:30
Pekka Enberg
918578fa94 Merge 'refactor: min max function' from Jean Arhancet
In the current implementation, there is an issue with the `min`/`max`
functions when the input contains both numbers and text. This merge
request fixes the problem.
I have also changed the `minmax` function by splitting it into two
separate functions to be able to add unit tests for both functions, just
like for the other functions

Closes #347
2024-09-26 06:40:30 -07:00
JeanArhancet
7b5d0fcabd refactor: split min/max func 2024-09-25 17:51:49 +02:00
JeanArhancet
222fea9cc8 fix: cmp number/text 2024-09-25 17:39:37 +02:00
Pekka Enberg
ed3608dc1f Merge 'pere mailmap' from Pere Diaz Bou
Closes #345
2024-09-23 09:51:00 -04:00
Pere Diaz Bou
3d2e21675c pere mailmap 2024-09-23 15:29:17 +02:00
Pekka Enberg
bd11dabc15 Merge 'Better support for BLOBs' from Lauri Virtanen
- Limbo command line shell supports e.g. `SELECT x'616263';`
- `EXPLAIN SELECT x'616263';` lists the opcode
Missing:
- Command line shell not entirely compatible with SQLite when blobs have
non-printable characters in the middle (e.g. `SELECT x'610062';`)
- Python bindings not supported (incoming soon)

Closes #343
2024-09-23 09:21:56 -04:00
Lauri Virtanen
0597c048fc Better support for BLOBs
- Limbo command line shell supports e.g. `SELECT x'616263';`
- `EXPLAIN SELECT x'616263';` lists the opcode

Missing:

- Command line shell not entirely compatible with SQLite when blobs have
  non-printable characters in the middle (e.g. `SELECT x'610062';`)
- Python bindings not supported (incoming soon)
2024-09-22 17:55:00 +03:00