diff --git a/be/src/vec/functions/function_bitmap.cpp b/be/src/vec/functions/function_bitmap.cpp index fb0e0471caac06..7f8ca009f991cb 100644 --- a/be/src/vec/functions/function_bitmap.cpp +++ b/be/src/vec/functions/function_bitmap.cpp @@ -289,8 +289,8 @@ struct BitmapFromBase64 { } else { BitmapValue bitmap_val; if (!bitmap_val.deserialize(decode_buff.data())) { - return Status::RuntimeError( - fmt::format("bitmap_from_base64 decode failed: base64: {}", src_str)); + return Status::RuntimeError("bitmap_from_base64 decode failed: base64: {}", + std::string(src_str, src_size)); } res.emplace_back(std::move(bitmap_val)); } diff --git a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy index 523cfc0a0cd8a0..5be83b29aa385a 100644 --- a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy +++ b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy @@ -927,4 +927,9 @@ suite("test_bitmap_function") { // BITMAP_FROM_ARRAY sql """ set experimental_enable_nereids_planner=true; """ qt_sql """ select bitmap_to_string(BITMAP_FROM_ARRAY([]));""" + + test { + sql """ SELECT bitmap_from_base64('CQoL') AS result; """ + exception "bitmap_from_base64 decode failed" + } }