diff --git a/docs/en/14-reference/01-components/02-taosc.md b/docs/en/14-reference/01-components/02-taosc.md index 7b8d3ae78c..83cb3d765b 100644 --- a/docs/en/14-reference/01-components/02-taosc.md +++ b/docs/en/14-reference/01-components/02-taosc.md @@ -44,6 +44,7 @@ The TDengine client driver provides all the APIs needed for application programm |enableQueryHb | |Supported, effective immediately |Internal parameter, whether to send query heartbeat messages| |minSlidingTime | |Supported, effective immediately |Internal parameter, minimum allowable value for sliding| |minIntervalTime | |Supported, effective immediately |Internal parameter, minimum allowable value for interval| +|compareAsStrInGreatest | v3.3.6.0 |Supported, effective immediately |When the greatest and least functions have both numeric and string types as parameters, the comparison type conversion rules are as follows: Integer; 1: uniformly converted to string comparison, 0: uniformly converted to numeric type comparison.| ### Writing Related diff --git a/docs/zh/14-reference/01-components/02-taosc.md b/docs/zh/14-reference/01-components/02-taosc.md index 262027bff6..8952e35664 100755 --- a/docs/zh/14-reference/01-components/02-taosc.md +++ b/docs/zh/14-reference/01-components/02-taosc.md @@ -221,6 +221,12 @@ TDengine 客户端驱动提供了应用编程所需要的全部 API,并且在 - 动态修改:不支持 - 支持版本:从 v3.0.0.0 版本开始引入 +#### compareAsStrInGreatest +- 说明:用于决定 greatest、least 函数的参数既有数值类型又有字符串类型时,比较类型的转换规则。 +- 类型:整数;1:统一转为字符串比较,0:统一转为数值类型比较。 +- 动态修改:支持通过 SQL 修改,立即生效 +- 支持版本:从 v3.3.6.0 版本开始引入 + ### 写入相关 #### smlChildTableName diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 34ff535486..8233b2d450 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -1778,7 +1778,7 @@ static int32_t translateGreatestleast(SFunctionNode* pFunc, char* pErrBuf, int32 } else if (IS_MATHABLE_TYPE(res.type) || !mixTypeToStrings) { int32_t resType = vectorGetConvertType(res.type, para->type); res.type = resType == 0 ? res.type : resType; - res.bytes = tDataTypes[resType].bytes; + res.bytes = tDataTypes[res.type].bytes; } else { // last res is strings, para is numeric and mixTypeToStrings is true res.bytes = TMAX(res.bytes, NUMERIC_TO_STRINGS_LEN);