From 3491608256587604667d79f2d96379644cd35269 Mon Sep 17 00:00:00 2001 From: congqixia Date: Tue, 20 Aug 2024 16:10:56 +0800 Subject: [PATCH] fix: Match int8_t and int16_t in Array::get_data (#35579) Related to #35578 Previously int16/int8 bitmap index may read int32 array as int16, which may cause build index with half of the data(if array is full) and half zeros. This causes BITMAP index lost information. This PR matches int8_t & int16_t while `get_data` when building index. Signed-off-by: Congqi Xia --- internal/core/src/common/Array.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/core/src/common/Array.h b/internal/core/src/common/Array.h index ce2d6255db..705258c876 100644 --- a/internal/core/src/common/Array.h +++ b/internal/core/src/common/Array.h @@ -16,6 +16,7 @@ #pragma once +#include #include #include @@ -246,6 +247,7 @@ class Array { return T(data_ + offsets_[index], element_length); } if constexpr (std::is_same_v || std::is_same_v || + std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v) { switch (element_type_) { case DataType::INT8: