Skip to content

Commit bf2eee9

Browse files
authored
Fix: Null value settings not applying correctly in tablet. (apache#15228)
1 parent 7e4e01c commit bf2eee9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

iotdb-client/client-cpp/src/main/Session.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ string SessionUtils::getValue(const Tablet &tablet) {
274274
valueBuffer.putInt(valueBuf[index]);
275275
}
276276
else {
277-
valueBuffer.putInt((numeric_limits<int>::min)());
277+
valueBuffer.putInt((numeric_limits<int32_t>::min)());
278278
}
279279
}
280280
break;
@@ -318,7 +318,11 @@ string SessionUtils::getValue(const Tablet &tablet) {
318318
case TSDataType::TEXT: {
319319
string* valueBuf = (string*)(tablet.values[i]);
320320
for (size_t index = 0; index < tablet.rowSize; index++) {
321-
valueBuffer.putString(valueBuf[index]);
321+
if (!bitMap.isMarked(index)) {
322+
valueBuffer.putString(valueBuf[index]);
323+
} else {
324+
valueBuffer.putString("");
325+
}
322326
}
323327
break;
324328
}
@@ -332,8 +336,8 @@ string SessionUtils::getValue(const Tablet &tablet) {
332336
valueBuffer.putChar(columnHasNull ? (char) 1 : (char) 0);
333337
if (columnHasNull) {
334338
const vector<char>& bytes = bitMap.getByteArray();
335-
for (const char byte: bytes) {
336-
valueBuffer.putChar(byte);
339+
for (size_t index = 0; index < tablet.rowSize / 8 + 1; index++) {
340+
valueBuffer.putChar(bytes[index]);
337341
}
338342
}
339343
}

0 commit comments

Comments
 (0)