zstan commented on code in PR #5479:
URL: https://github.com/apache/ignite-3/pull/5479#discussion_r2015671852
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##########
@@ -700,34 +700,48 @@ private void checkIntegerLimit(@Nullable SqlNode n,
String nodeName) {
}
if (n instanceof SqlLiteral) {
- BigDecimal offFetchLimit = ((SqlLiteral) n).bigDecimalValue();
+ BigDecimal offsetFetchLimit = ((SqlLiteral) n).bigDecimalValue();
- if (offFetchLimit.compareTo(DEC_INT_MAX) > 0 ||
offFetchLimit.compareTo(BigDecimal.ZERO) < 0) {
- throw newValidationError(n,
IgniteResource.INSTANCE.correctIntegerLimit(nodeName));
- }
+ checkLimitOffset(offsetFetchLimit, n, nodeName);
} else if (n instanceof SqlDynamicParam) {
SqlDynamicParam dynamicParam = (SqlDynamicParam) n;
- RelDataType intType = typeFactory.createSqlType(INTEGER);
+ RelDataType dynParamType =
typeFactory.createSqlType(SqlTypeName.BIGINT);
// Validate value, if present.
if (!isUnspecified(dynamicParam)) {
Object param = getDynamicParamValue(dynamicParam);
- if (param instanceof Integer) {
- if ((Integer) param < 0) {
- throw newValidationError(n,
IgniteResource.INSTANCE.correctIntegerLimit(nodeName));
- }
+ if (param == null) {
+ throw newValidationError(n,
IgniteResource.INSTANCE.illegalFetchLimit(nodeName));
+ }
+
+ if (param instanceof BigDecimal) {
+ checkLimitOffset((BigDecimal) param, n, nodeName);
Review Comment:
got it, move into execution phase
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]