From b8e97f1d4d998cd76dfbf5679dfc247cc986117d Mon Sep 17 00:00:00 2001 From: starlord Date: Thu, 10 Oct 2019 11:40:25 +0800 Subject: [PATCH] MS-620 Get table row counts display wrong error code Former-commit-id: efac2241b903fbb45eb26adf2d9dfd79fa8f1353 --- cpp/CHANGELOG.md | 1 + cpp/src/server/grpc_impl/GrpcRequestTask.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index f7babebb85..aed69e0479 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -12,6 +12,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-599 - search wrong result when table created with metric_type: IP - MS-601 - Docker logs error caused by get CPUTemperature error - MS-622 - Delete vectors should be failed if date range is invalid +- MS-620 - Get table row counts display wrong error code ## Improvement - MS-552 - Add and change the easylogging library diff --git a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp index 23ae84b33e..1279cbac9f 100644 --- a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp +++ b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp @@ -706,7 +706,11 @@ CountTableTask::OnExecute() { uint64_t row_count = 0; status = DBWrapper::DB()->GetTableRowCount(table_name_, row_count); if (!status.ok()) { - return status; + if (status.code(), DB_NOT_FOUND) { + return Status(SERVER_TABLE_NOT_EXIST, "Table " + table_name_ + " not exists"); + } else { + return status; + } } row_count_ = static_cast(row_count);