zstan commented on code in PR #5479:
URL: https://github.com/apache/ignite-3/pull/5479#discussion_r2021232515


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DynamicParametersTest.java:
##########
@@ -724,12 +724,12 @@ public Stream<DynamicTest> testLimitOffset() {
 
                 checkStatement(setup)
                         .sql("SELECT * FROM t1 LIMIT ?", Unspecified.UNKNOWN)
-                        .parameterTypes(nullable(NativeTypes.INT32))
+                        .parameterTypes(nullable(NativeTypes.INT64))
                         .ok(),
 
                 checkStatement(setup)
                         .sql("SELECT * FROM t1 LIMIT ?", "a")
-                        .fails("Incorrect type of a dynamic parameter. 
Expected <INTEGER> but got <VARCHAR"),
+                        .fails("Incorrect type of a dynamic parameter. 
Expected <DECIMAL> but got <VARCHAR>"),

Review Comment:
   miss it, fixed



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/LogicalRelImplementor.java:
##########
@@ -1168,6 +1154,21 @@ private static boolean canFuseProjectionInto(RelNode 
rel) {
         return joinProjection;
     }
 
+    private long validateAndGetFetchOffsetParams(RexNode node, String op) {
+        SqlScalar<RowT, Number> sqlScalar = expressionFactory.scalar(node);
+        Number offset = sqlScalar.get(ctx);
+
+        if (offset instanceof BigDecimal) {
+            BigDecimal offset0 = (BigDecimal) offset;
+            if (offset0.signum() == -1 || offset0.compareTo(LIMIT_UPPER) > 0) {
+                throw new SqlException(Sql.STMT_VALIDATION_ERR,
+                        "Illegal value of " + op + ". The value must be 
positive and less than (" + Long.MAX_VALUE + ")");

Review Comment:
   done



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to