Merge pull request #7586 from taosdata/fix/TD-6343
[TD-6343]<fix>: taos crash at tscSubquery.c:2447
This commit is contained in:
commit
b307223d12
|
@ -2444,7 +2444,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;
|
||||||
|
|
||||||
|
@ -2584,7 +2588,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