fix another bug

This commit is contained in:
Hongze Cheng 2024-03-07 16:58:26 +08:00
parent 7ffcb60f02
commit d4aa79e631
1 changed files with 17 additions and 14 deletions

View File

@ -196,22 +196,24 @@ static int32_t tRowBuildScan(SArray *colVals, const STSchema *schema, SRowBuildS
// Tuple // Tuple
sinfo->tupleFlag = sinfo->flag; sinfo->tupleFlag = sinfo->flag;
if (sinfo->flag == HAS_NONE || sinfo->flag == HAS_NULL || sinfo->flag == HAS_VALUE) { if (sinfo->flag == HAS_NONE || sinfo->flag == HAS_NULL) {
sinfo->tupleBitmapSize = 0; sinfo->tupleRowSize = sizeof(SRow);
} else if (sinfo->flag == (HAS_NONE | HAS_NULL | HAS_VALUE)) {
sinfo->tupleBitmapSize = BIT2_SIZE(schema->numOfCols - 1);
} else { } else {
sinfo->tupleBitmapSize = BIT1_SIZE(schema->numOfCols - 1); if (sinfo->flag == (HAS_NONE | HAS_NULL | HAS_VALUE)) {
sinfo->tupleBitmapSize = BIT2_SIZE(schema->numOfCols - 1);
} else if (sinfo->flag != HAS_VALUE) {
sinfo->tupleBitmapSize = BIT1_SIZE(schema->numOfCols - 1);
}
for (int32_t i = 0; i < sinfo->numOfPKs; i++) {
sinfo->tupleIndices[i].offset += sinfo->tupleBitmapSize;
sinfo->tuplePKSize += tPutPrimaryKeyIndex(NULL, sinfo->tupleIndices + i);
}
sinfo->tupleRowSize = sizeof(SRow) // SRow
+ sinfo->tuplePKSize // primary keys
+ sinfo->tupleBitmapSize // bitmap
+ sinfo->tupleFixedSize // fixed part
+ sinfo->tupleVarSize; // var part
} }
for (int32_t i = 0; i < sinfo->numOfPKs; i++) {
sinfo->tupleIndices[i].offset += sinfo->tupleBitmapSize;
sinfo->tuplePKSize += tPutPrimaryKeyIndex(NULL, sinfo->tupleIndices + i);
}
sinfo->tupleRowSize = sizeof(SRow) // SRow
+ sinfo->tuplePKSize // primary keys
+ sinfo->tupleBitmapSize // bitmap
+ sinfo->tupleFixedSize // fixed part
+ sinfo->tupleVarSize; // var part
// Key-Value // Key-Value
if (sinfo->kvMaxOffset <= UINT8_MAX) { if (sinfo->kvMaxOffset <= UINT8_MAX) {
@ -251,6 +253,7 @@ static int32_t tRowBuildTupleRow(SArray *aColVal, const SRowBuildScanInfo *sinfo
(*ppRow)->ts = colValArray[0].value.val; (*ppRow)->ts = colValArray[0].value.val;
if (sinfo->tupleFlag == HAS_NONE || sinfo->tupleFlag == HAS_NULL) { if (sinfo->tupleFlag == HAS_NONE || sinfo->tupleFlag == HAS_NULL) {
ASSERT(sinfo->tupleRowSize == sizeof(SRow));
return 0; return 0;
} }