help to prevent current data in file from causing TDengine crashed while min/max function is invoked.
This commit is contained in:
parent
d6828370a5
commit
c0c5754b7a
|
@ -910,6 +910,16 @@ static void minMax_function(SQLFunctionCtx *pCtx, char *pOutput, int32_t isMin,
|
||||||
index = pCtx->preAggVals.maxIndex;
|
index = pCtx->preAggVals.maxIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTE: work around the bug caused by invalid pre-calculated function.
|
||||||
|
* Here the selectivity + ts will not return correct value.
|
||||||
|
*
|
||||||
|
* The following codes of 3 lines will be removed later.
|
||||||
|
*/
|
||||||
|
if (index < 0 || index >= pCtx->size + pCtx->startOffset) {
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
|
||||||
TSKEY key = pCtx->ptsList[index];
|
TSKEY key = pCtx->ptsList[index];
|
||||||
|
|
||||||
if (pCtx->inputType >= TSDB_DATA_TYPE_TINYINT && pCtx->inputType <= TSDB_DATA_TYPE_BIGINT) {
|
if (pCtx->inputType >= TSDB_DATA_TYPE_TINYINT && pCtx->inputType <= TSDB_DATA_TYPE_BIGINT) {
|
||||||
|
|
Loading…
Reference in New Issue