fix(query): fix bugs caused by refactor.

This commit is contained in:
Haojun Liao 2024-05-19 12:30:18 +08:00
parent ad95b27cf2
commit d69d11a74f
2 changed files with 11 additions and 5 deletions

View File

@ -87,10 +87,16 @@ static void toDataCacheEntry(SDataDispatchHandle* pHandle, const SInputData* pIn
int32_t dataLen = blockEncode(pInput->pData, p, numOfCols);
int32_t len = tsCompressString(p, dataLen, 1, pEntry->data, pBuf->allocSize, ONE_STAGE_COMP, NULL, 0);
pEntry->compressed = 1;
pEntry->dataLen = len;
pEntry->rawLen = dataLen;
if (len < dataLen) {
pEntry->compressed = 1;
pEntry->dataLen = len;
pEntry->rawLen = dataLen;
} else { // no need to compress data
pEntry->compressed = 0;
pEntry->dataLen = dataLen;
pEntry->rawLen = dataLen;
memcpy(pEntry->data, p, dataLen);
}
taosMemoryFree(p);
} else {
pEntry->dataLen = blockEncode(pInput->pData, pEntry->data, numOfCols);

View File

@ -67,7 +67,7 @@ TEST_F(CfgTest, 02_Basic) {
SConfigItem* pItem = NULL;
SConfigIter* pIter = cfgCreateIter(pConfig);
while((pItem == cfgNextIter(pIter)) != NULL) {
while((pItem = cfgNextIter(pIter)) != NULL) {
switch (pItem->dtype) {
case CFG_DTYPE_BOOL:
printf("index:%d, cfg:%s value:%d\n", size, pItem->name, pItem->bval);