提交 1e8dcace 编写于 作者: H Haojun Liao

fix(query): set null for inf and nan value.

上级 e29e477b
......@@ -723,7 +723,12 @@ int32_t avgFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
}
}
pEntryInfo->numOfRes = (pRes->count > 0)? 1:0;
if (pRes->count == 0 || isinf(pRes->result) || isnan(pRes->result)) {
pEntryInfo->numOfRes = 0;
} else {
pEntryInfo->numOfRes = 1;
}
return functionFinalize(pCtx, pBlock);
}
......
......@@ -15,7 +15,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False)
tdSql.init(conn.cursor(), True)
self.setsql = TDSetSql()
self.column_dict = {
'ts':'timestamp',
......@@ -413,7 +413,7 @@ class TDTestCase:
tdSql.checkData(0,2,14042.142857143)
tdSql.checkData(0,3,53.571428571)
tdSql.checkData(0,4,5.828571332045761e+37)
tdSql.checkData(0,5,math.inf)
tdSql.checkData(0,5,None)
# check + - * / in functions
......@@ -423,7 +423,7 @@ class TDTestCase:
tdSql.checkData(0,2,14042.142857143)
tdSql.checkData(0,3,26.785714286)
tdSql.checkData(0,4,2.9142856660228804e+37)
tdSql.checkData(0,5,math.inf)
tdSql.checkData(0,5,None)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册