fix: new merge code

This commit is contained in:
dapan1121 2024-10-24 17:19:26 +08:00
parent 4f3484b823
commit f7503a2ea9
6 changed files with 7 additions and 38 deletions

View File

@ -112,7 +112,6 @@ double taosStr2Double(const char *str, char **pEnd);
float taosStr2Float(const char *str, char **pEnd); float taosStr2Float(const char *str, char **pEnd);
int32_t taosHex2Ascii(const char *z, uint32_t n, void **data, uint32_t *size); int32_t taosHex2Ascii(const char *z, uint32_t n, void **data, uint32_t *size);
int32_t taosAscii2Hex(const char *z, uint32_t n, void **data, uint32_t *size); int32_t taosAscii2Hex(const char *z, uint32_t n, void **data, uint32_t *size);
char *taosStrndup(const char *s, int n);
//int32_t taosBin2Ascii(const char *z, uint32_t n, void** data, uint32_t* size); //int32_t taosBin2Ascii(const char *z, uint32_t n, void** data, uint32_t* size);
bool isHex(const char* z, uint32_t n); bool isHex(const char* z, uint32_t n);
bool isValidateHex(const char* z, uint32_t n); bool isValidateHex(const char* z, uint32_t n);

View File

@ -1288,7 +1288,7 @@ end:
destroyRequest(pRequest); destroyRequest(pRequest);
tDecoderClear(&coder); tDecoderClear(&coder);
qDestroyQuery(pQuery); qDestroyQuery(pQuery);
taosArrayDestroyP(pTagList, taosMemoryFree); taosArrayDestroyP(pTagList, NULL);
return code; return code;
} }

View File

@ -479,7 +479,7 @@ int32_t smlParseEndLine(SSmlHandle *info, SSmlLineInfo *elements, SSmlKv *kvTs)
} }
clearColValArraySml(info->currTableDataCtx->pValues); clearColValArraySml(info->currTableDataCtx->pValues);
taosArrayClearP(info->escapedStringList, taosMemoryFree); taosArrayClearP(info->escapedStringList, NULL);
if (unlikely(ret != TSDB_CODE_SUCCESS)) { if (unlikely(ret != TSDB_CODE_SUCCESS)) {
smlBuildInvalidDataMsg(&info->msgBuf, "smlBuildCol error", NULL); smlBuildInvalidDataMsg(&info->msgBuf, "smlBuildCol error", NULL);
return ret; return ret;
@ -1609,7 +1609,7 @@ void smlDestroyInfo(SSmlHandle *info) {
taosArrayDestroy(info->valueJsonArray); taosArrayDestroy(info->valueJsonArray);
taosArrayDestroyEx(info->preLineTagKV, freeSSmlKv); taosArrayDestroyEx(info->preLineTagKV, freeSSmlKv);
taosArrayDestroyP(info->escapedStringList, taosMemoryFree); taosArrayDestroyP(info->escapedStringList, NULL);
if (!info->dataFormat) { if (!info->dataFormat) {
for (int i = 0; i < info->lineNum; i++) { for (int i = 0; i < info->lineNum; i++) {
@ -1952,7 +1952,7 @@ int32_t smlClearForRerun(SSmlHandle *info) {
} }
} }
taosArrayClearP(info->escapedStringList, taosMemoryFree); taosArrayClearP(info->escapedStringList, NULL);
(void)memset(&info->preLine, 0, sizeof(SSmlLineInfo)); (void)memset(&info->preLine, 0, sizeof(SSmlLineInfo));
info->currSTableMeta = NULL; info->currSTableMeta = NULL;
info->currTableDataCtx = NULL; info->currTableDataCtx = NULL;

View File

@ -2177,6 +2177,7 @@ static SSDataBlock* sysTableScanFromMNode(SOperatorInfo* pOperator, SSysTableSca
pMsgSendInfo->fp = loadSysTableCallback; pMsgSendInfo->fp = loadSysTableCallback;
pMsgSendInfo->requestId = pTaskInfo->id.queryId; pMsgSendInfo->requestId = pTaskInfo->id.queryId;
void* poolHandle = NULL;
taosSaveDisableMemoryPoolUsage(poolHandle); taosSaveDisableMemoryPoolUsage(poolHandle);
code = asyncSendMsgToServer(pInfo->readHandle.pMsgCb->clientRpc, &pInfo->epSet, NULL, pMsgSendInfo); code = asyncSendMsgToServer(pInfo->readHandle.pMsgCb->clientRpc, &pInfo->epSet, NULL, pMsgSendInfo);
taosRestoreEnableMemoryPoolUsage(poolHandle); taosRestoreEnableMemoryPoolUsage(poolHandle);

View File

@ -390,37 +390,6 @@ char *taosStrdupi(const char *ptr) {
#endif #endif
} }
char *taosStrndupi(const char *ptr, int64_t size) {
#ifdef USE_TD_MEMORY
if (ptr == NULL) return NULL;
TdMemoryInfoPtr pTdMemoryInfo = (TdMemoryInfoPtr)((char *)ptr - sizeof(TdMemoryInfo));
ASSERT(pTdMemoryInfo->symbol == TD_MEMORY_SYMBOL);
if (pTdMemoryInfo->symbol != TD_MEMORY_SYMBOL) {
return NULL;
}
void *tmp = tstrdup(pTdMemoryInfo);
if (tmp == NULL) return NULL;
memcpy(tmp, pTdMemoryInfo, sizeof(TdMemoryInfo));
taosBackTrace(((TdMemoryInfoPtr)tmp)->stackTrace, TD_MEMORY_STACK_TRACE_DEPTH);
return (char *)tmp + sizeof(TdMemoryInfo);
#else
#ifdef BUILD_WITH_RAND_ERR
if (tsEnableRandErr) {
uint32_t r = taosRand() % 10001;
if ((r + 1) <= tsRandErrChance) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return NULL;
}
}
#endif
return tstrndup(ptr, size);
#endif
}
void taosMemFree(void *ptr) { void taosMemFree(void *ptr) {
if (NULL == ptr) return; if (NULL == ptr) return;

View File

@ -63,7 +63,7 @@ char *strsep(char **stringp, const char *delim) {
/* NOTREACHED */ /* NOTREACHED */
} }
/* Duplicate a string, up to at most size characters */ /* Duplicate a string, up to at most size characters */
char *taosStrndup(const char *s, int size) { char *taosStrndupi(const char *s, int64_t size) {
if (s == NULL) return NULL; if (s == NULL) return NULL;
size_t l; size_t l;
char *s2; char *s2;
@ -88,7 +88,7 @@ char *stpncpy(char *dest, const char *src, int n) {
return memset(dest, '\0', n - size); return memset(dest, '\0', n - size);
} }
#else #else
char *taosStrndup(const char *s, int size) { char *taosStrndupi(const char *s, int64_t size) {
if (s == NULL) { if (s == NULL) {
return NULL; return NULL;
} }