Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions be/src/olap/key_coder.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,13 @@ class KeyCoderTraits<FieldType::OLAP_FIELD_TYPE_DECIMAL> {
template <>
class KeyCoderTraits<FieldType::OLAP_FIELD_TYPE_CHAR> {
public:
static void full_encode_ascending(const void* value, std::string* buf) {
NO_SANITIZE_UNDEFINED static void full_encode_ascending(const void* value, std::string* buf) {
auto slice = reinterpret_cast<const Slice*>(value);
buf->append(slice->get_data(), slice->get_size());
}

static void encode_ascending(const void* value, size_t index_size, std::string* buf) {
NO_SANITIZE_UNDEFINED static void encode_ascending(const void* value, size_t index_size,
std::string* buf) {
const Slice* slice = (const Slice*)value;
CHECK(index_size <= slice->size)
<< "index size is larger than char size, index=" << index_size
Expand All @@ -282,12 +283,13 @@ class KeyCoderTraits<FieldType::OLAP_FIELD_TYPE_CHAR> {
template <>
class KeyCoderTraits<FieldType::OLAP_FIELD_TYPE_VARCHAR> {
public:
static void full_encode_ascending(const void* value, std::string* buf) {
NO_SANITIZE_UNDEFINED static void full_encode_ascending(const void* value, std::string* buf) {
auto slice = reinterpret_cast<const Slice*>(value);
buf->append(slice->get_data(), slice->get_size());
}

static void encode_ascending(const void* value, size_t index_size, std::string* buf) {
NO_SANITIZE_UNDEFINED static void encode_ascending(const void* value, size_t index_size,
std::string* buf) {
const Slice* slice = (const Slice*)value;
size_t copy_size = std::min(index_size, slice->size);
buf->append(slice->data, copy_size);
Expand All @@ -301,12 +303,13 @@ class KeyCoderTraits<FieldType::OLAP_FIELD_TYPE_VARCHAR> {
template <>
class KeyCoderTraits<FieldType::OLAP_FIELD_TYPE_STRING> {
public:
static void full_encode_ascending(const void* value, std::string* buf) {
NO_SANITIZE_UNDEFINED static void full_encode_ascending(const void* value, std::string* buf) {
auto slice = reinterpret_cast<const Slice*>(value);
buf->append(slice->get_data(), slice->get_size());
}

static void encode_ascending(const void* value, size_t index_size, std::string* buf) {
NO_SANITIZE_UNDEFINED static void encode_ascending(const void* value, size_t index_size,
std::string* buf) {
const Slice* slice = (const Slice*)value;
size_t copy_size = std::min(index_size, slice->size);
buf->append(slice->data, copy_size);
Expand Down
1 change: 1 addition & 0 deletions conf/ubsan_ignorelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ src:*/json/new_json_reader.cpp
src:*/common/memcpy_small.h
src:*/util/mysql_row_buffer.cpp
src:*/util/bitmap_intersect.h
src:*/util/slice.h
fun:*BaseFieldTypeTraits*
fun:*FieldTypeTraits*
fun:*KeyCoderTraits*
3 changes: 2 additions & 1 deletion conf/ubsan_suppr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# specific language governing permissions and limitations
# under the License.

alignment:hash_util.hpp
alignment:hash_util.hpp
alignment:slice.h
Loading