Skip to content

Commit

Permalink
fix: remove backticks of table name in with clause
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePieWw committed Apr 19, 2024
1 parent e92988c commit fea44ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests-fuzz/targets/fuzz_create_logical_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ fn generate_create_logical_table_expr<R: Rng + 'static>(
let if_not_exists = rng.gen_bool(0.5);
let columns = rng.gen_range(2..30);
let overlapped_columns = rng.gen_range(0..table_ctx.columns.len() - 1);

// Sometimes the name of the table is like `table_name` with backticks, we need to remove them in the with clause
let physical_table_name = table_ctx.name.to_string().replace('`', "");

let create_table_generator = CreateTableExprGeneratorBuilder::default()
.name_generator(Box::new(MappedGenerator::new(
WordGenerator,
Expand All @@ -96,7 +100,7 @@ fn generate_create_logical_table_expr<R: Rng + 'static>(
.columns(columns)
.engine("metric")
.if_not_exists(if_not_exists)
.with_clause([("on_physical_table".to_string(), table_ctx.name.to_string())])
.with_clause([("on_physical_table".to_string(), physical_table_name)])
.build()
.unwrap();

Expand Down

0 comments on commit fea44ad

Please sign in to comment.