From 677d35ea7031568eea1b3e11b5f261201d2ce512 Mon Sep 17 00:00:00 2001 From: Maxwell <49460053+mxwli@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:11:00 -0400 Subject: [PATCH] List Auxiliary Buffer NullMask Fix (#3156) * initial commit * apply clang format fix --- src/common/vector/auxiliary_buffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/vector/auxiliary_buffer.cpp b/src/common/vector/auxiliary_buffer.cpp index 4904a50b27..a31d6f3ca1 100644 --- a/src/common/vector/auxiliary_buffer.cpp +++ b/src/common/vector/auxiliary_buffer.cpp @@ -52,7 +52,8 @@ void ListAuxiliaryBuffer::resizeDataVector(ValueVector* dataVector) { auto buffer = std::make_unique(capacity * dataVector->getNumBytesPerValue()); memcpy(buffer.get(), dataVector->valueBuffer.get(), size * dataVector->getNumBytesPerValue()); dataVector->valueBuffer = std::move(buffer); - dataVector->nullMask->resize(capacity); // note: allocating 64 times what is needed + dataVector->nullMask->resize((capacity + NullMask::NUM_BITS_PER_NULL_ENTRY - 1) >> + NullMask::NUM_BITS_PER_NULL_ENTRY_LOG2); // If the dataVector is a struct vector, we need to resize its field vectors. if (dataVector->dataType.getPhysicalType() == PhysicalTypeID::STRUCT) { resizeStructDataVector(dataVector);