[td-225]
This commit is contained in:
parent
1777a19c30
commit
cfa288674a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue