提交 1ce9c70c 编写于 作者: X xywang

fix(query): fixed number ranges

[TS-1210]
上级 dc266954
......@@ -136,7 +136,7 @@ int32_t exprTreeValidateExprNode(tExprNode *pExpr) {
}
break;
case TSDB_DATA_TYPE_SMALLINT:
if (sVal < -65536 || sVal > 65535) {
if (sVal < -32768 || sVal > 32767) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
break;
......@@ -151,12 +151,12 @@ int32_t exprTreeValidateExprNode(tExprNode *pExpr) {
}
break;
case TSDB_DATA_TYPE_UTINYINT:
if (uVal > 128) {
if (uVal > 255) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
break;
case TSDB_DATA_TYPE_USMALLINT:
if (uVal > 65536) {
if (uVal > 65535) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
break;
......@@ -203,7 +203,7 @@ int32_t exprTreeValidateExprNode(tExprNode *pExpr) {
pExpr->_node.pLeft->pVal->nLen = 1;
break;
case TSDB_DATA_TYPE_SMALLINT:
if (sVal < -65536 || sVal > 65535) {
if (sVal < -32768 || sVal > 32767) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
pExpr->_node.pLeft->pVal->nLen = 2;
......@@ -221,13 +221,13 @@ int32_t exprTreeValidateExprNode(tExprNode *pExpr) {
pExpr->_node.pLeft->pVal->nLen = 8;
break;
case TSDB_DATA_TYPE_UTINYINT:
if (uVal > 128) {
if (uVal > 255) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
pExpr->_node.pLeft->pVal->nLen = 1;
break;
case TSDB_DATA_TYPE_USMALLINT:
if (uVal > 65536) {
if (uVal > 65535) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
pExpr->_node.pLeft->pVal->nLen = 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册