You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
I will add, delete, modify, and check a single table
I will JOIN QUERY with two tables
Actual behavior
SQL execution of a single table without any exceptions
actualDataNodes Automatically loaded
I will JOIN QUERY with two tables with An exception has occurred
I query tenant_id = 2
By viewing the print below ,actualDataNodeshas been dynamically loaded
collection = [t_order_item, t_order_item_2]
2023-10-09 10:52:30.803 ERROR 11916 --- [io-9500-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:
### Error querying database. Cause: java.sql.SQLException: Actual table `testApp.t_order_item_2` is not in table rule configuration.
### The error may exist in file [E:\hc-cloud\hc_cloud_app_test\target\classes\mapper\OrderMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT o.order_no, SUM(i.price * i.count) AS amount FROM t_order o JOIN t_order_item i ON o.order_no = i.order_no where o.tenant_id = ? and i.tenant_id = ? GROUP BY o.order_no limit ?,?
### Cause: java.sql.SQLException: Actual table `testApp.t_order_item_2` is not in table rule configuration.
; Actual table `testApp.t_order_item_2` is not in table rule configuration.; nested exception is java.sql.SQLException: Actual table `testApp.t_order_item_2` is not in table rule configuration.] with root cause
java.sql.SQLException: Actual table `testApp.t_order_item_2` is not in table rule configuration.
at org.apache.shardingsphere.infra.util.exception.external.sql.ShardingSphereSQLException.toSQLException(ShardingSphereSQLException.java:62) ~[shardingsphere-infra-util-5.3.2.jar:5.3.2]
at org.apache.shardingsphere.dialect.SQLExceptionTransformEngine.toSQLException(SQLExceptionTransformEngine.java:51) ~[shardingsphere-dialect-exception-core-5.3.2.jar:5.3.2]
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:448) ~[shardingsphere-jdbc-core-5.3.2.jar:5.3.2]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-4.0.3.jar:na]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) ~[mybatis-3.5.10.jar:3.5.10]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.10.jar:3.5.10]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ~[mybatis-spring
But if I start configuring it
After execution, there will be no exceptions
But this actualDataNodes is the same as the previous method
Reason analyze (If you can)
The text was updated successfully, but these errors were encountered:
Bug Report
I used a single database sharding tables use local transaction mode
I have configured some tables
t_member
t_order
t_order_time
t_product
What I designed is Automatically split tableStrategy by
tenant_id
this is my configuration
sharding.yaml
Which version of ShardingSphere did you use?
shardingsphere-jdbc 5.3.2 + JDK 17 + spring-boot 2.7.14
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
JOIN QUERY
with two tablesActual behavior
actualDataNodes Automatically loaded
JOIN QUERY
with two tables with An exception has occurredI query
tenant_id = 2
By viewing the print below ,actualDataNodeshas been dynamically loaded
But if I start configuring it
After execution, there will be no exceptions
But this
actualDataNode
s is the same as the previous methodReason analyze (If you can)
The text was updated successfully, but these errors were encountered: