fix delete
This commit is contained in:
parent
e2586979eb
commit
367552b914
|
@ -832,7 +832,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) {
|
|||
tDecoderClear(pCoder);
|
||||
|
||||
int32_t sz = taosArrayGetSize(pRes->uidList);
|
||||
if (sz == 0) {
|
||||
if (sz == 0 || pRes->affectedRows == 0) {
|
||||
taosArrayDestroy(pRes->uidList);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -79,20 +79,28 @@ static void toDataCacheEntry(SDataDeleterHandle* pHandle, const SInputData* pInp
|
|||
pEntry->dataLen = sizeof(SDeleterRes);
|
||||
|
||||
ASSERT(1 == pEntry->numOfRows);
|
||||
ASSERT(1 == pEntry->numOfCols);
|
||||
ASSERT(3 == pEntry->numOfCols);
|
||||
|
||||
pBuf->useSize = sizeof(SDataCacheEntry);
|
||||
|
||||
SColumnInfoData* pColRes = (SColumnInfoData*)taosArrayGet(pInput->pData->pDataBlock, 0);
|
||||
SColumnInfoData* pColSKey = (SColumnInfoData*)taosArrayGet(pInput->pData->pDataBlock, 1);
|
||||
SColumnInfoData* pColEKey = (SColumnInfoData*)taosArrayGet(pInput->pData->pDataBlock, 2);
|
||||
|
||||
SDeleterRes* pRes = (SDeleterRes*)pEntry->data;
|
||||
pRes->suid = pHandle->pParam->suid;
|
||||
pRes->uidList = pHandle->pParam->pUidList;
|
||||
pRes->skey = pHandle->pDeleter->deleteTimeRange.skey;
|
||||
pRes->ekey = pHandle->pDeleter->deleteTimeRange.ekey;
|
||||
strcpy(pRes->tableName, pHandle->pDeleter->tableFName);
|
||||
strcpy(pRes->tsColName, pHandle->pDeleter->tsColName);
|
||||
pRes->affectedRows = *(int64_t*)pColRes->pData;
|
||||
if (pRes->affectedRows) {
|
||||
pRes->skey = *(int64_t*)pColSKey->pData;
|
||||
pRes->ekey = *(int64_t*)pColEKey->pData;
|
||||
ASSERT(pRes->skey <= pRes->ekey);
|
||||
} else {
|
||||
pRes->skey = pHandle->pDeleter->deleteTimeRange.skey;
|
||||
pRes->ekey = pHandle->pDeleter->deleteTimeRange.ekey;
|
||||
}
|
||||
|
||||
pBuf->useSize += pEntry->dataLen;
|
||||
|
||||
|
@ -172,7 +180,8 @@ static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryE
|
|||
SDataCacheEntry* pEntry = (SDataCacheEntry*)pDeleter->nextOutput.pData;
|
||||
*pLen = pEntry->dataLen;
|
||||
*pQueryEnd = pDeleter->queryEnd;
|
||||
qDebug("got data len %" PRId64 ", row num %d in sink", *pLen, ((SDataCacheEntry*)(pDeleter->nextOutput.pData))->numOfRows);
|
||||
qDebug("got data len %" PRId64 ", row num %d in sink", *pLen,
|
||||
((SDataCacheEntry*)(pDeleter->nextOutput.pData))->numOfRows);
|
||||
}
|
||||
|
||||
static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
|
||||
|
@ -230,7 +239,8 @@ static int32_t getCacheSize(struct SDataSinkHandle* pHandle, uint64_t* size) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t createDataDeleter(SDataSinkManager* pManager, const SDataSinkNode* pDataSink, DataSinkHandle* pHandle, void *pParam) {
|
||||
int32_t createDataDeleter(SDataSinkManager* pManager, const SDataSinkNode* pDataSink, DataSinkHandle* pHandle,
|
||||
void* pParam) {
|
||||
SDataDeleterHandle* deleter = taosMemoryCalloc(1, sizeof(SDataDeleterHandle));
|
||||
if (NULL == deleter) {
|
||||
terrno = TSDB_CODE_QRY_OUT_OF_MEMORY;
|
||||
|
|
Loading…
Reference in New Issue