未验证 提交 d566ed98 编写于 作者: H haojun Liao 提交者: GitHub

Merge pull request #1155 from taosdata/beta/v1.6.5.3

Beta/v1.6.5.3
......@@ -5705,16 +5705,23 @@ void tscPrintSelectClause(SSqlCmd* pCmd) {
return;
}
char* str = calloc(1, 10240);
int32_t totalBufSize = 10240;
char* str = (char*)calloc(1, 10240);
if (str == NULL) return;
int32_t offset = 0;
offset += sprintf(str, "%d [", pCmd->exprsInfo.numOfExprs);
offset += sprintf(str, "num:%d [", pCmd->exprsInfo.numOfExprs);
for (int32_t i = 0; i < pCmd->exprsInfo.numOfExprs; ++i) {
SSqlExpr* pExpr = tscSqlExprGet(pCmd, i);
int32_t size = sprintf(str + offset, "%s(%d)", aAggs[pExpr->functionId].aName, pExpr->colInfo.colId);
offset += size;
char tmpBuf[1024] = {0};
int32_t tmpLen = 0;
tmpLen = sprintf(tmpBuf, "%s(uid:%" PRId64 ", %d)", aAggs[pExpr->functionId].aName, pExpr->uid, pExpr->colInfo.colId);
if (tmpLen + offset > totalBufSize) break;
offset += sprintf(str + offset, "%s", tmpBuf);
if (i < pCmd->exprsInfo.numOfExprs - 1) {
str[offset++] = ',';
}
......
......@@ -797,7 +797,10 @@ int32_t taosDumpTable(char *table, char *metric, struct arguments *arguments, FI
if (metric != NULL && metric[0] != '\0') { // dump metric definition
count = taosGetTableDes(metric, tableDes);
if (count < 0) return -1;
if (count < 0) {
free(tableDes);
return -1;
}
taosDumpCreateTableClause(tableDes, count, arguments, fp);
......@@ -805,18 +808,26 @@ int32_t taosDumpTable(char *table, char *metric, struct arguments *arguments, FI
count = taosGetTableDes(table, tableDes);
if (count < 0) return -1;
if (count < 0) {
free(tableDes);
return -1;
}
taosDumpCreateMTableClause(tableDes, metric, count, arguments, fp);
} else { // dump table definition
count = taosGetTableDes(table, tableDes);
if (count < 0) return -1;
if (count < 0) {
free(tableDes);
return -1;
}
taosDumpCreateTableClause(tableDes, count, arguments, fp);
}
free(tableDes);
return taosDumpTableData(fp, table, arguments);
}
......
......@@ -215,7 +215,7 @@ void vnodeCloseShellVnode(int vnode) {
if (shellList[vnode] == NULL) return;
for (int i = 0; i < vnodeList[vnode].cfg.maxSessions; ++i) {
vnodeFreeQInfo(shellList[vnode][i].qhandle, true);
vnodeDecRefCount(shellList[vnode][i].qhandle);
}
int32_t* v = malloc(sizeof(int32_t));
......@@ -369,8 +369,10 @@ int vnodeProcessQueryRequest(char *pMsg, int msgLen, SShellObj *pObj) {
if (pObj->qhandle) {
dTrace("QInfo:%p %s free qhandle", pObj->qhandle, __FUNCTION__);
vnodeFreeQInfo(pObj->qhandle, true);
void* qHandle = pObj->qhandle;
pObj->qhandle = NULL;
vnodeDecRefCount(qHandle);
}
if (QUERY_IS_STABLE_QUERY(pQueryMsg->queryType)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册