fix(query): fix n-1 function if select column after function position
result row is incorrect. fix/TD-18040
This commit is contained in:
parent
b51a58bde2
commit
b0becf1ca9
|
@ -202,6 +202,7 @@ bool fmIsForbidStreamFunc(int32_t funcId);
|
||||||
bool fmIsIntervalInterpoFunc(int32_t funcId);
|
bool fmIsIntervalInterpoFunc(int32_t funcId);
|
||||||
bool fmIsInterpFunc(int32_t funcId);
|
bool fmIsInterpFunc(int32_t funcId);
|
||||||
bool fmIsLastRowFunc(int32_t funcId);
|
bool fmIsLastRowFunc(int32_t funcId);
|
||||||
|
bool fmIsSelectValueFunc(int32_t funcId);
|
||||||
bool fmIsSystemInfoFunc(int32_t funcId);
|
bool fmIsSystemInfoFunc(int32_t funcId);
|
||||||
bool fmIsImplicitTsFunc(int32_t funcId);
|
bool fmIsImplicitTsFunc(int32_t funcId);
|
||||||
bool fmIsClientPseudoColumnFunc(int32_t funcId);
|
bool fmIsClientPseudoColumnFunc(int32_t funcId);
|
||||||
|
|
|
@ -672,6 +672,10 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc
|
||||||
|
|
||||||
numOfRows = pfCtx->fpSet.process(pfCtx);
|
numOfRows = pfCtx->fpSet.process(pfCtx);
|
||||||
} else if (fmIsAggFunc(pfCtx->functionId)) {
|
} else if (fmIsAggFunc(pfCtx->functionId)) {
|
||||||
|
// diff/derivative selective value should be set during function execution
|
||||||
|
if (fmIsSelectValueFunc(pfCtx->functionId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// _group_key function for "partition by tbname" + csum(col_name) query
|
// _group_key function for "partition by tbname" + csum(col_name) query
|
||||||
SColumnInfoData* pOutput = taosArrayGet(pResult->pDataBlock, outputSlotId);
|
SColumnInfoData* pOutput = taosArrayGet(pResult->pDataBlock, outputSlotId);
|
||||||
int32_t slotId = pfCtx->param[0].pCol->slotId;
|
int32_t slotId = pfCtx->param[0].pCol->slotId;
|
||||||
|
|
|
@ -221,6 +221,13 @@ bool fmIsLastRowFunc(int32_t funcId) {
|
||||||
return FUNCTION_TYPE_LAST_ROW == funcMgtBuiltins[funcId].type;
|
return FUNCTION_TYPE_LAST_ROW == funcMgtBuiltins[funcId].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool fmIsSelectValueFunc(int32_t funcId) {
|
||||||
|
if (funcId < 0 || funcId >= funcMgtBuiltinsNum) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return FUNCTION_TYPE_SELECT_VALUE == funcMgtBuiltins[funcId].type;
|
||||||
|
}
|
||||||
|
|
||||||
void fmFuncMgtDestroy() {
|
void fmFuncMgtDestroy() {
|
||||||
void* m = gFunMgtService.pFuncNameHashTable;
|
void* m = gFunMgtService.pFuncNameHashTable;
|
||||||
if (m != NULL && atomic_val_compare_exchange_ptr((void**)&gFunMgtService.pFuncNameHashTable, m, 0) == m) {
|
if (m != NULL && atomic_val_compare_exchange_ptr((void**)&gFunMgtService.pFuncNameHashTable, m, 0) == m) {
|
||||||
|
|
Loading…
Reference in New Issue