Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-330

Postgresql fails for some prepared statement replacement types (short, double ...)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0
    • Runtime
    • None
    • postgresql

    Description

      When executing a SQL statement with some prepared statement replacement types (short, double ...) on the current trunk version, postgresql fails with an error, e.g. ERROR: operator does not exist: smallint = character varying

      This error is caught by the test org.apache.torque.generated.peer.RetrieveByPkTest.testRetrieveByNonExistingPkMultiplePKs() in the test project.

      The reason is that in org.apache.torque.util.BasePeerImpl.setPreparedStatementReplacements(PreparedStatement, List<Object>, int) in the runtime, not all of these arguments are considered, and for unknown arguments, java.sql.PreparedStatement.setString(int, String) is used.

      The setPreparedStatementReplacements method should be changed such that also the specific setters for short, byte, float and double are used.

      Attachments

        Activity

          People

            tfischer Thomas Fox
            tfischer Thomas Fox
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: