Merge branch '3.0' of github.com:taosdata/TDengine into fix/TD-31288
This commit is contained in:
commit
5c859554d0
|
@ -526,19 +526,17 @@ int32_t createRequest(uint64_t connId, int32_t type, int64_t reqid, SRequestObj
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
*pRequest = (SRequestObj *)taosMemoryCalloc(1, sizeof(SRequestObj));
|
*pRequest = (SRequestObj *)taosMemoryCalloc(1, sizeof(SRequestObj));
|
||||||
if (NULL == *pRequest) {
|
if (NULL == *pRequest) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
STscObj *pTscObj = acquireTscObj(connId);
|
STscObj *pTscObj = acquireTscObj(connId);
|
||||||
if (pTscObj == NULL) {
|
if (pTscObj == NULL) {
|
||||||
code = TSDB_CODE_TSC_DISCONNECTED;
|
TSC_ERR_JRET(terrno);
|
||||||
goto _return;
|
|
||||||
}
|
}
|
||||||
SSyncQueryParam *interParam = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
|
SSyncQueryParam *interParam = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
|
||||||
if (interParam == NULL) {
|
if (interParam == NULL) {
|
||||||
releaseTscObj(connId);
|
releaseTscObj(connId);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
TSC_ERR_JRET(terrno);
|
||||||
goto _return;
|
|
||||||
}
|
}
|
||||||
TSC_ERR_JRET(tsem_init(&interParam->sem, 0, 0));
|
TSC_ERR_JRET(tsem_init(&interParam->sem, 0, 0));
|
||||||
interParam->pRequest = *pRequest;
|
interParam->pRequest = *pRequest;
|
||||||
|
@ -566,7 +564,11 @@ int32_t createRequest(uint64_t connId, int32_t type, int64_t reqid, SRequestObj
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
_return:
|
_return:
|
||||||
|
if ((*pRequest)->pTscObj) {
|
||||||
doDestroyRequest(*pRequest);
|
doDestroyRequest(*pRequest);
|
||||||
|
} else {
|
||||||
|
taosMemoryFree(*pRequest);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -533,7 +533,7 @@ int32_t mndPersistTaskDeployReq(STrans *pTrans, SStreamTask *pTask) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = setTransAction(pTrans, buf, tlen, TDMT_STREAM_TASK_DEPLOY, &pTask->info.epSet, 0, 0);
|
code = setTransAction(pTrans, buf, tlen, TDMT_STREAM_TASK_DEPLOY, &pTask->info.epSet, 0, TSDB_CODE_VND_INVALID_VGROUP_ID);
|
||||||
if (code) {
|
if (code) {
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -320,7 +320,7 @@ static int32_t doSetResumeAction(STrans *pTrans, SMnode *pMnode, SStreamTask *pT
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = setTransAction(pTrans, pReq, sizeof(SVResumeStreamTaskReq), TDMT_STREAM_TASK_RESUME, &epset, 0, 0);
|
code = setTransAction(pTrans, pReq, sizeof(SVResumeStreamTaskReq), TDMT_STREAM_TASK_RESUME, &epset, 0, TSDB_CODE_VND_INVALID_VGROUP_ID);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
taosMemoryFree(pReq);
|
taosMemoryFree(pReq);
|
||||||
return terrno;
|
return terrno;
|
||||||
|
@ -424,7 +424,7 @@ static int32_t doSetPauseAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTa
|
||||||
(void) epsetToStr(&epset, buf, tListLen(buf));
|
(void) epsetToStr(&epset, buf, tListLen(buf));
|
||||||
mDebug("pause stream task in node:%d, epset:%s", pTask->info.nodeId, buf);
|
mDebug("pause stream task in node:%d, epset:%s", pTask->info.nodeId, buf);
|
||||||
|
|
||||||
code = setTransAction(pTrans, pReq, sizeof(SVPauseStreamTaskReq), TDMT_STREAM_TASK_PAUSE, &epset, 0, 0);
|
code = setTransAction(pTrans, pReq, sizeof(SVPauseStreamTaskReq), TDMT_STREAM_TASK_PAUSE, &epset, 0, TSDB_CODE_VND_INVALID_VGROUP_ID);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
taosMemoryFree(pReq);
|
taosMemoryFree(pReq);
|
||||||
return code;
|
return code;
|
||||||
|
@ -484,7 +484,7 @@ static int32_t doSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTas
|
||||||
}
|
}
|
||||||
|
|
||||||
// The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode.
|
// The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode.
|
||||||
code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0, 0);
|
code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0, TSDB_CODE_VND_INVALID_VGROUP_ID);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
taosMemoryFree(pReq);
|
taosMemoryFree(pReq);
|
||||||
return code;
|
return code;
|
||||||
|
@ -540,7 +540,8 @@ static int32_t doSetDropActionFromId(SMnode *pMnode, STrans *pTrans, SOrphanTask
|
||||||
}
|
}
|
||||||
|
|
||||||
// The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode.
|
// The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode.
|
||||||
code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0, 0);
|
code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0,
|
||||||
|
TSDB_CODE_VND_INVALID_VGROUP_ID);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
taosMemoryFree(pReq);
|
taosMemoryFree(pReq);
|
||||||
return code;
|
return code;
|
||||||
|
@ -713,7 +714,7 @@ static int32_t doSetResetAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTa
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = setTransAction(pTrans, pReq, sizeof(SVResetStreamTaskReq), TDMT_VND_STREAM_TASK_RESET, &epset, 0, 0);
|
code = setTransAction(pTrans, pReq, sizeof(SVResetStreamTaskReq), TDMT_VND_STREAM_TASK_RESET, &epset, 0, TSDB_CODE_VND_INVALID_VGROUP_ID);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
taosMemoryFree(pReq);
|
taosMemoryFree(pReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1677,7 +1677,7 @@ int32_t mndAcquireUser(SMnode *pMnode, const char *userName, SUserObj **ppUser)
|
||||||
|
|
||||||
*ppUser = sdbAcquire(pSdb, SDB_USER, userName);
|
*ppUser = sdbAcquire(pSdb, SDB_USER, userName);
|
||||||
if (*ppUser == NULL) {
|
if (*ppUser == NULL) {
|
||||||
if (code == TSDB_CODE_SDB_OBJ_NOT_THERE) {
|
if (terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) {
|
||||||
code = TSDB_CODE_MND_USER_NOT_EXIST;
|
code = TSDB_CODE_MND_USER_NOT_EXIST;
|
||||||
} else {
|
} else {
|
||||||
code = TSDB_CODE_MND_USER_NOT_AVAILABLE;
|
code = TSDB_CODE_MND_USER_NOT_AVAILABLE;
|
||||||
|
@ -3149,7 +3149,8 @@ int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_
|
||||||
(void)memcpy(rsp.user, pUsers[i].user, TSDB_USER_LEN);
|
(void)memcpy(rsp.user, pUsers[i].user, TSDB_USER_LEN);
|
||||||
(void)taosArrayPush(batchRsp.pArray, &rsp);
|
(void)taosArrayPush(batchRsp.pArray, &rsp);
|
||||||
}
|
}
|
||||||
mError("user:%s, failed to auth user since %s", pUsers[i].user, terrstr());
|
mError("user:%s, failed to auth user since %s", pUsers[i].user, tstrerror(code));
|
||||||
|
code = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ int32_t tCreateSttBlockLoadInfo(STSchema *pSchema, int16_t *colList, int32_t num
|
||||||
|
|
||||||
SSttBlockLoadInfo *pLoadInfo = taosMemoryCalloc(1, sizeof(SSttBlockLoadInfo));
|
SSttBlockLoadInfo *pLoadInfo = taosMemoryCalloc(1, sizeof(SSttBlockLoadInfo));
|
||||||
if (pLoadInfo == NULL) {
|
if (pLoadInfo == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
pLoadInfo->blockData[0].sttBlockIndex = -1;
|
pLoadInfo->blockData[0].sttBlockIndex = -1;
|
||||||
|
@ -50,9 +50,8 @@ int32_t tCreateSttBlockLoadInfo(STSchema *pSchema, int16_t *colList, int32_t num
|
||||||
|
|
||||||
pLoadInfo->aSttBlk = taosArrayInit(4, sizeof(SSttBlk));
|
pLoadInfo->aSttBlk = taosArrayInit(4, sizeof(SSttBlk));
|
||||||
if (pLoadInfo->aSttBlk == NULL) {
|
if (pLoadInfo->aSttBlk == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
taosMemoryFreeClear(pLoadInfo);
|
taosMemoryFreeClear(pLoadInfo);
|
||||||
return code;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
pLoadInfo->pSchema = pSchema;
|
pLoadInfo->pSchema = pSchema;
|
||||||
|
@ -358,7 +357,7 @@ static int32_t tValueDupPayload(SValue *pVal) {
|
||||||
char *p = (char *)pVal->pData;
|
char *p = (char *)pVal->pData;
|
||||||
char *pBuf = taosMemoryMalloc(pVal->nData);
|
char *pBuf = taosMemoryMalloc(pVal->nData);
|
||||||
if (pBuf == NULL) {
|
if (pBuf == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(pBuf, p, pVal->nData);
|
memcpy(pBuf, p, pVal->nData);
|
||||||
|
@ -371,13 +370,15 @@ static int32_t tValueDupPayload(SValue *pVal) {
|
||||||
static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBlockLoadInfo *pBlockLoadInfo,
|
static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBlockLoadInfo *pBlockLoadInfo,
|
||||||
TStatisBlkArray *pStatisBlkArray, uint64_t suid, const char *id) {
|
TStatisBlkArray *pStatisBlkArray, uint64_t suid, const char *id) {
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
int32_t lino = 0;
|
||||||
void* px = NULL;
|
void* px = NULL;
|
||||||
|
int32_t startIndex = 0;
|
||||||
|
|
||||||
int32_t numOfBlocks = TARRAY2_SIZE(pStatisBlkArray);
|
int32_t numOfBlocks = TARRAY2_SIZE(pStatisBlkArray);
|
||||||
if (numOfBlocks <= 0) {
|
if (numOfBlocks <= 0) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t startIndex = 0;
|
|
||||||
while ((startIndex < numOfBlocks) && (pStatisBlkArray->data[startIndex].maxTbid.suid < suid)) {
|
while ((startIndex < numOfBlocks) && (pStatisBlkArray->data[startIndex].maxTbid.suid < suid)) {
|
||||||
++startIndex;
|
++startIndex;
|
||||||
}
|
}
|
||||||
|
@ -413,150 +414,113 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl
|
||||||
|
|
||||||
// existed
|
// existed
|
||||||
if (i < rows) {
|
if (i < rows) {
|
||||||
if (pBlockLoadInfo->info.pUid == NULL) {
|
SSttTableRowsInfo* pInfo = &pBlockLoadInfo->info;
|
||||||
pBlockLoadInfo->info.pUid = taosArrayInit(rows, sizeof(int64_t));
|
|
||||||
pBlockLoadInfo->info.pFirstTs = taosArrayInit(rows, sizeof(int64_t));
|
|
||||||
pBlockLoadInfo->info.pLastTs = taosArrayInit(rows, sizeof(int64_t));
|
|
||||||
pBlockLoadInfo->info.pCount = taosArrayInit(rows, sizeof(int64_t));
|
|
||||||
|
|
||||||
pBlockLoadInfo->info.pFirstKey = taosArrayInit(rows, sizeof(SValue));
|
if (pInfo->pUid == NULL) {
|
||||||
pBlockLoadInfo->info.pLastKey = taosArrayInit(rows, sizeof(SValue));
|
pInfo->pUid = taosArrayInit(rows, sizeof(int64_t));
|
||||||
|
pInfo->pFirstTs = taosArrayInit(rows, sizeof(int64_t));
|
||||||
|
pInfo->pLastTs = taosArrayInit(rows, sizeof(int64_t));
|
||||||
|
pInfo->pCount = taosArrayInit(rows, sizeof(int64_t));
|
||||||
|
|
||||||
|
pInfo->pFirstKey = taosArrayInit(rows, sizeof(SValue));
|
||||||
|
pInfo->pLastKey = taosArrayInit(rows, sizeof(SValue));
|
||||||
|
|
||||||
|
if (pInfo->pUid == NULL || pInfo->pFirstTs == NULL || pInfo->pLastTs == NULL || pInfo->pCount == NULL ||
|
||||||
|
pInfo->pFirstKey == NULL || pInfo->pLastKey == NULL) {
|
||||||
|
code = terrno;
|
||||||
|
goto _end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pStatisBlkArray->data[k].maxTbid.suid == suid) {
|
if (pStatisBlkArray->data[k].maxTbid.suid == suid) {
|
||||||
int32_t size = rows - i;
|
int32_t size = rows - i;
|
||||||
int32_t offset = i * sizeof(int64_t);
|
int32_t offset = i * sizeof(int64_t);
|
||||||
|
|
||||||
px = taosArrayAddBatch(pBlockLoadInfo->info.pUid, tBufferGetDataAt(&block.uids, offset), size);
|
px = taosArrayAddBatch(pInfo->pUid, tBufferGetDataAt(&block.uids, offset), size);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayAddBatch(pBlockLoadInfo->info.pFirstTs, tBufferGetDataAt(&block.firstKeyTimestamps, offset), size);
|
px = taosArrayAddBatch(pInfo->pFirstTs, tBufferGetDataAt(&block.firstKeyTimestamps, offset), size);
|
||||||
if (px == NULL){
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayAddBatch(pBlockLoadInfo->info.pLastTs, tBufferGetDataAt(&block.lastKeyTimestamps, offset), size);
|
px = taosArrayAddBatch(pInfo->pLastTs, tBufferGetDataAt(&block.lastKeyTimestamps, offset), size);
|
||||||
if (px == NULL){
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayAddBatch(pBlockLoadInfo->info.pCount, tBufferGetDataAt(&block.counts, offset), size);
|
px = taosArrayAddBatch(pInfo->pCount, tBufferGetDataAt(&block.counts, offset), size);
|
||||||
if (px == NULL){
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (block.numOfPKs > 0) {
|
if (block.numOfPKs > 0) {
|
||||||
SValue vFirst = {0}, vLast = {0};
|
SValue vFirst = {0}, vLast = {0};
|
||||||
for (int32_t f = i; f < rows; ++f) {
|
for (int32_t f = i; f < rows; ++f) {
|
||||||
code = tValueColumnGet(&block.firstKeyPKs[0], f, &vFirst);
|
code = tValueColumnGet(&block.firstKeyPKs[0], f, &vFirst);
|
||||||
if (code) {
|
TSDB_CHECK_CODE(code, lino, _end);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
code = tValueDupPayload(&vFirst);
|
code = tValueDupPayload(&vFirst);
|
||||||
if (code) {
|
TSDB_CHECK_CODE(code, lino, _end);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pFirstKey, &vFirst);
|
px = taosArrayPush(pInfo->pFirstKey, &vFirst);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo add api to clone the original data
|
// todo add api to clone the original data
|
||||||
code = tValueColumnGet(&block.lastKeyPKs[0], f, &vLast);
|
code = tValueColumnGet(&block.lastKeyPKs[0], f, &vLast);
|
||||||
if (code) {
|
TSDB_CHECK_CODE(code, lino, _end);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
code = tValueDupPayload(&vLast);
|
code = tValueDupPayload(&vLast);
|
||||||
if (code) {
|
TSDB_CHECK_CODE(code, lino, _end);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pLastKey, &vLast);
|
px = taosArrayPush(pInfo->pLastKey, &vLast);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SValue vFirst = {0};
|
SValue vFirst = {0};
|
||||||
for (int32_t j = 0; j < size; ++j) {
|
for (int32_t j = 0; j < size; ++j) {
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pFirstKey, &vFirst);
|
px = taosArrayPush(pInfo->pFirstKey, &vFirst);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pLastKey, &vFirst);
|
px = taosArrayPush(pInfo->pLastKey, &vFirst);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
STbStatisRecord record = {0};
|
STbStatisRecord record = {0};
|
||||||
|
|
||||||
while (i < rows) {
|
while (i < rows) {
|
||||||
(void)tStatisBlockGet(&block, i, &record);
|
(void)tStatisBlockGet(&block, i, &record);
|
||||||
if (record.suid != suid) {
|
if (record.suid != suid) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pUid, &record.uid);
|
px = taosArrayPush(pInfo->pUid, &record.uid);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pCount, &record.count);
|
px = taosArrayPush(pInfo->pCount, &record.count);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pFirstTs, &record.firstKey.ts);
|
px = taosArrayPush(pInfo->pFirstTs, &record.firstKey.ts);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pLastTs, &record.lastKey.ts);
|
px = taosArrayPush(pInfo->pLastTs, &record.lastKey.ts);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (record.firstKey.numOfPKs > 0) {
|
if (record.firstKey.numOfPKs > 0) {
|
||||||
SValue s = record.firstKey.pks[0];
|
SValue s = record.firstKey.pks[0];
|
||||||
code = tValueDupPayload(&s);
|
code = tValueDupPayload(&s);
|
||||||
if (code) {
|
TSDB_CHECK_CODE(code, lino, _end);
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pFirstKey, &s);
|
px = taosArrayPush(pInfo->pFirstKey, &s);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
s = record.lastKey.pks[0];
|
s = record.lastKey.pks[0];
|
||||||
code = tValueDupPayload(&s);
|
code = tValueDupPayload(&s);
|
||||||
if (code) {
|
TSDB_CHECK_CODE(code, lino, _end);
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pLastKey, &s);
|
px = taosArrayPush(pInfo->pLastKey, &s);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
SValue v = {0};
|
SValue v = {0};
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pFirstKey, &v);
|
px = taosArrayPush(pInfo->pFirstKey, &v);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
|
|
||||||
px = taosArrayPush(pBlockLoadInfo->info.pLastKey, &v);
|
px = taosArrayPush(pInfo->pLastKey, &v);
|
||||||
if (px == NULL) {
|
TSDB_CHECK_NULL(px, code, lino, _end, terrno);
|
||||||
return terrno;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i += 1;
|
i += 1;
|
||||||
|
@ -565,6 +529,7 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_end:
|
||||||
(void)tStatisBlockDestroy(&block);
|
(void)tStatisBlockDestroy(&block);
|
||||||
|
|
||||||
double el = (taosGetTimestampUs() - st) / 1000.0;
|
double el = (taosGetTimestampUs() - st) / 1000.0;
|
||||||
|
|
|
@ -147,7 +147,10 @@ _error:
|
||||||
if (pInfo != NULL) {
|
if (pInfo != NULL) {
|
||||||
destroyAggOperatorInfo(pInfo);
|
destroyAggOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,10 @@ _error:
|
||||||
}
|
}
|
||||||
pInfo->pTableList = NULL;
|
pInfo->pTableList = NULL;
|
||||||
destroyCacheScanOperator(pInfo);
|
destroyCacheScanOperator(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,7 +451,7 @@ void destroyCacheScanOperator(void* param) {
|
||||||
taosArrayDestroy(pInfo->matchInfo.pList);
|
taosArrayDestroy(pInfo->matchInfo.pList);
|
||||||
tableListDestroy(pInfo->pTableList);
|
tableListDestroy(pInfo->pTableList);
|
||||||
|
|
||||||
if (pInfo->pLastrowReader != NULL) {
|
if (pInfo->pLastrowReader != NULL && pInfo->readHandle.api.cacheFn.closeReader != NULL) {
|
||||||
pInfo->readHandle.api.cacheFn.closeReader(pInfo->pLastrowReader);
|
pInfo->readHandle.api.cacheFn.closeReader(pInfo->pLastrowReader);
|
||||||
pInfo->pLastrowReader = NULL;
|
pInfo->pLastrowReader = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -342,7 +342,10 @@ _error:
|
||||||
destroyCountWindowOperatorInfo(pInfo);
|
destroyCountWindowOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,10 @@ _error:
|
||||||
destroyEWindowOperatorInfo(pInfo);
|
destroyEWindowOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,7 +452,10 @@ _error:
|
||||||
doDestroyExchangeOperatorInfo(pInfo);
|
doDestroyExchangeOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -757,6 +760,7 @@ int32_t extractDataBlockFromFetchRsp(SSDataBlock* pRes, char* pData, SArray* pCo
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
|
|
||||||
blockDataDestroy(pBlock);
|
blockDataDestroy(pBlock);
|
||||||
|
pBlock = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_end:
|
_end:
|
||||||
|
|
|
@ -567,7 +567,10 @@ _error:
|
||||||
}
|
}
|
||||||
|
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1504,7 +1504,10 @@ _error:
|
||||||
destroyGroupCacheOperator(pInfo);
|
destroyGroupCacheOperator(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1246,7 +1246,10 @@ _error:
|
||||||
destroyPartitionOperatorInfo(pInfo);
|
destroyPartitionOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1792,7 +1795,10 @@ int32_t createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStreamPart
|
||||||
_error:
|
_error:
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
if (pInfo != NULL) destroyStreamPartitionOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyStreamPartitionOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -650,7 +650,7 @@ void destroyOperator(SOperatorInfo* pOperator) {
|
||||||
freeResetOperatorParams(pOperator, OP_GET_PARAM, true);
|
freeResetOperatorParams(pOperator, OP_GET_PARAM, true);
|
||||||
freeResetOperatorParams(pOperator, OP_NOTIFY_PARAM, true);
|
freeResetOperatorParams(pOperator, OP_NOTIFY_PARAM, true);
|
||||||
|
|
||||||
if (pOperator->fpSet.closeFn != NULL) {
|
if (pOperator->fpSet.closeFn != NULL && pOperator->info != NULL) {
|
||||||
pOperator->fpSet.closeFn(pOperator->info);
|
pOperator->fpSet.closeFn(pOperator->info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,10 @@ int32_t createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhysiNode*
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
destroyProjectOperatorInfo(pInfo);
|
destroyProjectOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -529,7 +532,10 @@ int32_t createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhysiNode*
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
destroyIndefinitOperatorInfo(pInfo);
|
destroyIndefinitOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1466,7 +1466,10 @@ _error:
|
||||||
destroyTableScanOperatorInfo(pInfo);
|
destroyTableScanOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -3777,7 +3780,7 @@ static void destroyStreamScanOperatorInfo(void* param) {
|
||||||
destroyOperator(pStreamScan->pTableScanOp);
|
destroyOperator(pStreamScan->pTableScanOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pStreamScan->tqReader) {
|
if (pStreamScan->tqReader != NULL && pStreamScan->readerFn.tqReaderClose != NULL) {
|
||||||
pStreamScan->readerFn.tqReaderClose(pStreamScan->tqReader);
|
pStreamScan->readerFn.tqReaderClose(pStreamScan->tqReader);
|
||||||
}
|
}
|
||||||
if (pStreamScan->matchInfo.pList) {
|
if (pStreamScan->matchInfo.pList) {
|
||||||
|
@ -4147,7 +4150,10 @@ _error:
|
||||||
destroyStreamScanOperatorInfo(pInfo);
|
destroyStreamScanOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -4608,7 +4614,7 @@ static SSDataBlock* doTagScanFromMetaEntry(SOperatorInfo* pOperator) {
|
||||||
|
|
||||||
static void destroyTagScanOperatorInfo(void* param) {
|
static void destroyTagScanOperatorInfo(void* param) {
|
||||||
STagScanInfo* pInfo = (STagScanInfo*)param;
|
STagScanInfo* pInfo = (STagScanInfo*)param;
|
||||||
if (pInfo->pCtbCursor != NULL) {
|
if (pInfo->pCtbCursor != NULL && pInfo->pStorageAPI != NULL) {
|
||||||
pInfo->pStorageAPI->metaFn.closeCtbCursor(pInfo->pCtbCursor);
|
pInfo->pStorageAPI->metaFn.closeCtbCursor(pInfo->pCtbCursor);
|
||||||
}
|
}
|
||||||
taosHashCleanup(pInfo->filterCtx.colHash);
|
taosHashCleanup(pInfo->filterCtx.colHash);
|
||||||
|
@ -4705,7 +4711,10 @@ _error:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInfo != NULL) destroyTagScanOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyTagScanOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5770,8 +5779,10 @@ void destroyTableMergeScanOperatorInfo(void* param) {
|
||||||
STableMergeScanInfo* pTableScanInfo = (STableMergeScanInfo*)param;
|
STableMergeScanInfo* pTableScanInfo = (STableMergeScanInfo*)param;
|
||||||
|
|
||||||
// start one reader variable
|
// start one reader variable
|
||||||
|
if (pTableScanInfo->base.readerAPI.tsdReaderClose != NULL) {
|
||||||
pTableScanInfo->base.readerAPI.tsdReaderClose(pTableScanInfo->base.dataReader);
|
pTableScanInfo->base.readerAPI.tsdReaderClose(pTableScanInfo->base.dataReader);
|
||||||
pTableScanInfo->base.dataReader = NULL;
|
pTableScanInfo->base.dataReader = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < pTableScanInfo->numNextDurationBlocks; ++i) {
|
for (int32_t i = 0; i < pTableScanInfo->numNextDurationBlocks; ++i) {
|
||||||
if (pTableScanInfo->nextDurationBlocks[i] != NULL) {
|
if (pTableScanInfo->nextDurationBlocks[i] != NULL) {
|
||||||
|
@ -5950,7 +5961,10 @@ _error:
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
pInfo->base.pTableListInfo = NULL;
|
pInfo->base.pTableListInfo = NULL;
|
||||||
if (pInfo != NULL) destroyTableMergeScanOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyTableMergeScanOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6107,7 +6121,10 @@ _error:
|
||||||
if (pInfo != NULL) {
|
if (pInfo != NULL) {
|
||||||
destoryTableCountScanOperator(pInfo);
|
destoryTableCountScanOperator(pInfo);
|
||||||
}
|
}
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,10 @@ _error:
|
||||||
destroySortOperatorInfo(pInfo);
|
destroySortOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -836,6 +839,9 @@ _error:
|
||||||
if (pInfo != NULL) {
|
if (pInfo != NULL) {
|
||||||
destroyGroupSortOperatorInfo(pInfo);
|
destroyGroupSortOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -926,7 +926,10 @@ _error:
|
||||||
destroyStreamCountAggOperatorInfo(pInfo);
|
destroyStreamCountAggOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -981,7 +981,10 @@ int32_t createStreamEventAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode*
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
if (pInfo != NULL) destroyStreamEventOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyStreamEventOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -1459,7 +1459,10 @@ _error:
|
||||||
qError("%s failed at line %d since %s. task:%s", __func__, lino, tstrerror(code), GET_TASKID(pTaskInfo));
|
qError("%s failed at line %d since %s. task:%s", __func__, lino, tstrerror(code), GET_TASKID(pTaskInfo));
|
||||||
}
|
}
|
||||||
if (pInfo != NULL) destroyStreamFillOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyStreamFillOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2013,7 +2013,10 @@ int32_t createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, SPhysiN
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
if (pInfo != NULL) destroyStreamFinalIntervalOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyStreamFinalIntervalOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -3832,7 +3835,10 @@ _error:
|
||||||
destroyStreamSessionAggOperatorInfo(pInfo);
|
destroyStreamSessionAggOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
|
@ -4088,7 +4094,10 @@ _error:
|
||||||
if (pInfo != NULL) {
|
if (pInfo != NULL) {
|
||||||
destroyStreamSessionAggOperatorInfo(pInfo);
|
destroyStreamSessionAggOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s. task:%s", __func__, lino, tstrerror(code), GET_TASKID(pTaskInfo));
|
qError("%s failed at line %d since %s. task:%s", __func__, lino, tstrerror(code), GET_TASKID(pTaskInfo));
|
||||||
|
@ -4978,7 +4987,10 @@ int32_t createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhysiNode*
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
if (pInfo != NULL) destroyStreamStateOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyStreamStateOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
|
@ -5314,7 +5326,10 @@ int32_t createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhysiNode*
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
if (pInfo != NULL) destroyStreamFinalIntervalOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyStreamFinalIntervalOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -672,6 +672,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
blockDataDestroy(pDataBlock);
|
blockDataDestroy(pDataBlock);
|
||||||
|
pDataBlock = NULL;
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
||||||
pInfo->pCur = NULL;
|
pInfo->pCur = NULL;
|
||||||
|
@ -683,6 +684,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
|
||||||
|
|
||||||
_end:
|
_end:
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
blockDataDestroy(pDataBlock);
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
T_LONG_JMP(pTaskInfo->env, code);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
|
@ -695,6 +697,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
||||||
SStorageAPI* pAPI = &pTaskInfo->storageAPI;
|
SStorageAPI* pAPI = &pTaskInfo->storageAPI;
|
||||||
|
SSDataBlock* dataBlock = NULL;
|
||||||
|
|
||||||
SSysTableScanInfo* pInfo = pOperator->info;
|
SSysTableScanInfo* pInfo = pOperator->info;
|
||||||
if (pOperator->status == OP_EXEC_DONE) {
|
if (pOperator->status == OP_EXEC_DONE) {
|
||||||
|
@ -704,7 +707,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
|
||||||
blockDataCleanup(pInfo->pRes);
|
blockDataCleanup(pInfo->pRes);
|
||||||
int32_t numOfRows = 0;
|
int32_t numOfRows = 0;
|
||||||
|
|
||||||
SSDataBlock* dataBlock = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TAGS);
|
dataBlock = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TAGS);
|
||||||
code = blockDataEnsureCapacity(dataBlock, pOperator->resultInfo.capacity);
|
code = blockDataEnsureCapacity(dataBlock, pOperator->resultInfo.capacity);
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
|
|
||||||
|
@ -826,6 +829,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
blockDataDestroy(dataBlock);
|
blockDataDestroy(dataBlock);
|
||||||
|
dataBlock = NULL;
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
||||||
pInfo->pCur = NULL;
|
pInfo->pCur = NULL;
|
||||||
|
@ -837,6 +841,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
|
||||||
_end:
|
_end:
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
|
blockDataDestroy(dataBlock);
|
||||||
pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
||||||
pInfo->pCur = NULL;
|
pInfo->pCur = NULL;
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
|
@ -1310,9 +1315,11 @@ int32_t buildSysDbTableInfo(const SSysTableScanInfo* pInfo, int32_t capacity) {
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
|
|
||||||
blockDataDestroy(p);
|
blockDataDestroy(p);
|
||||||
|
p = NULL;
|
||||||
|
|
||||||
_end:
|
_end:
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
blockDataDestroy(p);
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
|
@ -1325,6 +1332,7 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) {
|
||||||
SStorageAPI* pAPI = &pTaskInfo->storageAPI;
|
SStorageAPI* pAPI = &pTaskInfo->storageAPI;
|
||||||
SSysTableScanInfo* pInfo = pOperator->info;
|
SSysTableScanInfo* pInfo = pOperator->info;
|
||||||
SSysTableIndex* pIdx = pInfo->pIdx;
|
SSysTableIndex* pIdx = pInfo->pIdx;
|
||||||
|
SSDataBlock* p = NULL;
|
||||||
blockDataCleanup(pInfo->pRes);
|
blockDataCleanup(pInfo->pRes);
|
||||||
int32_t numOfRows = 0;
|
int32_t numOfRows = 0;
|
||||||
|
|
||||||
|
@ -1344,7 +1352,7 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) {
|
||||||
|
|
||||||
varDataSetLen(dbname, strlen(varDataVal(dbname)));
|
varDataSetLen(dbname, strlen(varDataVal(dbname)));
|
||||||
|
|
||||||
SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TABLES);
|
p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TABLES);
|
||||||
code = blockDataEnsureCapacity(p, pOperator->resultInfo.capacity);
|
code = blockDataEnsureCapacity(p, pOperator->resultInfo.capacity);
|
||||||
QUERY_CHECK_CODE(code, lino, _end);
|
QUERY_CHECK_CODE(code, lino, _end);
|
||||||
|
|
||||||
|
@ -1545,12 +1553,14 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
blockDataDestroy(p);
|
blockDataDestroy(p);
|
||||||
|
p = NULL;
|
||||||
|
|
||||||
pInfo->loadInfo.totalRows += pInfo->pRes->info.rows;
|
pInfo->loadInfo.totalRows += pInfo->pRes->info.rows;
|
||||||
|
|
||||||
_end:
|
_end:
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
|
blockDataDestroy(p);
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
T_LONG_JMP(pTaskInfo->env, code);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
}
|
}
|
||||||
|
@ -1563,6 +1573,7 @@ static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) {
|
||||||
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
||||||
SStorageAPI* pAPI = &pTaskInfo->storageAPI;
|
SStorageAPI* pAPI = &pTaskInfo->storageAPI;
|
||||||
int8_t firstMetaCursor = 0;
|
int8_t firstMetaCursor = 0;
|
||||||
|
SSDataBlock* p = NULL;
|
||||||
|
|
||||||
SSysTableScanInfo* pInfo = pOperator->info;
|
SSysTableScanInfo* pInfo = pOperator->info;
|
||||||
if (pInfo->pCur == NULL) {
|
if (pInfo->pCur == NULL) {
|
||||||
|
@ -1590,7 +1601,7 @@ static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) {
|
||||||
|
|
||||||
varDataSetLen(dbname, strlen(varDataVal(dbname)));
|
varDataSetLen(dbname, strlen(varDataVal(dbname)));
|
||||||
|
|
||||||
SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TABLES);
|
p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TABLES);
|
||||||
QUERY_CHECK_NULL(p, code, lino, _end, terrno);
|
QUERY_CHECK_NULL(p, code, lino, _end, terrno);
|
||||||
|
|
||||||
code = blockDataEnsureCapacity(p, pOperator->resultInfo.capacity);
|
code = blockDataEnsureCapacity(p, pOperator->resultInfo.capacity);
|
||||||
|
@ -1783,6 +1794,7 @@ static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
blockDataDestroy(p);
|
blockDataDestroy(p);
|
||||||
|
p = NULL;
|
||||||
|
|
||||||
// todo temporarily free the cursor here, the true reason why the free is not valid needs to be found
|
// todo temporarily free the cursor here, the true reason why the free is not valid needs to be found
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -1796,6 +1808,7 @@ static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) {
|
||||||
_end:
|
_end:
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
|
blockDataDestroy(p);
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
T_LONG_JMP(pTaskInfo->env, code);
|
T_LONG_JMP(pTaskInfo->env, code);
|
||||||
}
|
}
|
||||||
|
@ -2209,7 +2222,10 @@ _error:
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
}
|
}
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -2244,7 +2260,7 @@ void destroySysScanOperator(void* param) {
|
||||||
if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0 ||
|
if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0 ||
|
||||||
strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0 ||
|
strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0 ||
|
||||||
strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0 || pInfo->pCur != NULL) {
|
strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0 || pInfo->pCur != NULL) {
|
||||||
if (pInfo->pAPI->metaFn.closeTableMetaCursor != NULL) {
|
if (pInfo->pAPI != NULL && pInfo->pAPI->metaFn.closeTableMetaCursor != NULL) {
|
||||||
pInfo->pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
pInfo->pAPI->metaFn.closeTableMetaCursor(pInfo->pCur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2726,7 +2742,9 @@ static SSDataBlock* doBlockInfoScan(SOperatorInfo* pOperator) {
|
||||||
static void destroyBlockDistScanOperatorInfo(void* param) {
|
static void destroyBlockDistScanOperatorInfo(void* param) {
|
||||||
SBlockDistInfo* pDistInfo = (SBlockDistInfo*)param;
|
SBlockDistInfo* pDistInfo = (SBlockDistInfo*)param;
|
||||||
blockDataDestroy(pDistInfo->pResBlock);
|
blockDataDestroy(pDistInfo->pResBlock);
|
||||||
|
if (pDistInfo->readHandle.api.tsdReader.tsdReaderClose != NULL) {
|
||||||
pDistInfo->readHandle.api.tsdReader.tsdReaderClose(pDistInfo->pHandle);
|
pDistInfo->readHandle.api.tsdReader.tsdReaderClose(pDistInfo->pHandle);
|
||||||
|
}
|
||||||
tableListDestroy(pDistInfo->pTableListInfo);
|
tableListDestroy(pDistInfo->pTableListInfo);
|
||||||
taosMemoryFreeClear(param);
|
taosMemoryFreeClear(param);
|
||||||
}
|
}
|
||||||
|
@ -2815,6 +2833,9 @@ _error:
|
||||||
pInfo->pTableListInfo = NULL;
|
pInfo->pTableListInfo = NULL;
|
||||||
destroyBlockDistScanOperatorInfo(pInfo);
|
destroyBlockDistScanOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1208,7 +1208,10 @@ _error:
|
||||||
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
|
||||||
}
|
}
|
||||||
if (pInfo != NULL) destroyTimeSliceOperatorInfo(pInfo);
|
if (pInfo != NULL) destroyTimeSliceOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1414,7 +1414,10 @@ _error:
|
||||||
if (pInfo != NULL) {
|
if (pInfo != NULL) {
|
||||||
destroyIntervalOperatorInfo(pInfo);
|
destroyIntervalOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -1690,7 +1693,10 @@ _error:
|
||||||
destroyStateWindowOperatorInfo(pInfo);
|
destroyStateWindowOperatorInfo(pInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -1783,7 +1789,10 @@ int32_t createSessionAggOperatorInfo(SOperatorInfo* downstream, SSessionWinodwPh
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
if (pInfo != NULL) destroySWindowOperatorInfo(pInfo);
|
if (pInfo != NULL) destroySWindowOperatorInfo(pInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -2094,8 +2103,11 @@ int32_t createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, SMerge
|
||||||
return code;
|
return code;
|
||||||
|
|
||||||
_error:
|
_error:
|
||||||
destroyMAIOperatorInfo(miaInfo);
|
if (miaInfo != NULL) destroyMAIOperatorInfo(miaInfo);
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -2427,7 +2439,10 @@ _error:
|
||||||
destroyMergeIntervalOperatorInfo(pMergeIntervalInfo);
|
destroyMergeIntervalOperatorInfo(pMergeIntervalInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pOperator != NULL) {
|
||||||
|
pOperator->info = NULL;
|
||||||
destroyOperator(pOperator);
|
destroyOperator(pOperator);
|
||||||
|
}
|
||||||
pTaskInfo->code = code;
|
pTaskInfo->code = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ int32_t taosThreadCondTimedWait(TdThreadCond *cond, TdThreadMutex *mutex, const
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
#else
|
#else
|
||||||
int32_t code = pthread_cond_timedwait(cond, mutex, abstime);
|
int32_t code = pthread_cond_timedwait(cond, mutex, abstime);
|
||||||
if (code) {
|
if (code && code != ETIMEDOUT) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(code);
|
terrno = TAOS_SYSTEM_ERROR(code);
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,10 @@ class TDTestCase:
|
||||||
tdSql.checkData(2, 4, 9)
|
tdSql.checkData(2, 4, 9)
|
||||||
tdSql.checkData(3, 4, 9)
|
tdSql.checkData(3, 4, 9)
|
||||||
|
|
||||||
|
sql = "SELECT _wstart, last(c1) FROM t6 INTERVAL(1w);"
|
||||||
|
tdSql.query(sql)
|
||||||
|
tdSql.checkRows(11)
|
||||||
|
|
||||||
def test_partition_by_limit_no_agg(self):
|
def test_partition_by_limit_no_agg(self):
|
||||||
sql_template = 'select t1 from meters partition by t1 limit %d'
|
sql_template = 'select t1 from meters partition by t1 limit %d'
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -52,7 +52,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
@ -121,7 +121,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -121,7 +121,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -52,7 +52,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
@ -121,7 +121,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -56,7 +56,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -56,7 +56,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
@ -123,7 +123,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 1000,
|
'rowsPerTbl': 1000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 60,
|
'pollDelay': 120,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
|
|
@ -140,7 +140,7 @@ class TDTestCase:
|
||||||
'rowsPerTbl': 10000,
|
'rowsPerTbl': 10000,
|
||||||
'batchNum': 10,
|
'batchNum': 10,
|
||||||
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
'startTs': 1640966400000, # 2022-01-01 00:00:00.000
|
||||||
'pollDelay': 2,
|
'pollDelay': 5,
|
||||||
'showMsg': 1,
|
'showMsg': 1,
|
||||||
'showRow': 1,
|
'showRow': 1,
|
||||||
'snapshot': 0}
|
'snapshot': 0}
|
||||||
|
@ -190,9 +190,6 @@ class TDTestCase:
|
||||||
# redistribute vgroup
|
# redistribute vgroup
|
||||||
self.redistributeVgroups()
|
self.redistributeVgroups()
|
||||||
|
|
||||||
tdLog.info("start consume processor")
|
|
||||||
tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot'])
|
|
||||||
tdLog.info("wait the consume result")
|
|
||||||
expectRows = 1
|
expectRows = 1
|
||||||
resultList = tmqCom.selectConsumeResult(expectRows)
|
resultList = tmqCom.selectConsumeResult(expectRows)
|
||||||
|
|
||||||
|
|
|
@ -633,7 +633,7 @@ void basic_consume_loop(tmq_t* tmq, tmq_list_t* topics) {
|
||||||
}
|
}
|
||||||
int32_t cnt = 0;
|
int32_t cnt = 0;
|
||||||
while (running) {
|
while (running) {
|
||||||
TAOS_RES* tmqmessage = tmq_consumer_poll(tmq, 1000);
|
TAOS_RES* tmqmessage = tmq_consumer_poll(tmq, 5000);
|
||||||
if (tmqmessage) {
|
if (tmqmessage) {
|
||||||
cnt++;
|
cnt++;
|
||||||
msg_process(tmqmessage);
|
msg_process(tmqmessage);
|
||||||
|
|
Loading…
Reference in New Issue