fix: save selectivity value for first/last even column consists of all null values
This commit is contained in:
parent
a02293a541
commit
84f79e8df2
|
@ -2795,6 +2795,8 @@ int32_t firstFunction(SqlFunctionCtx* pCtx) {
|
|||
// All null data column, return directly.
|
||||
if (pInput->colDataAggIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows)) {
|
||||
ASSERT(pInputCol->hasNull == true);
|
||||
// save selectivity value for column consisted of all null values
|
||||
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2871,7 +2873,10 @@ int32_t firstFunction(SqlFunctionCtx* pCtx) {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (numOfElems == 0) {
|
||||
// save selectivity value for column consisted of all null values
|
||||
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
||||
}
|
||||
SET_VAL(pResInfo, numOfElems, 1);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -2892,6 +2897,8 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
|
|||
// All null data column, return directly.
|
||||
if (pInput->colDataAggIsSet && (pInput->pColumnDataAgg[0]->numOfNull == pInput->totalRows)) {
|
||||
ASSERT(pInputCol->hasNull == true);
|
||||
// save selectivity value for column consisted of all null values
|
||||
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2952,7 +2959,10 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (numOfElems == 0) {
|
||||
// save selectivity value for column consisted of all null values
|
||||
firstlastSaveTupleData(pCtx->pSrcBlock, pInput->startRowIndex, pCtx, pInfo);
|
||||
}
|
||||
SET_VAL(pResInfo, numOfElems, 1);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1805,6 +1805,7 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) {
|
|||
|
||||
if (session->udfUvPipe == NULL) {
|
||||
fnError("tear down udf. pipe to udfd does not exist. udf name: %s", session->udfName);
|
||||
taosMemoryFree(session);
|
||||
return TSDB_CODE_UDF_PIPE_NO_PIPE;
|
||||
}
|
||||
|
||||
|
@ -1823,6 +1824,7 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) {
|
|||
udfcRunUdfUvTask(task, UV_TASK_DISCONNECT);
|
||||
|
||||
fnInfo("tear down udf. udf name: %s, udf func handle: %p", session->udfName, handle);
|
||||
//TODO: synchronization refactor between libuv event loop and request thread
|
||||
if (session->udfUvPipe != NULL && session->udfUvPipe->data != NULL) {
|
||||
SClientUvConn *conn = session->udfUvPipe->data;
|
||||
conn->session = NULL;
|
||||
|
|
Loading…
Reference in New Issue