提交 18b5b5be 编写于 作者: O obdev 提交者: wangzelin.wzl

fix: table api report -4002 when the client request does not include a valid table id

上级 8c74dc19
...@@ -150,11 +150,13 @@ int ObTableBatchExecuteP::try_process() ...@@ -150,11 +150,13 @@ int ObTableBatchExecuteP::try_process()
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
const ObTableBatchOperation &batch_operation = arg_.batch_operation_; const ObTableBatchOperation &batch_operation = arg_.batch_operation_;
uint64_t table_id = arg_.table_id_; uint64_t table_id = OB_INVALID_ID;
bool is_index_supported = true; bool is_index_supported = true;
if (batch_operation.count() <= 0) { if (batch_operation.count() <= 0) {
ret = OB_INVALID_ARGUMENT; ret = OB_INVALID_ARGUMENT;
LOG_WARN("no operation in the batch", K(ret)); LOG_WARN("no operation in the batch", K(ret));
} else if (OB_FAIL(get_table_id(arg_.table_name_, arg_.table_id_, table_id))) {
LOG_WARN("failed to get table id", K(ret));
} else if (OB_FAIL(check_table_index_supported(table_id, is_index_supported))) { } else if (OB_FAIL(check_table_index_supported(table_id, is_index_supported))) {
LOG_WARN("fail to check index supported", K(ret), K(table_id)); LOG_WARN("fail to check index supported", K(ret), K(table_id));
} else if (OB_UNLIKELY(!is_index_supported)) { } else if (OB_UNLIKELY(!is_index_supported)) {
......
...@@ -115,9 +115,16 @@ int ObTableApiExecuteP::try_process() ...@@ -115,9 +115,16 @@ int ObTableApiExecuteP::try_process()
uint64_t table_id = arg_.table_id_; uint64_t table_id = arg_.table_id_;
bool is_index_supported = true; bool is_index_supported = true;
const ObTableOperation &table_operation = arg_.table_operation_; const ObTableOperation &table_operation = arg_.table_operation_;
if (ObTableOperationType::GET != table_operation.type() && if (ObTableOperationType::GET != table_operation.type()) {
OB_FAIL(check_table_index_supported(table_id, is_index_supported))) { if (OB_FAIL(get_table_id(arg_.table_name_, arg_.table_id_, table_id))) {
LOG_WARN("fail to check index supported", K(ret), K(table_id)); LOG_WARN("failed to get table id", K(ret));
} else if (OB_FAIL(check_table_index_supported(table_id, is_index_supported))) {
LOG_WARN("fail to check index supported", K(ret), K(table_id));
}
}
if (OB_FAIL(ret)) {
// do nothing
} else if (OB_UNLIKELY(!is_index_supported)) { } else if (OB_UNLIKELY(!is_index_supported)) {
ret = OB_NOT_SUPPORTED; ret = OB_NOT_SUPPORTED;
LOG_WARN("index type is not supported by table api", K(ret)); LOG_WARN("index type is not supported by table api", K(ret));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册