提交 dd8aaaf3 编写于 作者: C Cary Xu

bug fix for reading SDataRow VarT Values

上级 c02c5d8b
...@@ -343,7 +343,6 @@ SNewVgroupInfo createNewVgroupInfo(SVgroupMsg *pVgroupMsg); ...@@ -343,7 +343,6 @@ SNewVgroupInfo createNewVgroupInfo(SVgroupMsg *pVgroupMsg);
typedef struct { typedef struct {
// for SDataRow // for SDataRow
STSchema* pTSchema;
SSchema* pSchema; SSchema* pSchema;
int16_t sversion; int16_t sversion;
int32_t flen; int32_t flen;
......
...@@ -1714,7 +1714,7 @@ SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) { ...@@ -1714,7 +1714,7 @@ SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
} }
pBuilder->buf = p; pBuilder->buf = p;
} else if (memRowType == SMEM_ROW_KV) { } else if (memRowType == SMEM_ROW_KV) {
ASSERT(nColsNotNull < pBuilder->nCols); ASSERT(nColsNotNull <= pBuilder->nCols);
SKVRow kvRow = (SKVRow)memRowBody(memRow); SKVRow kvRow = (SKVRow)memRowBody(memRow);
uint16_t tlen = TD_KV_ROW_HEAD_SIZE + sizeof(SColIdx) * nColsNotNull; uint16_t tlen = TD_KV_ROW_HEAD_SIZE + sizeof(SColIdx) * nColsNotNull;
kvRowSetLen(kvRow, tlen); kvRowSetLen(kvRow, tlen);
...@@ -1810,6 +1810,7 @@ static int32_t getRowExpandSize(STableMeta* pTableMeta) { ...@@ -1810,6 +1810,7 @@ static int32_t getRowExpandSize(STableMeta* pTableMeta) {
if (IS_VAR_DATA_TYPE((pSchema + i)->type)) { if (IS_VAR_DATA_TYPE((pSchema + i)->type)) {
result += TYPE_BYTES[TSDB_DATA_TYPE_BINARY]; result += TYPE_BYTES[TSDB_DATA_TYPE_BINARY];
} }
result += sizeof(SColIdx);
} }
result += TD_MEM_ROW_TYPE_SIZE; // add len of SMemRow flag result += TD_MEM_ROW_TYPE_SIZE; // add len of SMemRow flag
return result; return result;
......
...@@ -1459,6 +1459,7 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, ...@@ -1459,6 +1459,7 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
int32_t i = 0; int32_t i = 0;
if (isDataRow(row)) { if (isDataRow(row)) {
SDataRow dataRow = memRowBody(row);
int32_t j = 0; int32_t j = 0;
while (i < numOfCols && j < numOfRowCols) { while (i < numOfCols && j < numOfRowCols) {
SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i);
...@@ -1475,7 +1476,7 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, ...@@ -1475,7 +1476,7 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
if (pSchema->columns[j].colId == pColInfo->info.colId) { if (pSchema->columns[j].colId == pColInfo->info.colId) {
void* value = void* value =
tdGetRowDataOfCol(row, (int8_t)pColInfo->info.type, TD_MEM_ROW_HEAD_SIZE + pSchema->columns[j].offset); tdGetRowDataOfCol(dataRow, (int8_t)pColInfo->info.type, TD_DATA_ROW_HEAD_SIZE + pSchema->columns[j].offset);
switch (pColInfo->info.type) { switch (pColInfo->info.type) {
case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_NCHAR:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册