You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "James F. Adams (JIRA)" <ji...@apache.org> on 2007/11/18 20:26:43 UTC

[jira] Updated: (DERBY-3157) Lexical error (EOF) when comment consists of a single character

     [ https://issues.apache.org/jira/browse/DERBY-3157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James F. Adams updated DERBY-3157:
----------------------------------

    Attachment: DERBY-3157.diff

Attached patch proposal DERBY-3157.diff for review.

I simplified the processing of end of line comments in order to correct certain termination conditions.  A few addtional tests were added.

Running derbyall and suites.All.

> Lexical error (EOF) when comment consists of a single character
> ---------------------------------------------------------------
>
>                 Key: DERBY-3157
>                 URL: https://issues.apache.org/jira/browse/DERBY-3157
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.1.4, 10.4.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: James F. Adams
>            Priority: Minor
>         Attachments: DERBY-3157.diff
>
>
> The following statement fails with an SQLException. Adding whitespace or other characters at the end of the comment makes it pass. Adding more whitespace at the beginning of the comment doesn't help.
> PreparedStatement ps = c.prepareStatement("VALUES 1 -- x");
> Exception in thread "main" java.sql.SQLSyntaxErrorException: Lexical error at line 1, column 14.  Encountered: <EOF> after : "".
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
> 	at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> 	at comment.main(comment.java:5)
> Caused by: java.sql.SQLException: Lexical error at line 1, column 14.  Encountered: <EOF> after : "".
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
> 	... 14 more
> Caused by: ERROR 42X02: Lexical error at line 1, column 14.  Encountered: <EOF> after : "".
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
> 	... 8 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.