mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-01 04:40:39 +00:00
fix: force set gRPC create request's table ID to None (#502)
* fix: force set gRPC create request's table ID to None Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix: fix style Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -650,7 +650,12 @@ fn get_schema_name(expr: &AdminExpr) -> &str {
|
||||
|
||||
#[async_trait]
|
||||
impl GrpcAdminHandler for Instance {
|
||||
async fn exec_admin_request(&self, expr: AdminExpr) -> server_error::Result<AdminResult> {
|
||||
async fn exec_admin_request(&self, mut expr: AdminExpr) -> server_error::Result<AdminResult> {
|
||||
// Force the default to be `None` rather than `Some(0)` comes from gRPC decode.
|
||||
// Related issue: #480
|
||||
if let Some(api::v1::admin_expr::Expr::Create(create)) = &mut expr.expr {
|
||||
create.table_id = None;
|
||||
}
|
||||
self.admin(get_schema_name(&expr))
|
||||
.do_request(expr.clone())
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user