From 3465a01bf5d4812f6d169a9c0fa8176fd3dedbb4 Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Tue, 14 Oct 2025 15:31:43 +0300 Subject: [PATCH] fuzz: sometimes make UPDATEd value a function of the old value --- tests/integration/fuzz/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/integration/fuzz/mod.rs b/tests/integration/fuzz/mod.rs index e9b81cd33..803b3046d 100644 --- a/tests/integration/fuzz/mod.rs +++ b/tests/integration/fuzz/mod.rs @@ -1952,7 +1952,16 @@ mod tests { }; let query = if do_update { - let new_y = rng.random_range(0..1000); + let new_y = if rng.random_bool(0.5) { + // Update to a constant value + rng.random_range(0..1000).to_string() + } else { + let source_col = rng.random_range(0..num_cols); + // Update to a value that is a function of the another column + let operator = *["+", "-"].choose(&mut rng).unwrap(); + let amount = rng.random_range(0..1000); + format!("c{source_col} {operator} {amount}") + }; format!("UPDATE t SET c{affected_col} = {new_y} {where_clause}") } else { format!("DELETE FROM t {where_clause}")