fix(query): fix countAlwaysReturnValue param not taking effect for

count and hyperloglog function

TD-20140
This commit is contained in:
Ganlin Zhao 2022-11-03 10:39:53 +08:00
parent 794bca7974
commit 5fffeba2f3
2 changed files with 6 additions and 2 deletions

View File

@ -551,7 +551,7 @@ int32_t countFunction(SqlFunctionCtx* pCtx) {
if (tsCountAlwaysReturnValue) {
pResInfo->numOfRes = 1;
} else {
SET_VAL(pResInfo, 1, 1);
SET_VAL(pResInfo, *((int64_t*)buf), 1);
}
return TSDB_CODE_SUCCESS;

View File

@ -241,7 +241,11 @@ bool fmIsNotNullOutputFunc(int32_t funcId) {
FUNCTION_TYPE_LAST_MERGE == funcMgtBuiltins[funcId].type ||
FUNCTION_TYPE_FIRST == funcMgtBuiltins[funcId].type ||
FUNCTION_TYPE_FIRST_PARTIAL == funcMgtBuiltins[funcId].type ||
FUNCTION_TYPE_FIRST_MERGE == funcMgtBuiltins[funcId].type;
FUNCTION_TYPE_FIRST_MERGE == funcMgtBuiltins[funcId].type ||
FUNCTION_TYPE_COUNT == funcMgtBuiltins[funcId].type ||
FUNCTION_TYPE_HYPERLOGLOG == funcMgtBuiltins[funcId].type ||
FUNCTION_TYPE_HYPERLOGLOG_PARTIAL == funcMgtBuiltins[funcId].type ||
FUNCTION_TYPE_HYPERLOGLOG_MERGE == funcMgtBuiltins[funcId].type;
}
bool fmIsSelectValueFunc(int32_t funcId) {