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

insertRow() and updateRow() fail with syntax error when column has an alias

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.2.1.6
    • Fix Version/s: 10.13.1.0
    • Component/s: JDBC
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached

      Description

      When the select query used in an updatable result set has column aliases, a syntax error is thrown when executing ResultSet.insertRow() and ResultSet.updateRow(). The problem is seen on embedded and client. Repro is attached.

      Exception in thread "main" ERROR 42X14: 'A1' is not a column in table or VTI 'APP.T'.
      at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:316)
      at org.apache.derby.impl.sql.compile.ResultColumn.bindResultColumnByName(ResultColumn.java:677)
      at org.apache.derby.impl.sql.compile.ResultColumnList.bindResultColumnsByName(ResultColumnList.java:682)
      at org.apache.derby.impl.sql.compile.ResultSetNode.bindResultColumns(ResultSetNode.java:683)
      at org.apache.derby.impl.sql.compile.SelectNode.bindResultColumns(SelectNode.java:742)
      at org.apache.derby.impl.sql.compile.UpdateNode.bind(UpdateNode.java:349)
      at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:345)
      at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:111)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:723)
      at org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3734)
      at Alias.main(Alias.java:15)

        Attachments

        1. anyVsAll.diff
          8 kB
          Bryan Pendleton
        2. ASF.LICENSE.NOT.GRANTED--Alias.java
          0.6 kB
          Knut Anders Hatlen
        3. fixedComments.diff
          8 kB
          Bryan Pendleton
        4. NoUpdatesToAliasedColumnsWithTest.diff
          7 kB
          Bryan Pendleton
        5. updatedToHeadMarch2010.diff
          7 kB
          Bryan Pendleton
        6. updatedToHeadMarch2016.diff
          7 kB
          Bryan Pendleton

          Issue Links

            Activity

              People

              • Assignee:
                bryanpendleton Bryan Pendleton
                Reporter:
                knutanders Knut Anders Hatlen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: