commit
d566ed985d
|
@ -5705,16 +5705,23 @@ void tscPrintSelectClause(SSqlCmd* pCmd) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* str = calloc(1, 10240);
|
int32_t totalBufSize = 10240;
|
||||||
|
char* str = (char*)calloc(1, 10240);
|
||||||
|
if (str == NULL) return;
|
||||||
|
|
||||||
int32_t offset = 0;
|
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) {
|
for (int32_t i = 0; i < pCmd->exprsInfo.numOfExprs; ++i) {
|
||||||
SSqlExpr* pExpr = tscSqlExprGet(pCmd, i);
|
SSqlExpr* pExpr = tscSqlExprGet(pCmd, i);
|
||||||
|
|
||||||
int32_t size = sprintf(str + offset, "%s(%d)", aAggs[pExpr->functionId].aName, pExpr->colInfo.colId);
|
char tmpBuf[1024] = {0};
|
||||||
offset += size;
|
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) {
|
if (i < pCmd->exprsInfo.numOfExprs - 1) {
|
||||||
str[offset++] = ',';
|
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
|
if (metric != NULL && metric[0] != '\0') { // dump metric definition
|
||||||
count = taosGetTableDes(metric, tableDes);
|
count = taosGetTableDes(metric, tableDes);
|
||||||
|
|
||||||
if (count < 0) return -1;
|
if (count < 0) {
|
||||||
|
free(tableDes);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
||||||
|
|
||||||
|
@ -805,18 +808,26 @@ int32_t taosDumpTable(char *table, char *metric, struct arguments *arguments, FI
|
||||||
|
|
||||||
count = taosGetTableDes(table, tableDes);
|
count = taosGetTableDes(table, tableDes);
|
||||||
|
|
||||||
if (count < 0) return -1;
|
if (count < 0) {
|
||||||
|
free(tableDes);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
taosDumpCreateMTableClause(tableDes, metric, count, arguments, fp);
|
taosDumpCreateMTableClause(tableDes, metric, count, arguments, fp);
|
||||||
|
|
||||||
} else { // dump table definition
|
} else { // dump table definition
|
||||||
count = taosGetTableDes(table, tableDes);
|
count = taosGetTableDes(table, tableDes);
|
||||||
|
|
||||||
if (count < 0) return -1;
|
if (count < 0) {
|
||||||
|
free(tableDes);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
taosDumpCreateTableClause(tableDes, count, arguments, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(tableDes);
|
||||||
|
|
||||||
return taosDumpTableData(fp, table, arguments);
|
return taosDumpTableData(fp, table, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ void vnodeCloseShellVnode(int vnode) {
|
||||||
if (shellList[vnode] == NULL) return;
|
if (shellList[vnode] == NULL) return;
|
||||||
|
|
||||||
for (int i = 0; i < vnodeList[vnode].cfg.maxSessions; ++i) {
|
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));
|
int32_t* v = malloc(sizeof(int32_t));
|
||||||
|
@ -369,8 +369,10 @@ int vnodeProcessQueryRequest(char *pMsg, int msgLen, SShellObj *pObj) {
|
||||||
|
|
||||||
if (pObj->qhandle) {
|
if (pObj->qhandle) {
|
||||||
dTrace("QInfo:%p %s free qhandle", pObj->qhandle, __FUNCTION__);
|
dTrace("QInfo:%p %s free qhandle", pObj->qhandle, __FUNCTION__);
|
||||||
vnodeFreeQInfo(pObj->qhandle, true);
|
void* qHandle = pObj->qhandle;
|
||||||
pObj->qhandle = NULL;
|
pObj->qhandle = NULL;
|
||||||
|
|
||||||
|
vnodeDecRefCount(qHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QUERY_IS_STABLE_QUERY(pQueryMsg->queryType)) {
|
if (QUERY_IS_STABLE_QUERY(pQueryMsg->queryType)) {
|
||||||
|
|
Loading…
Reference in New Issue