fix: fix explain buffer issue
This commit is contained in:
parent
b49d4ed414
commit
bebd9225cc
|
@ -5123,8 +5123,15 @@ int tDecodeSVCreateTbRsp(SDecoder *pCoder, SVCreateTbRsp *pRsp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void tFreeSVCreateTbRsp(void* param) {
|
void tFreeSVCreateTbRsp(void* param) {
|
||||||
|
if (NULL == param) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SVCreateTbRsp* pRsp = (SVCreateTbRsp*)param;
|
SVCreateTbRsp* pRsp = (SVCreateTbRsp*)param;
|
||||||
taosMemoryFree(pRsp->pMeta);
|
if (pRsp->pMeta) {
|
||||||
|
taosMemoryFree(pRsp->pMeta->pSchemas);
|
||||||
|
taosMemoryFree(pRsp->pMeta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TDMT_VND_DROP_TABLE =================
|
// TDMT_VND_DROP_TABLE =================
|
||||||
|
|
|
@ -135,7 +135,12 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) {
|
||||||
NODES_ERR_RET(TSDB_CODE_QRY_APP_ERROR);
|
NODES_ERR_RET(TSDB_CODE_QRY_APP_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
*len += snprintf(buf + *len, bufSize - *len, "%s", t);
|
int32_t tlen = strlen(t);
|
||||||
|
if (tlen > 32) {
|
||||||
|
*len += snprintf(buf + *len, bufSize - *len, "%.*s...%s", 32, t, t + tlen - 1);
|
||||||
|
} else {
|
||||||
|
*len += snprintf(buf + *len, bufSize - *len, "%s", t);
|
||||||
|
}
|
||||||
taosMemoryFree(t);
|
taosMemoryFree(t);
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -199,12 +204,17 @@ int32_t nodesNodeToSQL(SNode *pNode, char *buf, int32_t bufSize, int32_t *len) {
|
||||||
SNodeListNode *pListNode = (SNodeListNode *)pNode;
|
SNodeListNode *pListNode = (SNodeListNode *)pNode;
|
||||||
SNode *node = NULL;
|
SNode *node = NULL;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
int32_t num = 0;
|
||||||
|
|
||||||
*len += snprintf(buf + *len, bufSize - *len, "(");
|
*len += snprintf(buf + *len, bufSize - *len, "(");
|
||||||
|
|
||||||
FOREACH(node, pListNode->pNodeList) {
|
FOREACH(node, pListNode->pNodeList) {
|
||||||
if (!first) {
|
if (!first) {
|
||||||
*len += snprintf(buf + *len, bufSize - *len, ", ");
|
*len += snprintf(buf + *len, bufSize - *len, ", ");
|
||||||
|
if (++num >= 10) {
|
||||||
|
*len += snprintf(buf + *len, bufSize - *len, "...");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
NODES_ERR_RET(nodesNodeToSQL(node, buf, bufSize, len));
|
NODES_ERR_RET(nodesNodeToSQL(node, buf, bufSize, len));
|
||||||
first = false;
|
first = false;
|
||||||
|
|
|
@ -313,14 +313,12 @@ void perfTest() {
|
||||||
SArray *slArray = taosArrayInit(100000000, 9);
|
SArray *slArray = taosArrayInit(100000000, 9);
|
||||||
for (int64_t i = 0; i < 1000; ++i) {
|
for (int64_t i = 0; i < 1000; ++i) {
|
||||||
int32_t num = taosArrayGetSize(sArray[i]);
|
int32_t num = taosArrayGetSize(sArray[i]);
|
||||||
printf("%d ", num);
|
|
||||||
SArray* pArray = sArray[i];
|
SArray* pArray = sArray[i];
|
||||||
for (int64_t m = 0; m < num; ++m) {
|
for (int64_t m = 0; m < num; ++m) {
|
||||||
char* p = (char*)taosArrayGet(pArray, m);
|
char* p = (char*)taosArrayGet(pArray, m);
|
||||||
ASSERT(taosArrayPush(slArray, p));
|
ASSERT(taosArrayPush(slArray, p));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
|
||||||
int64_t start100mS = taosGetTimestampMs();
|
int64_t start100mS = taosGetTimestampMs();
|
||||||
int64_t start100mSCt = taosHashGetCompTimes(hash100m);
|
int64_t start100mSCt = taosHashGetCompTimes(hash100m);
|
||||||
int32_t num = taosArrayGetSize(slArray);
|
int32_t num = taosArrayGetSize(slArray);
|
||||||
|
|
Loading…
Reference in New Issue