feat: add affected rows
This commit is contained in:
parent
313cc0b3fa
commit
770ca9fa6a
|
@ -375,6 +375,8 @@ static int tsdbMemTableInsertTbData(STsdb *pTsdb, SSubmitBlk *pBlock, int32_t *p
|
||||||
if (pMemTable->keyMin > keyMin) pMemTable->keyMin = keyMin;
|
if (pMemTable->keyMin > keyMin) pMemTable->keyMin = keyMin;
|
||||||
if (pMemTable->keyMax < keyMax) pMemTable->keyMax = keyMax;
|
if (pMemTable->keyMax < keyMax) pMemTable->keyMax = keyMax;
|
||||||
|
|
||||||
|
(*pAffectedRows) += pBlock->numOfRows;
|
||||||
|
|
||||||
// STSRow* lastRow = NULL;
|
// STSRow* lastRow = NULL;
|
||||||
// int64_t osize = SL_SIZE(pTableData->pData);
|
// int64_t osize = SL_SIZE(pTableData->pData);
|
||||||
// tsdbSetupSkipListHookFns(pTableData->pData, pRepo, pTable, &points, &lastRow);
|
// tsdbSetupSkipListHookFns(pTableData->pData, pRepo, pTable, &points, &lastRow);
|
||||||
|
|
|
@ -107,8 +107,7 @@ int32_t tsdbSaveSmaToDB(SDBFile *pDBF, void *pKey, int32_t keyLen, void *pVal, i
|
||||||
}
|
}
|
||||||
|
|
||||||
void *tsdbGetSmaDataByKey(SDBFile *pDBF, const void *pKey, int32_t keyLen, int32_t *valLen) {
|
void *tsdbGetSmaDataByKey(SDBFile *pDBF, const void *pKey, int32_t keyLen, int32_t *valLen) {
|
||||||
void *result;
|
void *pVal = NULL;
|
||||||
void *pVal;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = tdbDbGet(pDBF->pDB, pKey, keyLen, &pVal, valLen);
|
ret = tdbDbGet(pDBF->pDB, pKey, keyLen, &pVal, valLen);
|
||||||
|
@ -120,18 +119,10 @@ void *tsdbGetSmaDataByKey(SDBFile *pDBF, const void *pKey, int32_t keyLen, int32
|
||||||
|
|
||||||
ASSERT(*valLen >= 0);
|
ASSERT(*valLen >= 0);
|
||||||
|
|
||||||
result = taosMemoryMalloc(*valLen);
|
|
||||||
|
|
||||||
if (result == NULL) {
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: lock?
|
// TODO: lock?
|
||||||
// TODO: Would the key/value be destoryed during return the data?
|
// TODO: Would the key/value be destoryed during return the data?
|
||||||
// TODO: How about the key is updated while value length is changed? The original value buffer would be freed
|
// TODO: How about the key is updated while value length is changed? The original value buffer would be freed
|
||||||
// automatically?
|
// automatically?
|
||||||
memcpy(result, pVal, *valLen);
|
|
||||||
|
|
||||||
return result;
|
return pVal;
|
||||||
}
|
}
|
|
@ -31,5 +31,5 @@ int tsdbInsertData(STsdb *pTsdb, SSubmitReq *pMsg, SSubmitRsp *pRsp) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tsdbMemTableInsert(pTsdb, pTsdb->mem, pMsg, NULL);
|
return tsdbMemTableInsert(pTsdb, pTsdb->mem, pMsg, pRsp);
|
||||||
}
|
}
|
Loading…
Reference in New Issue