[TD-6343]<fix>: taos crash at tscSubquery.c:2447
This commit is contained in:
parent
c294053e92
commit
6b652fa2c3
|
@ -2442,7 +2442,11 @@ static void doSendQueryReqs(SSchedMsg* pSchedMsg) {
|
||||||
SSqlObj* pSql = pSchedMsg->ahandle;
|
SSqlObj* pSql = pSchedMsg->ahandle;
|
||||||
SPair* p = pSchedMsg->msg;
|
SPair* p = pSchedMsg->msg;
|
||||||
|
|
||||||
for(int32_t i = p->first; i < p->second; ++i) {
|
for (int32_t i = p->first; i < p->second; ++i) {
|
||||||
|
if (i == pSql->subState.numOfSub) {
|
||||||
|
tfree(p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
SSqlObj* pSub = pSql->pSubs[i];
|
SSqlObj* pSub = pSql->pSubs[i];
|
||||||
SRetrieveSupport* pSupport = pSub->param;
|
SRetrieveSupport* pSupport = pSub->param;
|
||||||
|
|
||||||
|
@ -2582,7 +2586,12 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
|
||||||
int32_t numOfTasks = (pState->numOfSub + MAX_REQUEST_PER_TASK - 1)/MAX_REQUEST_PER_TASK;
|
int32_t numOfTasks = (pState->numOfSub + MAX_REQUEST_PER_TASK - 1)/MAX_REQUEST_PER_TASK;
|
||||||
assert(numOfTasks >= 1);
|
assert(numOfTasks >= 1);
|
||||||
|
|
||||||
int32_t num = (pState->numOfSub/numOfTasks) + 1;
|
int32_t num;
|
||||||
|
if (pState->numOfSub / numOfTasks == MAX_REQUEST_PER_TASK) {
|
||||||
|
num = MAX_REQUEST_PER_TASK;
|
||||||
|
} else {
|
||||||
|
num = pState->numOfSub / numOfTasks + 1;
|
||||||
|
}
|
||||||
tscDebug("0x%"PRIx64 " query will be sent by %d threads", pSql->self, numOfTasks);
|
tscDebug("0x%"PRIx64 " query will be sent by %d threads", pSql->self, numOfTasks);
|
||||||
|
|
||||||
for(int32_t j = 0; j < numOfTasks; ++j) {
|
for(int32_t j = 0; j < numOfTasks; ++j) {
|
||||||
|
|
Loading…
Reference in New Issue