From 94109a31735b2258eb3e74025a7652c1dbb5cfa9 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Sat, 28 May 2022 18:55:07 +0800 Subject: [PATCH] fix(query): fix diff function bool type crash TD-16098 --- source/libs/function/src/builtins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 10ea25af6e..a2ff43c8ce 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -720,7 +720,7 @@ static int32_t translateDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { } uint8_t resType; - if (IS_SIGNED_NUMERIC_TYPE(colType)) { + if (IS_SIGNED_NUMERIC_TYPE(colType) || TSDB_DATA_TYPE_BOOL == colType) { resType = TSDB_DATA_TYPE_BIGINT; } else { resType = TSDB_DATA_TYPE_DOUBLE; -- GitLab