提交 93a3c271 编写于 作者: G Ganlin Zhao

fix(query): restrict stateduration function time unit parameter greater

than db precision.

TD-16171
上级 5344ab10
...@@ -478,7 +478,7 @@ static int32_t translateStateCount(SFunctionNode* pFunc, char* pErrBuf, int32_t ...@@ -478,7 +478,7 @@ static int32_t translateStateCount(SFunctionNode* pFunc, char* pErrBuf, int32_t
if (i == 1 && !validateStateOper(pValue)) { if (i == 1 && !validateStateOper(pValue)) {
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR,
"Second parameter of STATECOUNT/STATEDURATION function" "Second parameter of STATECOUNT function"
"must be one of the following: 'GE', 'GT', 'LE', 'LT', 'EQ', 'NE'"); "must be one of the following: 'GE', 'GT', 'LE', 'LT', 'EQ', 'NE'");
} }
...@@ -524,10 +524,14 @@ static int32_t translateStateDuration(SFunctionNode* pFunc, char* pErrBuf, int32 ...@@ -524,10 +524,14 @@ static int32_t translateStateDuration(SFunctionNode* pFunc, char* pErrBuf, int32
if (i == 1 && !validateStateOper(pValue)) { if (i == 1 && !validateStateOper(pValue)) {
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR,
"Second parameter of STATECOUNT/STATEDURATION function" "Second parameter of STATEDURATION function"
"must be one of the following: 'GE', 'GT', 'LE', 'LT', 'EQ', 'NE'"); "must be one of the following: 'GE', 'GT', 'LE', 'LT', 'EQ', 'NE'");
} else if (i == 3 && pValue->datum.i == 0) {
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR,
"STATEDURATION function time unit parameter should be greater than db precision");
} }
pValue->notReserved = true; pValue->notReserved = true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册