diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 5e442c4bf1194aa2c53e9021d9f728b42ef1d3ee..97275c03752d62398bed740eab0f22eaec8edeb8 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -199,7 +199,10 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) { taos_query_a(pTscObj, sql, syncQueryFn, param); tsem_wait(¶m->sem); - return param->pRequest; + TAOS_RES *request = param->pRequest; + tsem_destroy(¶m->sem); + taosMemoryFree(param); + return request; #else size_t sqlLen = strlen(sql); if (sqlLen > (size_t)TSDB_MAX_ALLOWED_SQL_LEN) { diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index bf60d259765563297ce0f78eb029dd6150c9f312..d63c93bd32f3f10eadd8f5699e13d71eec1a48c8 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -2261,7 +2261,7 @@ static int smlProcess(SSmlHandle *info, char* lines[], int numLines) { code = smlParseLine(info, lines, numLines); if (code != 0) { uError("SML:0x%"PRIx64" smlParseLine error : %s", info->id, tstrerror(code)); - goto cleanup; + return code; } info->cost.lineNum = numLines; @@ -2277,20 +2277,16 @@ static int smlProcess(SSmlHandle *info, char* lines[], int numLines) { if (code != 0) { uError("SML:0x%"PRIx64" smlModifyDBSchemas error : %s", info->id, tstrerror(code)); - goto cleanup; + return code; } info->cost.insertBindTime = taosGetTimestampUs(); code = smlInsertData(info); if (code != 0) { uError("SML:0x%"PRIx64" smlInsertData error : %s", info->id, tstrerror(code)); - goto cleanup; + return code; } - info->cost.endTime = taosGetTimestampUs(); -cleanup: - info->cost.code = code; - smlPrintStatisticInfo(info); return code; } @@ -2329,6 +2325,9 @@ static void smlInsertCallback(void* param, void* res, int32_t code) { printf("SML:0x%" PRIx64 " insert finished, code: %d, total: %d\n", info->id, code, info->affectedRows); Params *pParam = info->params; bool isLast = info->isLast; + info->cost.endTime = taosGetTimestampUs(); + info->cost.code = code; + smlPrintStatisticInfo(info); smlDestroyInfo(info); if(isLast){ diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index 063a78b0c64fda9f70d39c93a29ed66f8d4fdc20..ebf5098a058a68d61c3e4d115a02ad74f634ef53 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -86,11 +86,15 @@ tb_uid_t metaGetTableEntryUidByName(SMeta *pMeta, const char *name) { int nData = 0; tb_uid_t uid = 0; + metaRLock(pMeta); + if (tdbTbGet(pMeta->pNameIdx, name, strlen(name) + 1, &pData, &nData) == 0) { uid = *(tb_uid_t *)pData; tdbFree(pData); } + metaULock(pMeta); + return 0; } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 1524d8fe6fc246578c9732a8caceed0d823e6070..2f72a78c38d260796ce93c222095642dccb92785 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -787,7 +787,9 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq msgIter.suid = 0; } +#ifdef TD_DEBUG_PRINT_ROW vnodeDebugPrintSingleSubmitMsg(pVnode->pMeta, pBlock, &msgIter, "real uid"); +#endif tDecoderClear(&decoder); } else { submitBlkRsp.tblFName = taosMemoryMalloc(TSDB_TABLE_FNAME_LEN);