From 34f935df6649c457b22a31f632ba103db9214f72 Mon Sep 17 00:00:00 2001 From: Yohan Wal <59358312+CookiePieWw@users.noreply.github.com> Date: Tue, 9 Apr 2024 20:11:38 +0800 Subject: [PATCH] chore: create database api change in protobuf (#3682) --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/common/meta/src/rpc/ddl.rs | 6 +++--- src/frontend/src/instance/grpc.rs | 2 +- tests-integration/src/grpc.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96e4593582..c2be732e37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3764,7 +3764,7 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "greptime-proto" version = "0.1.0" -source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=c00c73b76ed20a603e4d29fb96cb4e6ef987bba7#c00c73b76ed20a603e4d29fb96cb4e6ef987bba7" +source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=b97efbf92a0bf9abcfa1d8fe0ffe8741a2e7309e#b97efbf92a0bf9abcfa1d8fe0ffe8741a2e7309e" dependencies = [ "prost 0.12.3", "serde", diff --git a/Cargo.toml b/Cargo.toml index 9f0a7d3c78..0ecd7d2caf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,7 @@ etcd-client = "0.12" fst = "0.4.7" futures = "0.3" futures-util = "0.3" -greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "c00c73b76ed20a603e4d29fb96cb4e6ef987bba7" } +greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "b97efbf92a0bf9abcfa1d8fe0ffe8741a2e7309e" } humantime = "2.1" humantime-serde = "1.1" itertools = "0.10" diff --git a/src/common/meta/src/rpc/ddl.rs b/src/common/meta/src/rpc/ddl.rs index 37bd17b905..f48e2f6486 100644 --- a/src/common/meta/src/rpc/ddl.rs +++ b/src/common/meta/src/rpc/ddl.rs @@ -635,7 +635,7 @@ impl TryFrom for CreateDatabaseTask { fn try_from(pb: PbCreateDatabaseTask) -> Result { let CreateDatabaseExpr { catalog_name, - database_name, + schema_name, create_if_not_exists, options, } = pb.create_database.context(error::InvalidProtoMsgSnafu { @@ -644,7 +644,7 @@ impl TryFrom for CreateDatabaseTask { Ok(CreateDatabaseTask { catalog: catalog_name, - schema: database_name, + schema: schema_name, create_if_not_exists, options: Some(options), }) @@ -665,7 +665,7 @@ impl TryFrom for PbCreateDatabaseTask { Ok(PbCreateDatabaseTask { create_database: Some(CreateDatabaseExpr { catalog_name: catalog, - database_name: schema, + schema_name: schema, create_if_not_exists, options: options.unwrap_or_default(), }), diff --git a/src/frontend/src/instance/grpc.rs b/src/frontend/src/instance/grpc.rs index 5dd20808f0..30fdb0489c 100644 --- a/src/frontend/src/instance/grpc.rs +++ b/src/frontend/src/instance/grpc.rs @@ -120,7 +120,7 @@ impl GrpcQueryHandler for Instance { self.statement_executor .create_database( ctx.current_catalog(), - &expr.database_name, + &expr.schema_name, expr.create_if_not_exists, ) .await? diff --git a/tests-integration/src/grpc.rs b/tests-integration/src/grpc.rs index 1aee8c9d37..c115de52ab 100644 --- a/tests-integration/src/grpc.rs +++ b/tests-integration/src/grpc.rs @@ -74,7 +74,7 @@ mod test { let request = Request::Ddl(DdlRequest { expr: Some(DdlExpr::CreateDatabase(CreateDatabaseExpr { catalog_name: "greptime".to_string(), - database_name: "database_created_through_grpc".to_string(), + schema_name: "database_created_through_grpc".to_string(), create_if_not_exists: true, options: Default::default(), })),