[ 
https://issues.apache.org/jira/browse/DERBY-2103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465742
 ] 

Mayuresh Nirhali commented on DERBY-2103:
-----------------------------------------

I figured that there is a better way to fix this issue by cleaning up the 
cachedParser object, (only) in case of Exception. This ensures that for 
subsequent compilation a clean Parser object is populated. This approach does 
not touch the sql grammer code. The bug is a side affect of caching the parser 
for the subsequent compilations and hence it makes sense to fix that in the 
SqlParserImpl instead of changes to grammer.

Derbyall runs fine without any errors... This patch is ready for review.

Thanks

> After a Lexical Error due to syntax error ,    even a simple create table 
> does not work  on the same connection.
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2103
>                 URL: https://issues.apache.org/jira/browse/DERBY-2103
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.3.0.0
>            Reporter: Suresh Thalamati
>         Assigned To: Mayuresh Nirhali
>            Priority: Minor
>             Fix For: 10.2.3.0
>
>         Attachments: derby2103.diff
>
>
> connect 'jdbc:derby:wombat;create=true';
> create table t1(a int ) ;
> create table "t2"(a int ) ;
> -- this should fail. 
> create table foo (a int ,  \"YEAR\" int ) ;
> -- but this should not fail. But failing
> create table t4 ( b int ) ;
> FYI:
> $ java org.apache.derby.tools.ij
> ij version 10.3
> ij> run 'weird1.sql';
> ij> connect 'jdbc:derby:wombat;create=true';
> ij> create table t1(a int ) ;
> 0 rows inserted/updated/deleted
> ij> create table "t2"(a int ) ;
> 0 rows inserted/updated/deleted
> ij> -- this should fail.
> create table foo (a int ,  \"YEAR\" int ) ;
> ERROR 42X02: Lexical error at line 2, column 28.  Encountered: "\\" (92), 
> after
> : "".
> ij> -- but this should not fail. But failing
> create table t4 ( b int ) ;
> ERROR 42X01: Syntax error: Encountered "" at line 2, column 21.
> ij>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to