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

insertRow(), updateRow() and deleteRow() cannot handle table names and column names containing double quotes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.1.2.1
    • Fix Version/s: 10.2.1.6
    • Component/s: JDBC
    • Labels:
      None

      Description

      ResultSet.insertRow(), ResultSet.updateRow() and ResultSet.deleteRow() fail with syntax error if the table name or a column name contains a double quote character. The attached repro gives this stack trace:

      Exception in thread "main" java.sql.SQLSyntaxErrorException: Syntax error: Encountered "quoted" at line 1, column 24.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:137)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:72)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:203)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:380)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:345)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1378)
      at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
      at org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(EmbedResultSet.java:4342)
      at org.apache.derby.impl.jdbc.EmbedResultSet.insertRow(EmbedResultSet.java:3678)
      at QuotesInNames.main(QuotesInNames.java:15)
      Caused by: java.sql.SQLException: Syntax error: Encountered "quoted" at line 1, column 24.
      ... 11 more

        Attachments

        1. ASF.LICENSE.NOT.GRANTED--QuotesInNames.java
          0.7 kB
          Knut Anders Hatlen
        2. derby-1767.diff
          23 kB
        3. derby-1767.stat
          0.4 kB
        4. derby-1767v2.diff
          23 kB
          Fernanda Pizzorno
        5. derby-1767v2.stat
          0.4 kB
          Fernanda Pizzorno
        6. 1767-junit.diff
          3 kB
          Knut Anders Hatlen

          Activity

            People

            • Assignee:
              fernanda Fernanda Pizzorno
              Reporter:
              knutanders Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: