提交 14c377e3 编写于 作者: H hjxilinx

refactor some codes, avoid set return code to be 0.

上级 5ddc7b45
......@@ -445,7 +445,8 @@ void tscSetLocalQueryResult(SSqlObj *pSql, const char *val, const char *columnNa
SSqlRes *pRes = &pSql->res;
pCmd->numOfCols = 1;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex);
pQueryInfo->order.order = TSQL_SO_ASC;
tscClearFieldInfo(&pQueryInfo->fieldsInfo);
......
......@@ -365,6 +365,9 @@ void tscFreeSqlCmdData(SSqlCmd* pCmd) {
tscFreeSubqueryInfo(pCmd);
}
/*
* this function must not change the pRes->code value, since it may be used later.
*/
void tscFreeResData(SSqlObj* pSql) {
SSqlRes* pRes = &pSql->res;
......@@ -386,10 +389,8 @@ void tscFreeResData(SSqlObj* pSql) {
pRes->offset = 0;
pRes->useconds = 0;
pRes->code = 0;
pRes->data = NULL;
tfree(pRes->pGroupRec);
tscDestroyLocalReducer(pSql);
......@@ -404,8 +405,6 @@ void tscFreeSqlObjPartial(SSqlObj* pSql) {
}
SSqlCmd* pCmd = &pSql->cmd;
SSqlRes* pRes = &pSql->res;
STscObj* pObj = pSql->pTscObj;
int32_t cmd = pCmd->command;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册