You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fox (JIRA)" <ji...@apache.org> on 2014/09/26 03:01:33 UTC

[jira] [Updated] (TORQUE-330) Postgresql fails for some prepared statement replacement types (short, double ...)

     [ https://issues.apache.org/jira/browse/TORQUE-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Fox updated TORQUE-330:
------------------------------
          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.

  was:
When executing a SQL statement with some prepared statement replacement types (short, double ...), 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.

    Affects Version/s:     (was: 4.0)

> Postgresql fails for some prepared statement replacement types (short, double ...)
> ----------------------------------------------------------------------------------
>
>                 Key: TORQUE-330
>                 URL: https://issues.apache.org/jira/browse/TORQUE-330
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>         Environment: postgresql
>            Reporter: Thomas Fox
>            Assignee: Thomas Fox
>             Fix For: 4.1
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org