You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by kr...@apache.org on 2007/01/24 08:51:43 UTC

svn commit: r499299 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ParserImpl.java

Author: kristwaa
Date: Tue Jan 23 23:51:42 2007
New Revision: 499299

URL: http://svn.apache.org/viewvc?view=rev&rev=499299
Log:
DERBY-2103: (workaround) After a Lexical Error due to syntax error, even a simple create table does not work on the same connection.

Patch contributed by Mayuresh Nirhali.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ParserImpl.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ParserImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ParserImpl.java?view=diff&rev=499299&r1=499298&r2=499299
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ParserImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ParserImpl.java Tue Jan 23 23:51:42 2007
@@ -156,6 +156,15 @@
 		}
 		catch (TokenMgrError e)
 		{
+			// Derby - 2103.
+			// When the exception occurs cachedParser may live with
+			// some flags set inappropriately that may cause Exception
+			// in the subsequent compilation. This seems to be a javacc bug.
+			// Issue Javacc-152 has been raised.
+			// As a workaround, the cachedParser object is cleared to ensure
+			// that the exception does not have any side effect.
+			// TODO : Remove the following line if javacc-152 is fixed.
+			cachedParser = null;
 		    throw StandardException.newException(SQLState.LANG_LEXICAL_ERROR, e.getMessage());
 		}
 	}