Open TeslaCN opened 1 year ago
This issue could be temporarily avoided by casting money to varchar. The following code worked for latest Proxy.
try (PreparedStatement preparedStatement = connection.prepareStatement("select ?::money::varchar")) {
preparedStatement.setObject(1, "-92233720368547758.08");
try (ResultSet resultSet = preparedStatement.executeQuery()) {
resultSet.next();
System.out.println(resultSet.getString(1));
}
}
Bug Report
Which version of ShardingSphere did you use?
master - a4c01712aba7f17f3f4fe8264aaf4c19cb572432
This issue may affect all version of ShardingSphere-Proxy.
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy PostgreSQL
Expected behavior
Query worked.
Expected output:
Actual behavior
Client:
Proxy log:
Reason analyze (If you can)
Proxy using
getObject
to retrieve value, whilemoney
type should be retrieve bygetString
.https://github.com/apache/shardingsphere/blob/a4c01712aba7f17f3f4fe8264aaf4c19cb572432/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/DatabaseCommunicationEngine.java#L348
PostgreSQL JDBC related issue: https://github.com/pgjdbc/pgjdbc/issues/425
Example codes for reproduce this issue (such as a github link).
The following code worked if connected to PostgreSQL directly.