Repository: ignite Updated Branches: refs/heads/ignite-1282 0b4a8f831 -> a7b22f838
ignite-1282 - test added Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a7b22f83 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a7b22f83 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a7b22f83 Branch: refs/heads/ignite-1282 Commit: a7b22f8387c95931b0aa407eb951b9d2bc54c33c Parents: 0b4a8f8 Author: S.Vladykin <svlady...@gridgain.com> Authored: Wed Nov 18 20:08:02 2015 +0300 Committer: S.Vladykin <svlady...@gridgain.com> Committed: Wed Nov 18 20:08:02 2015 +0300 ---------------------------------------------------------------------- .../query/IgniteSqlSplitterSelfTest.java | 54 ++++++++++++++++++++ 1 file changed, 54 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/a7b22f83/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java index 75112fd..0868fe6 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java @@ -227,6 +227,39 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest { } /** + * + */ + public void testFunctionNpe() { + // TODO IGNITE-1886 + IgniteCache<Integer, User> userCache = ignite(0).createCache( + cacheConfig("UserCache", true, Integer.class, User.class)); + IgniteCache<Integer, UserOrder> userOrderCache = ignite(0).createCache( + cacheConfig("UserOrderCache", true, Integer.class, UserOrder.class)); + IgniteCache<Integer, OrderGood> orderGoodCache = ignite(0).createCache( + cacheConfig("OrderGoodCache", true, Integer.class, OrderGood.class)); + + try { + String sql = + "SELECT a.* FROM (" + + "SELECT CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id " + + "FROM \"UserCache\".User u, UserOrder ug " + + "WHERE u.id = ug.userId" + + ") a, (" + + "SELECT CASE WHEN og.goodId < 5 THEN 100 ELSE og.goodId END id " + + "FROM UserOrder ug, \"OrderGoodCache\".OrderGood og " + + "WHERE ug.id = og.orderId) b " + + "WHERE a.id = b.id"; + + userOrderCache.query(new SqlFieldsQuery(sql)).getAll(); + } + finally { + userCache.destroy(); + userOrderCache.destroy(); + orderGoodCache.destroy(); + } + } + + /** * Test value. */ private static class GroupIndexTestValue implements Serializable { @@ -245,4 +278,25 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest { this.b = b; } } + + private static class User implements Serializable { + @QuerySqlField + private int id; + } + + private static class UserOrder implements Serializable { + @QuerySqlField + private int id; + + @QuerySqlField + private int userId; + } + + private static class OrderGood implements Serializable { + @QuerySqlField + private int orderId; + + @QuerySqlField + private int goodId; + } } \ No newline at end of file