fix: crash
This commit is contained in:
parent
46a58a0eb8
commit
46355de7f9
|
@ -2402,10 +2402,18 @@ void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock) {
|
|||
} else {
|
||||
buf = taosDecodeBinary(buf, (void**)&data.nullbitmap, BitmapLen(pBlock->info.rows));
|
||||
}
|
||||
if(buf == NULL) {
|
||||
uError("failed to decode null bitmap/offset, type:%d", data.info.type);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t len = 0;
|
||||
buf = taosDecodeFixedI32(buf, &len);
|
||||
buf = taosDecodeBinary(buf, (void**)&data.pData, len);
|
||||
if (buf == NULL) {
|
||||
uError("failed to decode data, type:%d", data.info.type);
|
||||
return NULL;
|
||||
}
|
||||
if (IS_VAR_DATA_TYPE(data.info.type)) {
|
||||
data.varmeta.length = len;
|
||||
data.varmeta.allocLen = len;
|
||||
|
@ -2418,6 +2426,15 @@ void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock) {
|
|||
}
|
||||
|
||||
return (void*)buf;
|
||||
_error:
|
||||
for (int32_t i = 0; i < sz; ++i) {
|
||||
SColumnInfoData* pColInfoData = (SColumnInfoData*)taosArrayGet(pBlock->pDataBlock, i);
|
||||
if (pColInfoData == NULL) {
|
||||
break;
|
||||
}
|
||||
colDataDestroy(pColInfoData);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char* formatTimestamp(char* buf, int64_t val, int precision) {
|
||||
|
|
|
@ -5996,6 +5996,10 @@ int32_t modeFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
|
|||
pInfo->colBytes = pCtx->resDataInfo.bytes;
|
||||
if (pInfo->pHash != NULL) {
|
||||
taosHashClear(pInfo->pHash);
|
||||
pInfo->pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == pInfo->pHash) {
|
||||
return terrno;
|
||||
}
|
||||
} else {
|
||||
pInfo->pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == pInfo->pHash) {
|
||||
|
|
|
@ -524,7 +524,12 @@ void udfdDeinitScriptPlugins() {
|
|||
void udfdProcessRequest(uv_work_t *req) {
|
||||
SUvUdfWork *uvUdf = (SUvUdfWork *)(req->data);
|
||||
SUdfRequest request = {0};
|
||||
if(decodeUdfRequest(uvUdf->input.base, &request) == NULL) return;
|
||||
if(decodeUdfRequest(uvUdf->input.base, &request) == NULL)
|
||||
{
|
||||
taosMemoryFree(uvUdf->input.base);
|
||||
fnError("udf request decode failed");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (request.type) {
|
||||
case UDF_TASK_SETUP: {
|
||||
|
|
Loading…
Reference in New Issue