This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new bf2eee9ad1e Fix: Null value settings not applying correctly in tablet. 
(#15228)
bf2eee9ad1e is described below

commit bf2eee9ad1effdbb8db0bc4b3a9ffae9631c2f22
Author: Hongzhi Gao <[email protected]>
AuthorDate: Mon Mar 31 09:37:32 2025 +0800

    Fix: Null value settings not applying correctly in tablet. (#15228)
---
 iotdb-client/client-cpp/src/main/Session.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/iotdb-client/client-cpp/src/main/Session.cpp 
b/iotdb-client/client-cpp/src/main/Session.cpp
index 8581e7a0212..316bd1d9443 100644
--- a/iotdb-client/client-cpp/src/main/Session.cpp
+++ b/iotdb-client/client-cpp/src/main/Session.cpp
@@ -274,7 +274,7 @@ string SessionUtils::getValue(const Tablet &tablet) {
                         valueBuffer.putInt(valueBuf[index]);
                     }
                     else {
-                        valueBuffer.putInt((numeric_limits<int>::min)());
+                        valueBuffer.putInt((numeric_limits<int32_t>::min)());
                     }
                 }
                 break;
@@ -318,7 +318,11 @@ string SessionUtils::getValue(const Tablet &tablet) {
             case TSDataType::TEXT: {
                 string* valueBuf = (string*)(tablet.values[i]);
                 for (size_t index = 0; index < tablet.rowSize; index++) {
-                    valueBuffer.putString(valueBuf[index]);
+                    if (!bitMap.isMarked(index)) {
+                        valueBuffer.putString(valueBuf[index]);
+                    } else {
+                        valueBuffer.putString("");
+                    }
                 }
                 break;
             }
@@ -332,8 +336,8 @@ string SessionUtils::getValue(const Tablet &tablet) {
         valueBuffer.putChar(columnHasNull ? (char) 1 : (char) 0);
         if (columnHasNull) {
             const vector<char>& bytes = bitMap.getByteArray();
-            for (const char byte: bytes) {
-                valueBuffer.putChar(byte);
+            for (size_t index = 0; index < tablet.rowSize / 8 + 1; index++) {
+                valueBuffer.putChar(bytes[index]);
             }
         }
     }

Reply via email to