108 Commits

Author SHA1 Message Date
pedrocarlo
f09b73c768 remove Span, as interaction ID is enough to determine membership of a property 2025-11-17 11:45:02 -03:00
pedrocarlo
2aab33b714 find_interactions_range only check for interaction id to determine membership 2025-11-17 11:45:02 -03:00
pedrocarlo
af31e74d9f add depending tables to assertions to delete them if needed in shrinking 2025-11-17 11:45:02 -03:00
pedrocarlo
157a5cf10a - add Interaction Builder to simplify code for building an interaction.
Modify `generation/property.rs` to use the Builder
- add additional metadata to `Interaction` to give more context for
  shrinking and iterating over interactions that originated from the
  same interaction.
- add Iterator like utilities for `InteractionPlan` to facilitate
  iterating over interactions that came from the same property:
2025-11-17 11:45:02 -03:00
pedrocarlo
c088a653e6 move interaction stats to metrics 2025-11-17 11:45:02 -03:00
pedrocarlo
2fe39d40bb add Span and PropertyMetadata structs 2025-11-17 11:45:02 -03:00
pedrocarlo
a4f0f2364d disable Watch Mode until we can properly serialize interaction plan 2025-11-17 11:45:02 -03:00
pedrocarlo
8f50154db2 separate struct defining code from struct generation code. Also move Remaining to a metrics file 2025-11-17 11:44:20 -03:00
Mikaël Francoeur
d309e6ddb3 generate self-inserts with nested subqueries 2025-11-14 09:16:17 -05:00
Mikaël Francoeur
23d6080531 make FromClause recursive 2025-11-14 09:16:17 -05:00
Mikaël Francoeur
8ea038c00b fix join 2025-11-14 09:16:17 -05:00
Pavan-Nambi
73cabf49f2 fmt sim 2025-10-18 18:46:20 +05:30
Pavan-Nambi
b473a1c3ca Merge remote-tracking branch 'mikael/sim-pragma' into avcm 2025-10-18 16:41:39 +05:30
Jussi Saurio
ebc4ddb2a2 Merge 'Simulator: fix alter table shadowing to modify index column name ' from Pedro Muniz
Forgot to modify the column name referenced in the indexes when
shadowing

Reviewed-by: bit-aloo (@Shourya742)

Closes #3712
2025-10-14 07:25:29 +03:00
pedrocarlo
45567e6837 fix alter table shadowing to modify index column name on rename and alter 2025-10-13 14:02:26 -03:00
pedrocarlo
bfeccf6543 integrate DropIndex in query generator 2025-10-13 13:56:36 -03:00
pedrocarlo
b2e54d9816 add Drop Index to simulator model 2025-10-13 13:32:16 -03:00
pedrocarlo
d99e3f590f ALTER TABLE should be added to is_ddl 2025-10-13 02:34:43 -03:00
pedrocarlo
49e96afd39 generate ALTER COLUMN 2025-10-13 02:34:43 -03:00
pedrocarlo
9c2edbb8b7 create separate Index struct for sql generation 2025-10-13 02:04:15 -03:00
pedrocarlo
c072058e4b add Alter Table query generation in Sim 2025-10-13 02:04:15 -03:00
pedrocarlo
230755eb2e shadow for AlterTable 2025-10-13 02:04:15 -03:00
pedrocarlo
f593080c2a add Query::AlterTable variant 2025-10-10 11:08:04 -03:00
pedrocarlo
b6f94b2fa1 remove dead code in sim 2025-10-09 17:25:04 -03:00
Mikaël Francoeur
7aa91d7c24 add pragma autovacuum_mode to simulator 2025-10-09 17:28:48 +03:00
pedrocarlo
6d5443d4f0 add Query::Placeholder 2025-10-07 11:38:47 -03:00
pedrocarlo
4fc7be5042 as we have DROP table now, if we want to generate extensional queries eagerly, without affecting how we document interactions with MVCC, we need to travel forward in time and shadow queries eagerly so we can generate queries correctly. This involves cloning the tables unfortunately which is inneficient but correct 2025-10-07 11:38:47 -03:00
pedrocarlo
bb9c8dea4f rework interaction generation to only generate possible queries + do less allocations 2025-10-07 02:36:13 -03:00
pedrocarlo
1d1b09dc17 modify query generation to always sample from valid queries 2025-10-07 02:36:13 -03:00
pedrocarlo
13764e6b8e in mvcc if creating a ddl statement, first commit all connections 2025-09-27 23:52:57 -03:00
pedrocarlo
d3c2198a75 keep track of each pending query for the transaction and then apply the queries on commit 2025-09-27 23:52:57 -03:00
pedrocarlo
021d5d272a refactor shadowing code to take into account snapshot isolation 2025-09-20 12:01:07 -03:00
pedrocarlo
c4843d6a6e refactor SimulatorEnv to hold committed tables and separate connection tables for snapshot isolation 2025-09-20 11:52:15 -03:00
pedrocarlo
5f24ff6e45 fix non determinism by using IndexSet for order preserving iteration 2025-09-05 02:00:18 -03:00
TcMits
33a04fbaf7 resolve conflict 2025-09-02 17:30:10 +07:00
pedrocarlo
962666831b read Profile file from path or use predefined profiles 2025-08-30 11:31:52 -03:00
TcMits
4ddfdb2a62 finish 2025-08-27 14:58:35 +07:00
pedrocarlo
8010b7d0c7 make simulator use sql_generation crate as dependency 2025-08-25 22:59:31 -03:00
Jussi Saurio
6c17fa2a5e fix/sim: prevent sim from trying to create an existing table or index
We recently merged a change that panics the sim on parse errors, because
not doing so has masked many scenarios where the sim unintentionally
creates incorrect sql and we just ignore it.

We already have Property::DoubleCreateFailure to assert that the same table
cannot be created twice, so this should not hide any bugs.
2025-08-17 18:13:05 +03:00
pedrocarlo
2bc6edc3d4 introduce TableContext for the simulator to properly generate predicates for Joins 2025-08-15 23:44:00 +03:00
Jussi Saurio
1a11648974 sim: add Property::ReadYourUpdatesBack 2025-08-14 19:04:27 +03:00
meteorgan
b5a18d7dc9 fix get_column_name() when column name doesn't exist 2025-07-25 23:49:31 +08:00
bit-aloo
9a54ef214e parser: Distinguish quoted identifiers and unify Id into Name enum
This commit replaces the `Name(pub String)` struct with a `Name` enum that
explicitly models how the name appeared in the source either as an
unquoted identifier (`Ident`) or a quoted string (`Quoted`).

In the process, the separate `Id` wrapper type has been coalesced into the
`Name` enum, simplifying the AST and reducing duplication in identifier
handling logic.

While this increases the size of some AST nodes (notably `yyStackEntry`),
it improves correctness and makes source structure more explicit for
later phases.
2025-07-24 14:40:19 +05:30
Jussi Saurio
d67a9f03fd sim: add order by to some queries 2025-07-18 10:47:36 +03:00
Levy A.
89911ee8d1 remove to_sql_string from simulator 2025-07-16 12:34:10 -03:00
Levy A.
6fe2505425 add more ToTokens impls 2025-07-16 12:16:31 -03:00
alpaylan
9347e43dfc clippy + fmt 2025-07-15 09:57:55 -04:00
alpaylan
6b96789b6d add random_expr for SELECT <expr>; 2025-07-14 18:48:02 -04:00
alpaylan
731e6e32e8 updates to the generator distribution 2025-07-14 01:27:01 -04:00
alpaylan
d99793ca2f generate parenthesizes expressions by default 2025-07-11 11:08:35 -04:00