Skip to content

Commit d066d4a

Browse files
committed
fix test
1 parent 02859d4 commit d066d4a

3 files changed

Lines changed: 3 additions & 38 deletions

File tree

modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/LogicalRelImplementorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private void checkIndexFirstOrLastRewriter(boolean first) {
196196
node = relImplementor.visit(idxScan);
197197

198198
assertTrue(node instanceof SortNode);
199-
assertEquals(1, (int)U.field(node, "limit"));
199+
assertEquals(1L, (long)U.field(node, "limit"));
200200
assertTrue(node.sources() != null && node.sources().size() == 1);
201201
assertTrue(node.sources().get(0) instanceof ScanNode);
202202
}

modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/LimitOffsetIntegrationTest.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717

1818
package org.apache.ignite.internal.processors.query.calcite.integration;
1919

20-
import java.math.BigDecimal;
2120
import java.util.Arrays;
2221
import java.util.List;
23-
import org.apache.calcite.sql.validate.SqlValidatorException;
2422
import org.apache.ignite.IgniteCache;
2523
import org.apache.ignite.cache.CacheMode;
2624
import org.apache.ignite.cache.QueryEntity;
2725
import org.apache.ignite.configuration.IgniteConfiguration;
28-
import org.apache.ignite.internal.processors.query.IgniteSQLException;
2926
import org.apache.ignite.internal.processors.query.calcite.exec.rel.AbstractNode;
3027
import org.apache.ignite.internal.util.typedef.F;
3128
import org.apache.ignite.internal.util.typedef.X;
@@ -101,40 +98,6 @@ public void testNestedLimitOffsetWithUnion() {
10198
).returns(2).returns(4).check();
10299
}
103100

104-
/** Tests correctness of fetch / offset params. */
105-
@Test
106-
public void testInvalidLimitOffset() {
107-
String bigInt = BigDecimal.valueOf(10000000000L).toString();
108-
109-
assertThrows("SELECT * FROM TEST_REPL OFFSET " + bigInt + " ROWS",
110-
SqlValidatorException.class, "Illegal value of offset");
111-
112-
assertThrows("SELECT * FROM TEST_REPL FETCH FIRST " + bigInt + " ROWS ONLY",
113-
SqlValidatorException.class, "Illegal value of fetch / limit");
114-
115-
assertThrows("SELECT * FROM TEST_REPL LIMIT " + bigInt,
116-
SqlValidatorException.class, "Illegal value of fetch / limit");
117-
118-
assertThrows("SELECT * FROM TEST_REPL OFFSET -1 ROWS FETCH FIRST -1 ROWS ONLY",
119-
IgniteSQLException.class, null);
120-
121-
assertThrows("SELECT * FROM TEST_REPL OFFSET -1 ROWS",
122-
IgniteSQLException.class, null);
123-
124-
assertThrows("SELECT * FROM TEST_REPL OFFSET 2+1 ROWS",
125-
IgniteSQLException.class, null);
126-
127-
// Check with parameters
128-
assertThrows("SELECT * FROM TEST_REPL OFFSET ? ROWS FETCH FIRST ? ROWS ONLY",
129-
SqlValidatorException.class, "Illegal value of fetch / limit", -1, -1);
130-
131-
assertThrows("SELECT * FROM TEST_REPL OFFSET ? ROWS",
132-
SqlValidatorException.class, "Illegal value of offset", -1);
133-
134-
assertThrows("SELECT * FROM TEST_REPL FETCH FIRST ? ROWS ONLY",
135-
SqlValidatorException.class, "Illegal value of fetch / limit", -1);
136-
}
137-
138101
/**
139102
*
140103
*/

modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/DynamicParametersPlannerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,7 @@ public void testLimitOffset() throws Exception {
6666

6767
checkStatement(setup).sql("SELECT * FROM t1 OFFSET ? ROWS", (Object)null).fails(
6868
"Incorrect type of a dynamic parameter. Expected <BIGINT> but got <null>");
69+
70+
checkStatement(setup).sql("SELECT * FROM TEST_REPL OFFSET 2+? ROWS", 1).fails("Encountered \"+\"");
6971
}
7072
}

0 commit comments

Comments
 (0)