[ 
https://issues.apache.org/jira/browse/IGNITE-2455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167055#comment-15167055
 ] 

Andrey Gura commented on IGNITE-2455:
-------------------------------------

Because schema for cache registers during cache start only (see usages of 
{{org.apache.ignite.internal.processors.query.GridQueryProcessor#onCacheStart}})
 H2 SQL parser can't find schema from query ({{cache2}} in our case) and fails.

{noformat}
Caused by: org.h2.jdbc.JdbcSQLException: Схема "cache2" не найдена
Schema "cache2" not found; SQL statement:
select i1._val, i2._val from Integer i1 cross join "cache2".Integer i2 
[90079-175]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
        at org.h2.message.DbException.get(DbException.java:172)
        at org.h2.message.DbException.get(DbException.java:149)
        at org.h2.command.Parser.getSchema(Parser.java:637)
        at org.h2.command.Parser.getSchema(Parser.java:644)
        at org.h2.command.Parser.readTableFilter(Parser.java:1156)
        at org.h2.command.Parser.readJoin(Parser.java:1504)
        at org.h2.command.Parser.parseJoinTableFilter(Parser.java:1819)
        at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1814)
        at org.h2.command.Parser.parseSelectSimple(Parser.java:1921)
        at org.h2.command.Parser.parseSelectSub(Parser.java:1807)
        at org.h2.command.Parser.parseSelectUnion(Parser.java:1631)
        at org.h2.command.Parser.parseSelect(Parser.java:1619)
        at org.h2.command.Parser.parsePrepared(Parser.java:426)
        at org.h2.command.Parser.parse(Parser.java:298)
        at org.h2.command.Parser.parse(Parser.java:270)
        at org.h2.command.Parser.prepareCommand(Parser.java:235)
        at org.h2.engine.Session.prepareLocal(Session.java:436)
        at org.h2.engine.Session.prepareCommand(Session.java:379)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1138)
        at 
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:70)
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:267)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatement(IgniteH2Indexing.java:351)
        at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:1040)
        ... 16 more
{noformat}

> SQL query fails if there are caches that were never used on this client
> -----------------------------------------------------------------------
>
>                 Key: IGNITE-2455
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2455
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>            Reporter: Valentin Kulichenko
>            Assignee: Sergi Vladykin
>            Priority: Critical
>              Labels: important
>             Fix For: 1.6
>
>         Attachments: QueryTest.java
>
>
> Test attached.
> If SQL query contains caches that were never acquired on the current client, 
> it fails with the following exception:
> {noformat}
> org.h2.jdbc.JdbcSQLException: Schema "cache2" not found;
> {noformat}
> We should automatically detect the list of required caches and create them 
> before executing the query.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to