Commit Graph

20 Commits

Author SHA1 Message Date
Pekka Enberg
f69804969c Merge 'Adding checkpoint result' from Sonny
### What?
adding checkpoint result returning number of pages in wal and num pages
checkpointed.
Part of #696
### Context
SQLite returns in checkpoint result of calling `pragma wal_checkpoint;`
`0|3|3` while limbo returns `0|0|0`.
https://sqlite.org/pragma.html#pragma_wal_checkpoint
- 1st col: 1 (checkpoint SQLITE_BUSY) or 0 (not busy).
- 2nd col: # modified pages written to wal file
- 3rd col: # pages moved to db after checkpoint
This PR aims to add 2nd and 3rd column to the checkpoint result.
SQLite
```
sqlite3 test.db
sqlite> pragma journal_mode=wal;
wal
sqlite> pragma journal_mode;
wal
sqlite> create table t1 (id text);
sqlite> insert into t1(id) values (1),(2);
sqlite> select * from t1;
1
2
sqlite> pragma wal_checkpoint;
0|3|3
```
Limbo
```
./target/debug/limbo test.db
Limbo v0.0.13
Enter ".help" for usage hints.
limbo> pragma journal_mode;
wal
limbo> create table t1(id text);
limbo> insert into t1(id) values (1),(2);
limbo> select * from t1;
1
2
# current the 2nd and 3rd columns are hard coded in limbo to 0
limbo> pragma wal_checkpoint;
0|0|0
```

Closes #827
2025-02-04 18:26:24 +02:00
Levy A.
dcd32e1ec8 fix: clippy + new errors 2025-02-03 16:58:13 -03:00
Levy A.
9df0b01689 refactor: lower ownership requirement 2025-02-03 16:52:42 -03:00
sonhmai
022a8d7a83 core: return checkpoint result 2025-02-03 19:02:16 +07:00
Nikita Sivukhin
f43a326649 add examples of tests found by fuzzer 2025-02-03 11:25:14 +04:00
Nikita Sivukhin
529c2df6f6 add few scalar function with binary result in logical fuzz test 2025-02-03 11:25:14 +04:00
Nikita Sivukhin
17d06a1d28 adjust options for logical fuzz test 2025-02-03 11:25:14 +04:00
Nikita Sivukhin
c2950d144e add logical expression fuzz tests 2025-02-03 11:25:14 +04:00
Pekka Enberg
9458d1ed14 Merge 'Fix shr instruction' from Nikita Sivukhin
This PR fixes implementation of binary shift right/left instructions.
Before there were a minor incompatibility between limbo and sqlite
implementation in case when right shift second argument were more than
64 and first argument were negative. As sqlite implementation of right
binary shift is sign-extended - so `-1` should be returned in such case
when limbo returned zero.
This PR fixes this bug and also introduce a fuzz tests for arithemtic
expressions. This fuzz test were written with a help of
`GrammarGenerator` which allows to easily define probabilistic context-
free grammar and then later sample random strings from it.

Closes #867
2025-02-03 09:22:39 +02:00
Nikita Sivukhin
41419ab11a add env logger and fix range 2025-02-02 20:12:56 +04:00
Nikita Sivukhin
e63d84ed50 refine assertions 2025-02-02 20:10:38 +04:00
Nikita Sivukhin
6cc1b778b4 add test with rowid=-1
- now limbo attempts to add with overflow and panic in this case
2025-02-02 20:02:59 +04:00
Nikita Sivukhin
3ff76e657e allow a bit of dead code for now 2025-02-02 19:55:04 +04:00
Nikita Sivukhin
300f278ff3 use TempDatabase from commons in tests/ 2025-02-02 19:34:15 +04:00
Nikita Sivukhin
9cc6cc99d4 add examples found by fuzzer 2025-02-02 18:42:40 +04:00
Nikita Sivukhin
91fcb67b06 rewrite grammar generator and add fuzz test for arithmetic expressions 2025-02-02 18:39:24 +04:00
Nikita Sivukhin
f716919b10 setup basic playground for fuzzing against sqlite 2025-02-02 14:12:12 +04:00
Pekka Enberg
7967cc5efc core: Kill Rows wrapper struct
It's just an useless wrapper, kill it.
2025-01-26 16:27:19 +02:00
PThorpe92
545990f806 Support returning column names from prepared statement 2025-01-23 11:02:31 -05:00
sonhmai
a090fb927a centralize Rust integration and regression tests 2025-01-21 15:41:09 +07:00