fix: fix result of first can be 0 occasionally

This commit is contained in:
Ganlin Zhao 2023-06-27 14:32:35 +08:00
parent 98fbf1abb4
commit 56a715b5d5
1 changed files with 4 additions and 0 deletions

View File

@ -2415,6 +2415,10 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
}
static int32_t firstLastTransferInfoImpl(SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst) {
if (!pInput->hasResult) {
return TSDB_CODE_FAILED;
}
if (pOutput->hasResult) {
if (isFirst) {
if (pInput->ts > pOutput->ts) {