From 76e4e13b803e43075282a97c3aa3ff842c99e2e4 Mon Sep 17 00:00:00 2001 From: Denis Khalikov Date: Tue, 28 Nov 2023 17:18:52 +0300 Subject: [PATCH] fix(rowgroup,stringstore): MCOL-5597 Set length for `nullptr` string to 0. (#3027) --- utils/common/conststring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/common/conststring.h b/utils/common/conststring.h index 6813cee0a..021529bf5 100644 --- a/utils/common/conststring.h +++ b/utils/common/conststring.h @@ -33,7 +33,8 @@ class ConstString public: ConstString(const char* str, size_t length) : mStr(str), mLength(length) { - idbassert(mStr || mLength == 0); // nullptr mStr should have zero length. + if (!mStr) + mLength = 0; } explicit ConstString(const std::string& str) : mStr(str.data()), mLength(str.length()) {