diff --git a/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp b/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp index 101af65528..03ca468b29 100644 --- a/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp +++ b/src/storage/blocksstable/index_block/ob_index_block_aggregator.cpp @@ -49,6 +49,7 @@ int ObColNullCountAggregator::init(const ObColDesc &col_desc, ObStorageDatum &re if (is_skip_index_black_list_type(col_desc.col_type_.get_type())) { set_not_aggregate(); } + col_desc_ = col_desc; } return ret; } @@ -73,6 +74,9 @@ int ObColNullCountAggregator::eval(const ObStorageDatum &datum, const bool is_da // Skip } else if (is_data) { null_count_ += datum.is_null() ? 1 : 0; + } else if (datum.is_null()) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("Unexpected index block data", K(ret), K(datum)); } else { null_count_ += datum.get_int(); } diff --git a/src/storage/blocksstable/index_block/ob_index_block_util.h b/src/storage/blocksstable/index_block/ob_index_block_util.h index 5f49e52a41..2f72492b2a 100644 --- a/src/storage/blocksstable/index_block/ob_index_block_util.h +++ b/src/storage/blocksstable/index_block/ob_index_block_util.h @@ -156,14 +156,14 @@ OB_INLINE static int get_skip_index_store_upper_size( OB_INLINE static bool is_skip_index_black_list_type(const ObObjType &obj_type) { - return ob_is_json_tc(obj_type) || ob_is_geometry_tc(obj_type) + return ObNullType == obj_type || ob_is_json_tc(obj_type) || ob_is_geometry_tc(obj_type) || ob_is_user_defined_sql_type(obj_type); } OB_INLINE static bool is_skip_index_while_list_type(const ObObjType &obj_type) { const ObObjTypeClass tc = ob_obj_type_class(obj_type); - return (ObNullTC <= tc && tc <= ObLobTC) || ObDecimalIntTC == tc; + return (ObIntTC <= tc && tc <= ObLobTC) || ObDecimalIntTC == tc; } } // blocksstable