diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index 87c788cc3788e4770c89908a341b2091d54261ff..459e1a909fb31ceb2f3dd96df8304b630767df0e 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -1107,6 +1107,7 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) { break; } STagIdxKey *p = entryKey; + if (p == NULL) break; if (p->type != pCursor->type) { if (first) { valid = param->reverse ? tdbTbcMoveToPrev(pCursor->pCur) : tdbTbcMoveToNext(pCursor->pCur); @@ -1116,7 +1117,7 @@ int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) { break; } } - if (p == NULL || p->suid != pKey->suid) { + if (p->suid != pKey->suid) { break; } first = false; diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index d16c5b19f3b241e1247391d0db52a3efad9b3a1b..6a6365caacff7a2762ba32dc232ae44d9651e822 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -1278,12 +1278,14 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry) { ret = metaSaveJsonVarToIdx(pMeta, pCtbEntry, pTagColumn); goto end; } - if (metaCreateTagIdxKey(pCtbEntry->ctbEntry.suid, pTagColumn->colId, pTagData, nTagData, pTagColumn->type, - pCtbEntry->uid, &pTagIdxKey, &nTagIdxKey) < 0) { - ret = -1; - goto end; + if (pTagData != NULL) { + if (metaCreateTagIdxKey(pCtbEntry->ctbEntry.suid, pTagColumn->colId, pTagData, nTagData, pTagColumn->type, + pCtbEntry->uid, &pTagIdxKey, &nTagIdxKey) < 0) { + ret = -1; + goto end; + } + tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, &pMeta->txn); } - tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, &pMeta->txn); end: metaDestroyTagIdxKey(pTagIdxKey); tDecoderClear(&dc); diff --git a/source/libs/index/src/indexJson.c b/source/libs/index/src/indexJson.c index 8ce625dfb996dc88d67114eff79e12af56011275..32b794cb71d6d1e179b4f43cf041eff3e6d300a9 100644 --- a/source/libs/index/src/indexJson.c +++ b/source/libs/index/src/indexJson.c @@ -30,7 +30,7 @@ int indexJsonPut(SIndexJson *index, SIndexJsonMultiTerm *terms, uint64_t uid) { } else { p->colType = TSDB_DATA_TYPE_DOUBLE; } - IDX_TYPE_ADD_EXTERN_TYPE(p->colType, TSDB_DATA_TYPE_JSON); + IDX_TYPE_ADD_EXTERN_TYPE((p->colType), TSDB_DATA_TYPE_JSON); } // handle put return indexPut(index, terms, uid); diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 48b3097449695af53f74147b32bb77238e44235b..126b0b638e4c7611d9e48de0d367aead086b3d17 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -439,12 +439,14 @@ void cliHandleExceptImpl(SCliConn* pConn, int32_t code) { tDebug("%s conn %p construct ahandle %p by %s", CONN_GET_INST_LABEL(pConn), pConn, transMsg.info.ahandle, TMSG_INFO(transMsg.msgType)); if (transMsg.info.ahandle == NULL) { - transMsg.info.ahandle = transCtxDumpBrokenlinkVal(&pConn->ctx, (int32_t*)&(transMsg.msgType)); + int32_t msgType = 0; + transMsg.info.ahandle = transCtxDumpBrokenlinkVal(&pConn->ctx, &msgType); + transMsg.msgType = msgType; tDebug("%s conn %p construct ahandle %p due to brokenlink", CONN_GET_INST_LABEL(pConn), pConn, transMsg.info.ahandle); } } else { - transMsg.info.ahandle = (pMsg->type != Release && pCtx) ? pCtx->ahandle : NULL; + transMsg.info.ahandle = (pMsg != NULL && pMsg->type != Release && pCtx) ? pCtx->ahandle : NULL; } if (pCtx == NULL || pCtx->pSem == NULL) { @@ -1078,9 +1080,6 @@ static void cliPrepareCb(uv_prepare_t* handle) { QUEUE_REMOVE(h); SCliMsg* pMsg = QUEUE_DATA(h, SCliMsg, q); - if (pMsg == NULL) { - continue; - } (*cliAsyncHandle[pMsg->type])(pMsg, thrd); count++; }