carlors opened a new issue, #33347:
URL: https://github.com/apache/shardingsphere/issues/33347

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   5.1.2
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   Execute select statement and return query result successfully when I query 
the sharding tables.
   ### Actual behavior
   The ShardingSphere-JDBC return an error:
   org.mybatis.spring.MyBatisSystemException: nested exception is 
org.apache.ibatis.exceptions.PersistenceException: 
   Error querying database.  Cause: java.lang.NullPointerException
   The error occurred while handling results
   SQL: select                      id, uid, status,ctime from table_name       
                  WHERE uid =?   order by ctime desc;
   Cause: java.lang.NullPointerException
   at 
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97)
   at 
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)
   at com.sun.proxy.$Proxy356.selectList(Unknown Source)
   at 
org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
   at 
org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
   at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
   at 
org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145)
   at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
   at com.sun.proxy.$Proxy406.selectByExample(Unknown Source)
   ### Reason analyze (If you can)
   The ShardingSphere-JDBC can not get shard table's meta information for aws 
aurora postgresql 14.11 version when the db user is not same with the table 
owner.Since everything works well with postgresql 12.8 before I upgrade the db 
to postgresql 14.11 version.
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   1.Create one aws aurora postgresql cluster which engine version is 14.11,and 
create two database db1 and db2;
   2.Create a table both in db1 and db2, change the table owner to user2;
   alter table owner to user2;
   3.Set  ShardingSphere-JDBC db user as user1
   ```yaml
   dataSources:
     ds_0:
       url: 
jdbc:postgresql://xxx.cluster-ckcvjkzxh8bd.ap-northeast-1.rds.amazonaws.com:5432/db1?prepareThreshold=0
       username: user1
       password: user1password
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: 
jdbc:postgresql://xxx.cluster-ckcvjkzxh8bd.ap-northeast-1.rds.amazonaws.com:5432/db2?prepareThreshold=0
       username: user1
       password: user1password
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   ```
   4.Config table shard rule the same as offcial example and start the 
application and execute the query.
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to