Pekka Enberg
2fc5c0ce5c
Switch to runtime flag for enabling indexes
...
Makes it easier to test the feature:
```
$ cargo run -- --experimental-indexes
Limbo v0.0.22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
limbo> CREATE TABLE t(x);
limbo> CREATE INDEX t_idx ON t(x);
limbo> DROP INDEX t_idx;
```
2025-06-26 10:07:28 +03:00
Jussi Saurio
9aae1ff00a
sim: add Fault::ReopenDatabase
...
Add fault type that reopens the DB and reconnects the connections.
It purposefully does not call conn.close(), as the default behavior
of that method is to checkpoint the database.
This easily exposes multiple manifestations of DB/WAL corruption caused by
this issue: https://github.com/tursodatabase/limbo/issues/1725
in fact, in my testing, every run fails when this fault is enabled. Hence I've
added the --disable-reopen-database flag if you want to try to find some other
bugs.
2025-06-24 14:41:50 -03:00
Pekka Enberg
b1cd7229c7
Merge 'sim: when loading bug, dont panic if there are no runs' from Jussi Saurio
...
Closes #1820
2025-06-24 16:07:52 +03:00
Jussi Saurio
73db450b8b
sim: when loading bug, dont panic if there are no runs
2025-06-24 15:46:15 +03:00
Jussi Saurio
cff96964df
Fix singlequote escaping and unescaping
2025-06-24 14:58:25 +03:00
Nils Koch
2827b86917
chore: fix clippy warnings
2025-06-23 19:52:13 +01:00
pedrocarlo
c9b11dd173
simulator integrity check per query
2025-06-22 21:47:17 -03:00
Pekka Enberg
90c1e3fc06
Switch Connection to use Arc instead of Rc
...
Connection needs to be Arc so that bindings can wrap it with `Mutex` for
multi-threading.
2025-06-16 10:43:19 +03:00
pedrocarlo
6dfd4700e9
simulator: disable all ansi encodings for debug print log file
2025-06-14 19:34:40 -03:00
Jussi Saurio
f7fa56ecfd
Change integrity check failure to say 'simulation failed:'
...
our AWS nightly sim looks for a line 'simulation failed:' in the process
output to capture context for the github issues it creates.
if the sim passes otherwise but integrity check fails, then this log line
must also be present there, otherwise the aws sim will panic due to not finding
a suitable line.
2025-06-13 11:26:04 +03:00
pedrocarlo
83d72db901
better error messages + cleaner printing of file stats + tracing
...
instrumentation in `execute_interaction`
2025-06-11 11:32:45 -03:00
pedrocarlo
e19fa9f951
add additional cli options to disable other properties
2025-06-11 11:32:45 -03:00
pedrocarlo
edc1c6fbc6
force predicate in SelectSelectOptimizer to evaluate to a boolean value
2025-06-11 11:32:45 -03:00
pedrocarlo
b2fd5b9cd1
change CompoundPredicate to generate a true_clause for a single row and not for column_values + tests
2025-06-11 11:32:45 -03:00
pedrocarlo
39b57552fd
unary tests
2025-06-11 11:32:45 -03:00
pedrocarlo
9f601ccb18
add cli option to disable select optimizer
2025-06-11 11:32:45 -03:00
pedrocarlo
c82f4fa0bb
adjust creation of columns to avoid name collision
2025-06-11 11:32:18 -03:00
pedrocarlo
1410aaa0be
mostly fix binary predicate generation
2025-06-11 11:32:18 -03:00
pedrocarlo
b60037255b
small fix to binary true predicate + fuzz test for true_binary_predicate. More tests to come
2025-06-11 11:32:18 -03:00
pedrocarlo
3068c3398e
add more operators execution for binary
2025-06-11 11:32:18 -03:00
pedrocarlo
3e1a4bed8b
namespace exec_like to Value + complete the test logic for Unary Operators
2025-06-11 11:32:18 -03:00
pedrocarlo
6b58c4a33f
migrate to using limbo_core::Value inside Simulator
2025-06-11 11:32:18 -03:00
pedrocarlo
2424b1b1c9
add unary to expr_to_value
2025-06-11 11:32:18 -03:00
pedrocarlo
dc901a019c
implement true_unary + false_unary
2025-06-11 11:32:18 -03:00
pedrocarlo
176ec3b0ea
adjustments to binary functions + backtrack return Option<T> + start of unary Predicate
2025-06-11 11:32:18 -03:00
pedrocarlo
c12fc23516
extract logic for binary generation outside of predicate.rs
2025-06-11 11:32:18 -03:00
pedrocarlo
7385ac96ec
clippy
2025-06-11 11:32:18 -03:00
pedrocarlo
5a1bacc760
adjust generation for ast::Expr
2025-06-11 11:32:17 -03:00
pedrocarlo
62e7b1f64c
fix generation for string literal in a different place + simplify test assertion
2025-06-11 11:32:17 -03:00
pedrocarlo
470093ca03
fix generation for string literal
2025-06-11 11:32:17 -03:00
pedrocarlo
fac4b4e6fb
fix generation and expr evaluation
2025-06-11 11:32:17 -03:00
pedrocarlo
9f2608bded
remove previous predicate struct and rewrite generation with the new the struct
2025-06-11 11:32:17 -03:00
pedrocarlo
3e369b9dde
drop in replacement for predicate that uses ast::Expr under the hood
2025-06-11 11:32:17 -03:00
pedrocarlo
f535ff1398
add optional serde implementations for parser ast
2025-06-11 11:32:17 -03:00
pedrocarlo
f1146e716c
inital implementation for ast generation
2025-06-11 11:32:06 -03:00
Jussi Saurio
0acce8d035
Merge 'Simulator: Better Shrinking' from Pedro Muniz
...
This PR attempts to get the specific query that failed in the simulator
and get the correct tables that were used in the Query. Also, implements
a fix where after clearing miscellaneous queries, we did not check again
if the the interaction still referenced any of the tables that were
involved in the failure.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com >
Closes #1712
2025-06-11 09:45:48 +03:00
pedrocarlo
cf1983ccfe
retain the last failing interaction + remove select properties
2025-06-11 03:14:31 -03:00
pedrocarlo
63cf648e2e
filter for the tables that the failing query depended on + second pass after query clear
2025-06-11 02:52:26 -03:00
pedrocarlo
82538dbe8e
add integrity_check to sim
2025-06-10 12:17:59 -03:00
pedrocarlo
f3ef60e1f1
use anyhow in simulator for lazily evaluated error context instead of eager evaluation with .or
2025-06-10 10:50:39 -03:00
pedrocarlo
0f2849f7e1
serde and serde_json as workspace dependencies
2025-06-09 11:38:15 -03:00
Pekka Enberg
9f17be8162
Merge 'simulator: log the interaction about to be executed with INFO' from Jussi Saurio
...
I think this is useful to see, without having to drop down to DEBUG and
seeing all the other stuff.
Closes #1655
2025-06-04 10:20:54 +03:00
Jussi Saurio
e53ac59532
Fix assertion failing on 100 != 99.99999999999999999999
2025-06-04 09:28:26 +03:00
Jussi Saurio
5680326881
sim: add CREATE INDEX to interactions
2025-06-04 09:21:59 +03:00
pedrocarlo
1c424818aa
simulator options to disable certain query types
2025-06-03 22:21:40 -03:00
Jussi Saurio
e260a72447
sim: log the interaction about to be executed with INFO
...
I think this is useful to see, without having to drop down to DEBUG
and seeing all the other stuff.
2025-06-03 15:50:34 +03:00
Jussi Saurio
51e3a04668
simulator: add option to disable BugBase
2025-06-02 12:14:35 +03:00
Pere Diaz Bou
8ee7228c43
simulator: log to file too
...
most of the time debugging the log of a simulator run is spent reading
from a file for convinience. Let's just log to a file too.
2025-05-30 11:10:17 +02:00
Pere Diaz Bou
83db9be818
log seed creating plan
2025-05-30 11:04:19 +02:00
Pere Diaz Bou
1ca67d0092
remove dumb log
2025-05-30 11:03:09 +02:00