Merge pull request #19589 from taosdata/fix/TD-21925
fix: insert into select can't be stopped issue
This commit is contained in:
commit
7dbe44b2b7
|
@ -509,9 +509,8 @@ void taos_stop_query(TAOS_RES *res) {
|
||||||
SRequestObj *pRequest = (SRequestObj *)res;
|
SRequestObj *pRequest = (SRequestObj *)res;
|
||||||
pRequest->killed = true;
|
pRequest->killed = true;
|
||||||
|
|
||||||
int32_t numOfFields = taos_num_fields(pRequest);
|
|
||||||
// It is not a query, no need to stop.
|
// It is not a query, no need to stop.
|
||||||
if (numOfFields == 0) {
|
if (NULL == pRequest->pQuery || QUERY_EXEC_MODE_SCHEDULE != pRequest->pQuery->execMode) {
|
||||||
tscDebug("request 0x%" PRIx64 " no need to be killed since not query", pRequest->requestId);
|
tscDebug("request 0x%" PRIx64 " no need to be killed since not query", pRequest->requestId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,11 +300,7 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STMT_TYPE_MULTI_INSERT == pStmt->sql.type) {
|
qDestroyStmtDataBlock(pBlocks);
|
||||||
qFreeStmtDataBlock(pBlocks);
|
|
||||||
} else {
|
|
||||||
qDestroyStmtDataBlock(pBlocks);
|
|
||||||
}
|
|
||||||
taosHashRemove(pStmt->exec.pBlockHash, key, keyLen);
|
taosHashRemove(pStmt->exec.pBlockHash, key, keyLen);
|
||||||
|
|
||||||
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
|
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
|
||||||
|
|
|
@ -425,6 +425,27 @@ int32_t qCloneStmtDataBlock(void** pDst, void* pSrc) {
|
||||||
pBlock->pTableMeta = pNewMeta;
|
pBlock->pTableMeta = pNewMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pBlock->boundColumnInfo.boundColumns) {
|
||||||
|
int32_t size = pBlock->boundColumnInfo.numOfCols * sizeof(col_id_t);
|
||||||
|
void* tmp = taosMemoryMalloc(size);
|
||||||
|
memcpy(tmp, pBlock->boundColumnInfo.boundColumns, size);
|
||||||
|
pBlock->boundColumnInfo.boundColumns = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pBlock->boundColumnInfo.cols) {
|
||||||
|
int32_t size = pBlock->boundColumnInfo.numOfCols * sizeof(SBoundColumn);
|
||||||
|
void* tmp = taosMemoryMalloc(size);
|
||||||
|
memcpy(tmp, pBlock->boundColumnInfo.cols, size);
|
||||||
|
pBlock->boundColumnInfo.cols = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pBlock->boundColumnInfo.colIdxInfo) {
|
||||||
|
int32_t size = pBlock->boundColumnInfo.numOfBound * sizeof(SBoundIdxInfo);
|
||||||
|
void* tmp = taosMemoryMalloc(size);
|
||||||
|
memcpy(tmp, pBlock->boundColumnInfo.colIdxInfo, size);
|
||||||
|
pBlock->boundColumnInfo.colIdxInfo = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
return qResetStmtDataBlock(*pDst, false);
|
return qResetStmtDataBlock(*pDst, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,7 +458,7 @@ int32_t qRebuildStmtDataBlock(void** pDst, void* pSrc, uint64_t uid, int32_t vgI
|
||||||
STableDataBlocks* pBlock = (STableDataBlocks*)*pDst;
|
STableDataBlocks* pBlock = (STableDataBlocks*)*pDst;
|
||||||
pBlock->pData = taosMemoryMalloc(pBlock->nAllocSize);
|
pBlock->pData = taosMemoryMalloc(pBlock->nAllocSize);
|
||||||
if (NULL == pBlock->pData) {
|
if (NULL == pBlock->pData) {
|
||||||
qFreeStmtDataBlock(pBlock);
|
qDestroyStmtDataBlock(pBlock);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -897,6 +897,7 @@ void taosLogCrashInfo(char* nodeType, char* pMsg, int64_t msgLen, int signum, vo
|
||||||
|
|
||||||
pFile = taosOpenFile(filepath, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
|
pFile = taosOpenFile(filepath, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
|
||||||
if (pFile == NULL) {
|
if (pFile == NULL) {
|
||||||
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
taosPrintLog(flags, level, dflag, "failed to open file:%s since %s", filepath, terrstr());
|
taosPrintLog(flags, level, dflag, "failed to open file:%s since %s", filepath, terrstr());
|
||||||
goto _return;
|
goto _return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2828,7 +2828,7 @@ void runAll(TAOS *taos) {
|
||||||
printf("%s Begin\n", gCaseCtrl.caseCatalog);
|
printf("%s Begin\n", gCaseCtrl.caseCatalog);
|
||||||
runCaseList(taos);
|
runCaseList(taos);
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
strcpy(gCaseCtrl.caseCatalog, "Micro DB precision Test");
|
strcpy(gCaseCtrl.caseCatalog, "Micro DB precision Test");
|
||||||
printf("%s Begin\n", gCaseCtrl.caseCatalog);
|
printf("%s Begin\n", gCaseCtrl.caseCatalog);
|
||||||
gCaseCtrl.precision = TIME_PRECISION_MICRO;
|
gCaseCtrl.precision = TIME_PRECISION_MICRO;
|
||||||
|
|
Loading…
Reference in New Issue