db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (DERBY-4338) Network client raises error "executeQuery method can not be used for update" when sql is preceded by /* */ comments
Date Tue, 25 Aug 2009 03:01:59 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747198#action_12747198
] 

Dag H. Wanvik edited comment on DERBY-4338 at 8/24/09 8:01 PM:
---------------------------------------------------------------

Uploading a patch for this issue, and added test cases to CommentTest,
please review. Running regressions.

While rewriting the handling of this in the client driver, I noticed
that the client driver seems to filter away the "newline" characters:
'\n', 'r' and '\f', at least they are gone by the time the query
string is seen by the compiler.  The latter ('\f') is rejected by the
Derby compiler, which makes the client driver slightly more lenient
than the embedded driver in this regard. Probably not important, but I
thought I'd mention it.


      was (Author: dagw):
    Uploading a patch for this issue, and added test cases to CommentTest, please review.
Running regressions.

While rewriting the handling of this in the client driver, I noticed that the client driver
seems to filter away the "newline" characters: '\n', 'r' and '\f',
at least they are gone by the time the query string i see by the compiler.
The latter ('\f') is rejected by the Derby compiler, which makes the client driver slightly
more lenient than the embedded driver in this regard. Probably not important, but I thought
I'd mention it.

  
> Network client raises error "executeQuery method can not be used for update" when sql
is preceded by /* */ comments
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4338
>                 URL: https://issues.apache.org/jira/browse/DERBY-4338
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.4.2.0
>            Reporter: Will Gomes
>            Assignee: Dag H. Wanvik
>         Attachments: derby-4338-a.diff, derby-4338-a.stat
>
>
> Network derby client does not properly detect a sql select statement preceded by /* */
comments.  As a result the sql appears to be detected as an update statement, and results
in  the following error:
>  org.apache.derby.client.am.SqlException: executeQuery method can not be used for update.
> 	at org.apache.derby.client.am.Statement.checkForAppropriateSqlMode(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.executeQueryX(Unknown Source)
> The problem appears to be in Statment.parseSqlAndSetSqlModes(), which only appears to
check for "--" style comments.

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


Mime
View raw message