diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 68717c551b279642bb52e11f2d1c7a8205664a29..d87b07364220ee6f26bfbce9b28dcd7253e04dee 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -3428,7 +3428,8 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col if (isinf(start->valuedouble) || (width != NULL && isinf(width->valuedouble)) || - (factor != NULL && isinf(factor->valuedouble))) { + (factor != NULL && isinf(factor->valuedouble)) || + (count != NULL && isinf(count->valuedouble))) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg23); } diff --git a/tests/develop-test/2-query/function_histogram.py b/tests/develop-test/2-query/function_histogram.py index a2ee171a5dae1e31f69cce56a647f892ffc02669..f77686df0204113829acaf56c17003ee4d3e77db 100644 --- a/tests/develop-test/2-query/function_histogram.py +++ b/tests/develop-test/2-query/function_histogram.py @@ -1057,6 +1057,16 @@ class TDTestCase: tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": "abc", "infinity": true}\', 0) from stb;') tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": "中文", "infinity": true}\', 0) from stb;') tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": abc, "infinity": true}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1.8e+308, "infinity": true}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": -1.8e+308, "infinity": true}\', 0) from stb;') + + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": 1}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": 0}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": -1.5}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": 1.8e+308}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": "abc"}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": "中文"}\', 0) from stb;') + tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": abc}\', 0) from stb;') return tdSql.execute('drop database db')