From 537db284a88c1020dd3d9083d0df8ee97207dc27 Mon Sep 17 00:00:00 2001 From: "zirui.chen" Date: Thu, 5 Sep 2019 16:42:33 +0800 Subject: [PATCH] MS-470 Drop index success, which table not created Former-commit-id: e82f92b1a459a3cbf77d31387b00e198b605dccc --- cpp/CHANGELOG.md | 1 + cpp/src/server/grpc_impl/GrpcRequestTask.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index c9247d97..66da2382 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -24,6 +24,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-462 - Run milvus server twices, should display error - MS-463 - Search timeout - MS-467 - mysql db test failed +- MS-470 - Drop index success, which table not created - MS-471 - code coverage run failed ## Improvement diff --git a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp index 1b9bc935..d9b0d049 100644 --- a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp +++ b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp @@ -960,8 +960,15 @@ DropIndexTask::OnExecute() { return SetError(res, "Invalid table name: " + table_name_); } - //step 2: check table existence - engine::Status stat = DBWrapper::DB()->DropIndex(table_name_); + //step 2:check index existence + engine::TableIndex index; + engine::Status stat = DBWrapper::DB()->DescribeIndex(table_name_, index); + if (index.engine_type_ == 1) { + return SetError(SERVER_UNEXPECTED_ERROR, "index not existed"); + } + + //step 3: check table existence + stat = DBWrapper::DB()->DropIndex(table_name_); if (!stat.ok()) { return SetError(DB_META_TRANSACTION_FAILED, stat.ToString()); } -- GitLab