zstan commented on code in PR #13464:
URL: https://github.com/apache/ignite/pull/13464#discussion_r3766156675


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/DynamicParametersIntegrationTest.java:
##########
@@ -216,6 +216,139 @@ public void testFractionalLimitOffset() {
         assertThrowsSqlException("SELECT id FROM person ORDER BY id OFFSET ? 
ROWS", null, BigDecimal.valueOf(-1.5));
     }
 
+    /** */
+    @Test
+    public void testInvalidFetchExpression() {
+        createAndPopulateTable();
+
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST (?) ROWS 
ONLY", null, -2);
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST (?) ROWS 
ONLY", null, -1.5);
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST (?) ROWS 
ONLY", null, NULL_RESULT);
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST (?) ROWS 
ONLY", null, bigValue());
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST (?) ROWS 
ONLY", null, "abc");
+
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST (1 + ? - 4) 
ROWS ONLY", null, 1);
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST (? - (50 - 
20)) ROWS ONLY", null, 2);
+
+        assertThrowsSqlException("SELECT * FROM PERSON FETCH FIRST SQRT(?) 
ROWS ONLY", null, 4);
+    }
+
+    /** */
+    @Test
+    public void testFetchExpression() {

Review Comment:
   Yep you are right and a can\`t force you to make it as i suggest, but it 
just like a non documented rule that tests for common cases\operands\invariants 
need to be placed there, it just more quick to check expected behavior for all 
cases in script tests than search appropriate *Integration test



-- 
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]

Reply via email to