cherrylzhao opened a new issue #5386:
URL: https://github.com/apache/shardingsphere/issues/5386
## Bug Report
### Which version of ShardingSphere did you use?
\> 4.0.0
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
sharding-proxy
### Expected behavior
succeed getIndexInfo through metadata, code is as below
``` java
@Test
public void assertProxy() throws SQLException {
Connection connection =
DriverManager.getConnection("jdbc:postgresql://localhost:3307/sharding_db?user=root&password=root");
ResultSet resultSet = connection.getMetaData().getIndexInfo(null,
null, "t_order", false, true);
while (resultSet.next()) {
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
System.out.println(String.format("%s: %s",
resultSetMetaData.getColumnLabel(i), resultSet.getObject(i)));
}
}
}
```
### Actual behavior
```
org.postgresql.util.PSQLException: ERROR: column am.amcanorder does not exist
Position: 427
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at
org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:224)
at
org.postgresql.jdbc.PgDatabaseMetaData.getIndexInfo(PgDatabaseMetaData.java:2401)
at
org.apache.shardingsphere.example.transaction.xa.raw.jdbc.ProxyTest.assertProxy(ProxyTest.java:34)
```
### Reason analyze (If you can)
it seems sharding-proxy could not compatible with postgresql greater than
9.4, maybe we should enhance handshake packet
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
1. start the proxy, test it using above code
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]