HasTable with a not exist table name, return error status (#1761)

Signed-off-by: groot <yihua.mo@zilliz.com>
pull/1769/head
groot 2020-03-26 19:59:49 +08:00 committed by GitHub
parent f93b464172
commit 0da3c712ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 8 deletions

View File

@ -46,11 +46,7 @@ HasTableRequest::OnExecute() {
// step 2: check table existence
status = DBWrapper::DB()->HasNativeTable(table_name_, has_table_);
fiu_do_on("HasTableRequest.OnExecute.table_not_exist", status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
fiu_do_on("HasTableRequest.OnExecute.throw_std_exception", throw std::exception());
if (!status.ok()) {
return status;
}
// only process root table, ignore partition table
if (has_table_) {

View File

@ -206,10 +206,6 @@ TEST_F(RpcHandlerTest, HAS_TABLE_TEST) {
ASSERT_EQ(error_code, ::milvus::grpc::ErrorCode::SUCCESS);
fiu_init(0);
fiu_enable("HasTableRequest.OnExecute.table_not_exist", 1, NULL, 0);
handler->HasTable(&context, &request, &reply);
ASSERT_NE(reply.status().error_code(), ::milvus::grpc::ErrorCode::SUCCESS);
fiu_disable("HasTableRequest.OnExecute.table_not_exist");
fiu_enable("HasTableRequest.OnExecute.throw_std_exception", 1, NULL, 0);
handler->HasTable(&context, &request, &reply);