If you take a look at QueryParser#parseH2 then you can see the following statement:

 

catch (IgniteCheckedException | SQLException e) {
   
throw new IgniteSQLException("Failed to parse query. " + e.getMessage(), IgniteQueryErrorCode.PARSING, e);
}

 

So any exception on this stage will be considered as a Parsing.

I think it’s ok to translate an h2 exception, say TABLE_OR_VIEW_NOT_FOUND_1 = 42102 into SqlStateCode.

I will check JIRA for that.

 

From: DS
Sent: Monday, November 18, 2019 3:42 PM
To: user@ignite.apache.org
Subject: IgniteSQLException

 

    catch (Exception e) {

      ///System.out.println(superCache.err);

      if (e instanceof CacheException) {

        IgniteSQLException sqLEx = X.cause(e, IgniteSQLException.class);

        System.out.println(">>>>> statusCode " + sqLEx.statusCode());

    }

 

 

I am trying to fetch the exact string for the sql statusCode.

But i am getting statusCode :1001 (parsing error ) for both wrong SQL syntax

and table does not exist(3001).

 

>>>>P.S

I am trying to understand how SQL error works. and how to caputure precise

string for particular statusCode.

eg :

 

CACHE_NOT_FOUND                  4006

COLUMN_ALREADY_EXISTS    3009

 

 

 

 

--

Sent from: http://apache-ignite-users.70518.x6.nabble.com/

 

Reply via email to