Commit Graph

693 Commits

Author SHA1 Message Date
jussisaurio
cc902ed25d GROUP BY and ORDER BY mostly work 2024-11-26 17:31:51 +02:00
jussisaurio
3f9e60633f select refactor: order by and basic agg kinda work 2024-11-26 17:31:51 +02:00
jussisaurio
d0466e1cae introduce Column member of ast::Expr and bind idents to columns 2024-11-26 17:31:51 +02:00
jussisaurio
418ad40401 Merge 'Fix some Clippy warnings' from Lauri Virtanen
Reviewed-by: Pere Diaz Bou <limeng.1@bytedance.com>

Closes #417
2024-11-25 16:43:06 +02:00
Lauri Virtanen
70c4d6b360 Support multiplying combinations of different types 2024-11-24 22:11:37 +02:00
Lauri Virtanen
af9d407dee Fix issues with subtraction of different type combinations 2024-11-24 22:10:23 +02:00
Lauri Virtanen
cafbf5499f Support divide operator in expressions 2024-11-24 22:10:07 +02:00
Lauri Virtanen
afeb1cbe74 Clippy warning fixes 2024-11-24 20:24:47 +02:00
Lauri Virtanen
a7100d8e9b Autofix clippy issues with cargo fix --clippy 2024-11-24 20:24:47 +02:00
Pekka Enberg
aa4dd5c8e7 Merge 'wal: checksums' from Pere Diaz Bou
Implemeted checksums so that sqlite3 is able to read our WAL. This also
helps with future work on proper recovery of WAL.
Create some frames with CREATE TABLE and kill the process so that there
is no checkpoint.
```
Limbo v0.0.6
Enter ".help" for usage hints.
limbo> create table x(x);
limbo> [1]    15910 killed     cargo run xlimbo.db
```
Now sqlite3 is able to recover from this WAL created in limbo:
```
sqlite3 xlimbo.db
SQLite version 3.43.2 2023-10-10 13:08:14
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE x (x);
```

Closes #413
2024-11-22 13:21:01 +02:00
jussisaurio
c722074016 missing cursorresult handling 2024-11-21 20:29:46 +02:00
jussisaurio
f945795ae6 consistent naming 2024-11-21 20:25:51 +02:00
jussisaurio
d8eb4be424 better, less cool names 2024-11-21 20:23:53 +02:00
jussisaurio
3002f2a552 io macro 2024-11-21 20:23:23 +02:00
jussisaurio
6dc427fc9b Merge 'impl order by desc' from lemonwx
Hi all,
I attempted to implement the `order by desc`, which mainly consists of
the following two parts:
1. for cases where the primary key can be utilized, I implemented
`push_scan_direction` to push the scan direction down to the `Scan`.
2. for cases where the primary key cannot be utilized, I re-implemented
the sorting in `Sorter::rewind` based on whether it's desc or asc.
there is also some related work to be done, such as sort using secondary
index, I will attempt to do next.
Please help review this and let me know how I can improve it, thanks in
advance

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

Closes #376
2024-11-21 16:37:38 +02:00
Pere Diaz Bou
05a05cfc63 endian naming changes 2024-11-21 11:55:36 +01:00
Pere Diaz Bou
6c14c50d41 wal: checksums
Implemeted checksums so that sqlite3 is able to read our WAL. This also
helps with future work on proper recovery of WAL.

Create some frames with CREATE TABLE and kill the process so that there
is no checkpoint.
```
Limbo v0.0.6
Enter ".help" for usage hints.
limbo> create table x(x);
limbo> [1]    15910 killed     cargo run xlimbo.db
```

Now sqlite3 is able to recover from this WAL created in limbo:

```
sqlite3 xlimbo.db
SQLite version 3.43.2 2023-10-10 13:08:14
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE x (x);
```
2024-11-20 20:12:32 +01:00
Pekka Enberg
de40442677 core: Remove unused import from btree.rs 2024-11-20 11:55:49 +02:00
Pekka Enberg
fc07445e0a Merge 'sim: improve simulator' from Pere Diaz Bou
Newly improved simulator with CREATE TABLE, INSERT, SELECT, connection
management, etc...
This new simulator is finding a bunch of bugs with write path so after
this PR I will start fixing those.

