Skip to content

Commit

Permalink
chore: enable fuzz test for append table
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Sep 9, 2024
1 parent 208afe4 commit 50c3c5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests-fuzz/targets/fuzz_insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#![no_main]

use std::collections::HashMap;
use std::sync::Arc;

use common_telemetry::info;
Expand Down Expand Up @@ -83,13 +84,19 @@ fn generate_create_expr<R: Rng + 'static>(
input: FuzzInput,
rng: &mut R,
) -> Result<CreateTableExpr> {
let mut with_clause = HashMap::new();
if rng.gen_bool(0.5) {
with_clause.insert("append_mode".to_string(), "true".to_string());
}

let create_table_generator = CreateTableExprGeneratorBuilder::default()
.name_generator(Box::new(MappedGenerator::new(
WordGenerator,
merge_two_word_map_fn(random_capitalize_map, uppercase_and_keyword_backtick_map),
)))
.columns(input.columns)
.engine("mito")
.with_clause(with_clause)
.ts_column_type_generator(Box::new(MySQLTsColumnTypeGenerator))
.build()
.unwrap();
Expand Down

0 comments on commit 50c3c5e

Please sign in to comment.