提交 cfa28867 编写于 作者: H Haojun Liao

[td-225]

上级 1777a19c
......@@ -335,15 +335,6 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
rpcMsg->code = pRes->code ? pRes->code : pRes->numOfRows;
tscTrace("%p SQL result:%s res:%p", pSql, tstrerror(pRes->code), pSql);
/*
* Whether to free sqlObj or not should be decided before call the user defined function, since this SqlObj
* may be freed in UDF, and reused by other threads before tscShouldBeFreed called, in which case
* tscShouldBeFreed checks an object which is actually allocated by other threads.
*
* If this block of memory is re-allocated for an insert thread, in which tscKeepConn[command] equals to 0,
* the tscShouldBeFreed will success and tscFreeSqlObj free it immediately.
*/
bool shouldFree = tscShouldBeFreed(pSql);
(*pSql->fp)(pSql->param, pSql, rpcMsg->code);
......
......@@ -1475,15 +1475,12 @@ bool tscShouldBeFreed(SSqlObj* pSql) {
return false;
}
// only the table meta and super table vgroup query will free resource automatically
int32_t command = pSql->cmd.command;
if (command == TSDB_SQL_META || command == TSDB_SQL_STABLEVGROUP) {//TODO subquery should be freed here
if (command == TSDB_SQL_META || command == TSDB_SQL_STABLEVGROUP) {
return true;
}
// all subqueries should be automatically freed
// if (pSql->cmd.pQueryInfo != NULL && pSql->cmd.pQueryInfo[0]->type & TSDB_QUERY_TYPE_SUBQUERY) {
// return true;
// }
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册