diff --git a/tests-fuzz/src/generator/create_expr.rs b/tests-fuzz/src/generator/create_expr.rs index ad32032a749c..57f8966844ff 100644 --- a/tests-fuzz/src/generator/create_expr.rs +++ b/tests-fuzz/src/generator/create_expr.rs @@ -30,9 +30,9 @@ use crate::generator::{ColumnOptionGenerator, ConcreteDataTypeGenerator, Random} use crate::ir::create_expr::{ColumnOption, CreateDatabaseExprBuilder, CreateTableExprBuilder}; use crate::ir::{ column_options_generator, generate_columns, generate_random_value, - partible_column_options_generator, primary_key_and_not_null_column_options_generator, - ts_column_options_generator, Column, ColumnTypeGenerator, CreateDatabaseExpr, CreateTableExpr, - Ident, PartibleColumnTypeGenerator, StringColumnTypeGenerator, TsColumnTypeGenerator, + partible_column_options_generator, primary_key_options_generator, ts_column_options_generator, + Column, ColumnTypeGenerator, CreateDatabaseExpr, CreateTableExpr, Ident, + PartibleColumnTypeGenerator, StringColumnTypeGenerator, TsColumnTypeGenerator, }; #[derive(Builder)] @@ -286,17 +286,9 @@ impl Generator for CreateLogicalTableExprG rng, column_names, &StringColumnTypeGenerator, - Box::new(primary_key_and_not_null_column_options_generator), + Box::new(primary_key_options_generator), )); - logical_table.columns.iter_mut().for_each(|column| { - if column.column_type == ConcreteDataType::string_datatype() { - column - .options - .retain(|option| option == &ColumnOption::PrimaryKey); - } - }); - // Currently only the `primary key` option is kept in physical table, // so we only keep the `primary key` option in the logical table for fuzz test. let mut primary_keys = vec![]; diff --git a/tests-fuzz/src/ir.rs b/tests-fuzz/src/ir.rs index 8bb55311dad1..eb6ee105b2c8 100644 --- a/tests-fuzz/src/ir.rs +++ b/tests-fuzz/src/ir.rs @@ -333,6 +333,13 @@ pub fn primary_key_and_not_null_column_options_generator( vec![ColumnOption::PrimaryKey, ColumnOption::NotNull] } +pub fn primary_key_options_generator( + _: &mut R, + _: &ConcreteDataType, +) -> Vec { + vec![ColumnOption::PrimaryKey] +} + /// Generates columns with given `names`. pub fn generate_columns( rng: &mut R,