Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4338

Network client raises error "executeQuery method can not be used for update" when sql is preceded by /* */ comments

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0
    • 10.4.2.1, 10.5.3.1, 10.6.1.0
    • Network Client
    • None
    • Normal
    • Newcomer
    • Embedded/Client difference

    Description

      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.

      Attachments

        1. derby-4338-d.stat
          0.1 kB
          Dag H. Wanvik
        2. derby-4338-d.diff
          13 kB
          Dag H. Wanvik
        3. derby-4338-c.stat
          0.1 kB
          Dag H. Wanvik
        4. derby-4338-c.diff
          12 kB
          Dag H. Wanvik
        5. derby-4338-b.stat
          0.1 kB
          Dag H. Wanvik
        6. derby-4338-b.diff
          10 kB
          Dag H. Wanvik
        7. derby-4338-a.stat
          0.1 kB
          Dag H. Wanvik
        8. derby-4338-a.diff
          10 kB
          Dag H. Wanvik

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dagw Dag H. Wanvik
            wgomes Will Gomes
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment