mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-05 08:50:58 +00:00
test: cover invalid decimals in gRPC modify column type
Signed-off-by: dayan02dev <pawarudayan92@gmail.com>
This commit is contained in:
1 parent
dd0b6b4568
commit
63d1ca7ce2
1 file changed
+20
@@ -691,6 +691,26 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_modify_column_type_invalid_decimal_expr() {
|
||||||
|
let (_, decimal_extension) = ColumnDataTypeWrapper::decimal128_datatype(65, 30).to_parts();
|
||||||
|
let expr = AlterTableExpr {
|
||||||
|
catalog_name: "test_catalog".to_string(),
|
||||||
|
schema_name: "test_schema".to_string(),
|
||||||
|
table_name: "monitor".to_string(),
|
||||||
|
|
||||||
|
kind: Some(Kind::ModifyColumnTypes(ModifyColumnTypes {
|
||||||
|
modify_column_types: vec![ModifyColumnType {
|
||||||
|
column_name: "mem_usage".to_string(),
|
||||||
|
target_type: ColumnDataType::Decimal128 as i32,
|
||||||
|
target_type_extension: decimal_extension,
|
||||||
|
}],
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
|
||||||
|
assert!(alter_expr_to_request(1, expr, None).is_err());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_drop_column_expr() {
|
fn test_drop_column_expr() {
|
||||||
let expr = AlterTableExpr {
|
let expr = AlterTableExpr {
|
||||||
|
|||||||
Reference in new issue
Block a user