mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-18 12:08:22 +00:00
fix(fuzz): expect metric integer companion columns
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -25,6 +25,7 @@ use rand::{Rng, SeedableRng};
|
||||
use rand_chacha::ChaChaRng;
|
||||
use snafu::ResultExt;
|
||||
use sqlx::{MySql, Pool};
|
||||
use store_api::metric_engine_consts::metric_engine_value_int_column_name;
|
||||
use tests_fuzz::context::{TableContext, TableContextRef};
|
||||
use tests_fuzz::error::{self, Result};
|
||||
use tests_fuzz::fake::{
|
||||
@@ -129,7 +130,16 @@ async fn execute_alter_table(ctx: FuzzContext, input: FuzzInput) -> Result<()> {
|
||||
.context(error::ExecuteQuerySnafu { sql: &sql })?;
|
||||
info!("Create physical table: {sql}, result: {result:?}");
|
||||
|
||||
let mut physical_table_meta_columns = vec![];
|
||||
let mut physical_table_meta_columns = create_physical_table_expr
|
||||
.columns
|
||||
.iter()
|
||||
.filter(|column| column.column_type == ConcreteDataType::float64_datatype())
|
||||
.map(|column| Column {
|
||||
name: metric_engine_value_int_column_name(&column.name.value).into(),
|
||||
column_type: ConcreteDataType::int64_datatype(),
|
||||
options: vec![],
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
physical_table_meta_columns.push({
|
||||
let column_type = ConcreteDataType::uint64_datatype();
|
||||
let options = primary_key_and_not_null_column_options_generator(&mut rng, &column_type);
|
||||
|
||||
@@ -25,6 +25,7 @@ use rand::{Rng, SeedableRng};
|
||||
use rand_chacha::ChaChaRng;
|
||||
use snafu::ResultExt;
|
||||
use sqlx::{MySql, Pool};
|
||||
use store_api::metric_engine_consts::metric_engine_value_int_column_name;
|
||||
use tests_fuzz::context::TableContext;
|
||||
use tests_fuzz::error::{self, Result};
|
||||
use tests_fuzz::fake::{
|
||||
@@ -92,6 +93,16 @@ async fn execute_create_logic_table(ctx: FuzzContext, input: FuzzInput) -> Resul
|
||||
info!("Create physical table: {sql}, result: {result:?}");
|
||||
|
||||
let mut physical_table_columns = create_physical_table_expr.columns.clone();
|
||||
let value_int_columns = physical_table_columns
|
||||
.iter()
|
||||
.filter(|column| column.column_type == ConcreteDataType::float64_datatype())
|
||||
.map(|column| Column {
|
||||
name: metric_engine_value_int_column_name(&column.name.value).into(),
|
||||
column_type: ConcreteDataType::int64_datatype(),
|
||||
options: vec![],
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
physical_table_columns.extend(value_int_columns);
|
||||
physical_table_columns.push({
|
||||
let column_type = ConcreteDataType::uint64_datatype();
|
||||
let options = primary_key_and_not_null_column_options_generator(&mut rng, &column_type);
|
||||
|
||||
Reference in New Issue
Block a user