fix: fix nullbitmap shift error when trimming data blocks.

This commit is contained in:
Ganlin Zhao 2023-04-07 18:08:49 +08:00
parent 8b063357e1
commit 2d0dad7a37
2 changed files with 2 additions and 2 deletions

View File

@ -1590,7 +1590,7 @@ static void doShiftBitmap(char* nullBitmap, size_t n, size_t total) {
i += 1;
}
} else if (n > 8) {
int32_t remain = (total % 8 <= tail) ? 1 : 0;
int32_t remain = (total % 8 != 0 && total % 8 <= tail) ? 1 : 0;
int32_t gap = len - newLen - remain;
while (i < newLen) {
uint8_t v = p[i + gap];

View File

@ -288,7 +288,7 @@ class TDTestCase:
tdSql.checkData(0, 3, 5.000000000)
tdSql.checkData(0, 4, 5.000000000)
tdSql.checkData(0, 5, 0.000000000)
tdSql.checkData(0, 7, None)
tdSql.checkData(0, 7, 1)
tdSql.checkData(0, 8, "binary5")
tdSql.checkData(0, 9, "nchar5")
tdSql.checkData(1, 8, None)