Closes #405
2024-11-20 08:59:13 +02:00
Pere Diaz Bou
51ad827f1f fmt 2024-11-19 17:56:24 +01:00
Pere Diaz Bou
f5a1f7c800 various fixes in btree
* read_u8 now takes self.offset into account
* shift cell pointers left on balance_root with offset > 0
* fix wrong writes to page in degragment_page
2024-11-19 17:15:19 +01:00
limeng.1
a188bcd287 fix 2024-11-19 16:45:17 +08:00
limeng.1
5e9e701417 resolve comments 2024-11-19 11:39:08 +08:00
limeng.1
c51750fad5 fix lint 2024-11-19 11:39:08 +08:00
limeng.1
1cb1d16c08 resolve comments 2024-11-19 11:39:08 +08:00
limeng.1
8cca659052 impl order by desc 2024-11-19 11:39:07 +08:00
jussisaurio
b86501f12e Merge 'implement CAST(col as type)' from Jussi Saurio
Closes #398

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

Closes #404
2024-11-18 20:53:58 +02:00
jussisaurio
9efd45025d enum instead of string 2024-11-18 18:26:04 +02:00
Pere Diaz Bou
db343ac5ea fix page1 balancing 2024-11-18 16:25:06 +01:00
Pere Diaz Bou
4aa5612334 fix schema query 2024-11-18 14:06:50 +01:00
Pere Diaz Bou
a738ef6e91 comment use of rng in limbo 2024-11-18 13:40:37 +01:00
Pere Diaz Bou
44e22c50cf sim: improve simulator 2024-11-18 13:40:37 +01:00
Pere Diaz Bou
9c4ca28bd9 Merge 'CREATE TABLE support' from Pekka Enberg
Closes #383
2024-11-18 13:40:20 +01:00
Pere Diaz Bou
80f60852df remove wrong comment 2024-11-18 10:41:20 +01:00
Pere Diaz Bou
9f72655e30 tree_create -> btree_create 2024-11-18 10:31:47 +01:00
Pekka Enberg
5efc218e6e Merge 'support subtract in translate_expr() (not in condition expressions yet)' from Jussi Saurio
closes #402

Closes #403
2024-11-18 09:28:23 +02:00
jussisaurio
62761d2b34 uppercase only once 2024-11-17 22:22:03 +02:00
jussisaurio
ddd0cc041c implement CAST(col as type) 2024-11-17 22:12:22 +02:00
jussisaurio
491bdd3bfc support subtract in translate_expr() (not in condition expressions yet) 2024-11-17 18:47:16 +02:00
jussisaurio
9a4864bc6a support parenthesized(single expr) in translate_expr() 2024-11-17 18:36:30 +02:00
jussisaurio
ccdcf302ca quick fix for #399 2024-11-17 17:06:09 +02:00
jussisaurio
3cc9d9d79f vendor sqlite3-parser (lemon-rs) 2024-11-16 20:08:59 +02:00
Pekka Enberg
9473668196 core: Bump jsonb dependency
The `fast-float` library has soundness issues, which why `jsonb`
switched to `fast-float2`:

https://github.com/databendlabs/jsonb/issues/68
2024-11-16 18:58:13 +02:00
Pere Diaz Bou
569e98cb32 fmt 2024-11-16 17:08:22 +01:00
Pere Diaz Bou
d1dee484df properly format table and "if not exists" support 2024-11-16 17:02:53 +01:00
Pere Diaz Bou
090615b289 create btree table + parse schema 2024-11-16 16:24:28 +01:00
Pere Diaz Bou
66e20df309 fix some offset usages in btree 2024-11-16 16:23:06 +01:00
Pekka Enberg
fc5e42bb94 CREATE TABLE support 2024-11-16 13:07:10 +01:00
Pekka Enberg
85b70e381d core: Make mockall a dev dependency 2024-11-16 13:18:35 +02:00
Pekka Enberg
cd5db55cf2 core: Make JSON support configurable
This adds a `json` feature flag, which allows users to disable JSON
support if needed.
2024-11-16 09:49:09 +02:00