diff --git a/src/observer/table/ob_table_batch_execute_processor.cpp b/src/observer/table/ob_table_batch_execute_processor.cpp index 4de58562884d6f65a693b52d016eb92568a2d936..0c9b06b4e2b32de41d93795d3939eb6582c95e68 100644 --- a/src/observer/table/ob_table_batch_execute_processor.cpp +++ b/src/observer/table/ob_table_batch_execute_processor.cpp @@ -150,11 +150,13 @@ int ObTableBatchExecuteP::try_process() { int ret = OB_SUCCESS; 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; if (batch_operation.count() <= 0) { ret = OB_INVALID_ARGUMENT; 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))) { LOG_WARN("fail to check index supported", K(ret), K(table_id)); } else if (OB_UNLIKELY(!is_index_supported)) { diff --git a/src/observer/table/ob_table_execute_processor.cpp b/src/observer/table/ob_table_execute_processor.cpp index 6d0c86dfb587e5aaf094a0941217d0eaf4a3d4fb..b08f8aac0f931d23f1e6c6c743b6d8a35450b4cf 100644 --- a/src/observer/table/ob_table_execute_processor.cpp +++ b/src/observer/table/ob_table_execute_processor.cpp @@ -115,9 +115,16 @@ int ObTableApiExecuteP::try_process() uint64_t table_id = arg_.table_id_; bool is_index_supported = true; const ObTableOperation &table_operation = arg_.table_operation_; - if (ObTableOperationType::GET != table_operation.type() && - OB_FAIL(check_table_index_supported(table_id, is_index_supported))) { - LOG_WARN("fail to check index supported", K(ret), K(table_id)); + if (ObTableOperationType::GET != table_operation.type()) { + 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))) { + 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)) { ret = OB_NOT_SUPPORTED; LOG_WARN("index type is not supported by table api", K(ret));