You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/05/31 08:02:27 UTC

[GitHub] [shardingsphere] totalo opened a new issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

totalo opened a new issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   5.0.0-RC1-SNAPSHOT
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   Complete the example as normal
   
   ### Actual behavior
   
   can not found thar right table name.
   
   sharding-spring-boot-jpa-example test failed.
   
   ```
   Exception in thread "main" org.springframework.orm.jpa.JpaSystemException: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet
   	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333)
   	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
   	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:525)
   	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
   	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:209)
   	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
   	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
   	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
   	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
   	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
   	at org.apache.shardingsphere.example.core.jpa.repository.OrderItemRepositoryImpl$$EnhancerBySpringCGLIB$$d7c3426d.selectAll(<generated>)
   	at org.apache.shardingsphere.example.core.jpa.service.OrderServiceImpl.printData(OrderServiceImpl.java:117)
   	at org.apache.shardingsphere.example.core.jpa.service.OrderServiceImpl.processSuccess(OrderServiceImpl.java:68)
   	at org.apache.shardingsphere.example.core.jpa.service.OrderServiceImpl$$FastClassBySpringCGLIB$$aa0a1797.invoke(<generated>)
   	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
   	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
   	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
   	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
   	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
   	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
   	at org.apache.shardingsphere.example.core.jpa.service.OrderServiceImpl$$EnhancerBySpringCGLIB$$f202c2d8.processSuccess(<generated>)
   	at org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate.run(ExampleExecuteTemplate.java:29)
   	at org.apache.shardingsphere.example.sharding.spring.boot.jpa.ExampleMain.main(ExampleMain.java:38)
   Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
   	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
   	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
   	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
   	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91)
   	at org.hibernate.loader.Loader.getResultSet(Loader.java:2066)
   	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863)
   	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839)
   	at org.hibernate.loader.Loader.doQuery(Loader.java:910)
   	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355)
   	at org.hibernate.loader.Loader.doList(Loader.java:2554)
   	at org.hibernate.loader.Loader.doList(Loader.java:2540)
   	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370)
   	at org.hibernate.loader.Loader.list(Loader.java:2365)
   	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:497)
   	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387)
   	at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:236)
   	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1300)
   	at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)
   	at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573)
   	at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449)
   	at org.apache.shardingsphere.example.core.jpa.repository.OrderItemRepositoryImpl.selectAll(OrderItemRepositoryImpl.java:68)
   	at org.apache.shardingsphere.example.core.jpa.repository.OrderItemRepositoryImpl$$FastClassBySpringCGLIB$$87f5d9fe.invoke(<generated>)
   	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
   	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
   	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
   	... 21 more
   Caused by: java.sql.SQLException: Error while preparing statement [select orderiteme1_.order_item_id as order_it1_2_, orderiteme1_.order_id as order_id2_2_, orderiteme1_.status as status3_2_, orderiteme1_.user_id as user_id4_2_ from t_order orderentit0_ cross join t_order_item orderiteme1_ where orderentit0_.order_id=orderiteme1_.order_id]
   	at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
   	at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement_(CalciteConnectionImpl.java:220)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement(CalciteConnectionImpl.java:202)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement(CalciteConnectionImpl.java:93)
   	at org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:175)
   	at org.apache.shardingsphere.infra.executor.sql.optimize.execute.CalciteJDBCExecutor.execute(CalciteJDBCExecutor.java:85)
   	at org.apache.shardingsphere.infra.executor.sql.optimize.execute.CalciteJDBCExecutor.executeQuery(CalciteJDBCExecutor.java:68)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQueryByCalcite(ShardingSpherePreparedStatement.java:218)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery0(ShardingSpherePreparedStatement.java:204)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery(ShardingSpherePreparedStatement.java:181)
   	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:82)
   	... 43 more
   Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, column 244 to line 1, column 251: Column 'order_id' not found in table 'orderentit0_'
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:467)
   	at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:883)
   	at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:868)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5043)
   	at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:439)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl$Expander.visit(SqlValidatorImpl.java:6015)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl$Expander.visit(SqlValidatorImpl.java:6000)
   	at org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:320)
   	at org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild(SqlShuttle.java:134)
   	at org.apache.calcite.sql.util.SqlShuttle$CallCopyingArgHandler.visitChild(SqlShuttle.java:101)
   	at org.apache.calcite.sql.SqlOperator.acceptCall(SqlOperator.java:879)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl$Expander.visitScoped(SqlValidatorImpl.java:6033)
   	at org.apache.calcite.sql.validate.SqlScopedShuttle.visit(SqlScopedShuttle.java:50)
   	at org.apache.calcite.sql.validate.SqlScopedShuttle.visit(SqlScopedShuttle.java:33)
   	at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:139)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.expand(SqlValidatorImpl.java:5609)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereClause(SqlValidatorImpl.java:4123)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3464)
   	at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
   	at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1067)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1041)
   	at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1016)
   	at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:724)
   	at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:567)
   	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:242)
   	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:208)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:642)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:508)
   	at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:478)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:231)
   	at org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement_(CalciteConnectionImpl.java:213)
   	... 52 more
   Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Column 'order_id' not found in table 'orderentit0_'
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:467)
   	at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:560)
   	... 84 more
   ```
   
   ##### sharding-spring-boot-mybatis-example test failed
   
   ```
   Exception in thread "main" org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   ### The error may exist in META-INF/mappers/OrderItemMapper.xml
   ### The error may involve org.apache.shardingsphere.example.core.mybatis.repository.MybatisOrderItemRepository.selectAll
   ### The error occurred while handling results
   ### SQL: SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id;
   ### Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:79)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
   	at com.sun.proxy.$Proxy153.selectList(Unknown Source)
   	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:231)
   	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)
   	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)
   	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
   	at com.sun.proxy.$Proxy155.selectAll(Unknown Source)
   	at org.apache.shardingsphere.example.core.mybatis.service.OrderServiceImpl.printData(OrderServiceImpl.java:129)
   	at org.apache.shardingsphere.example.core.mybatis.service.OrderServiceImpl.processSuccess(OrderServiceImpl.java:80)
   	at org.apache.shardingsphere.example.core.mybatis.service.OrderServiceImpl$$FastClassBySpringCGLIB$$bc37129f.invoke(<generated>)
   	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
   	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
   	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
   	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
   	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
   	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
   	at org.apache.shardingsphere.example.core.mybatis.service.OrderServiceImpl$$EnhancerBySpringCGLIB$$dc763e5d.processSuccess(<generated>)
   	at org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate.run(ExampleExecuteTemplate.java:29)
   	at org.apache.shardingsphere.example.sharding.spring.boot.mybatis.ExampleMain.main(ExampleMain.java:38)
   Caused by: org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   ### The error may exist in META-INF/mappers/OrderItemMapper.xml
   ### The error may involve org.apache.shardingsphere.example.core.mybatis.repository.MybatisOrderItemRepository.selectAll
   ### The error occurred while handling results
   ### SQL: SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id;
   ### Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
   	... 20 more
   Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   	at java.util.ArrayList.rangeCheck(ArrayList.java:659)
   	at java.util.ArrayList.get(ArrayList.java:435)
   	at org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger.merge(ShardingDQLResultMerger.java:60)
   	at org.apache.shardingsphere.infra.merge.MergeEngine.executeMerge(MergeEngine.java:87)
   	at org.apache.shardingsphere.infra.merge.MergeEngine.merge(MergeEngine.java:77)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.mergeQuery(ShardingSpherePreparedStatement.java:381)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.getResultSet(ShardingSpherePreparedStatement.java:329)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getFirstResultSet(DefaultResultSetHandler.java:230)
   	at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:180)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
   	... 26 more
   ```
   
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] totalo removed a comment on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo removed a comment on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857543741


   > Hi @totalo  I did not know whether my email reaches out to you or not. If you do not mind getting in touch with Wechat, could you give a look at your QQ mailbox?
   
   I checked, but I didn't get any mail.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857268668


   But my test case is OK, did you modify the SQL?


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857619618


   > But my test case is OK, did you modify the SQL?
   
   Sorry for being late.I modified selectAll in OrderItemMapper.xml from `SELECT * from t_order_item` to `SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id;`, and then an exception occurred.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-855748291


   ![image](https://user-images.githubusercontent.com/29777558/120989055-b8e3ae80-c7b1-11eb-87d0-172276d4c647.jpeg) the Jpa is ok,but the mybatis is still error.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-858339027


   Hello @totalo 
   I found that this is still the problem of missing tables, please check whether there are `t_order ` and `t_order_item ` in database `demo_write_ds_0` and `demo_write_ds_1`.
   
   You can try create the tables and then test again.
   
   ```
   CREATE TABLE IF NOT EXISTS demo_write_ds_0.t_order (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
   CREATE TABLE IF NOT EXISTS demo_write_ds_0.t_order_item (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
   
   CREATE TABLE IF NOT EXISTS demo_write_ds_1.t_order (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
   CREATE TABLE IF NOT EXISTS demo_write_ds_1.t_order_item (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
   ```


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857272665


   ![image](https://user-images.githubusercontent.com/5668787/121272721-467de600-c8f9-11eb-8cd2-bc487756d887.png)
   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-855418077


   Hi @totalo  @tristaZero 
   
   I tested all the scenarios and did not reproduce the problem in the description.
   - sharding-spring-boot-jpa-example
     - sharding-databases : `pass`
     - sharding-tables : `pass`
     - sharding-databases-tables : `pass`
     - readwrite-splitting : `pass`
     - sharding-readwrite-splitting: **`databases config error`**
   - sharding-spring-boot-mybatis-example
     - sharding-databases : `pass`
     - sharding-tables : `pass`
     - sharding-databases-tables : `pass`
     - readwrite-splitting : `pass`
     - sharding-readwrite-splitting : `pass`
   
   The reason @totalo  encountered the exceptions may be the missing table(s).


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-855682539


   @RaigorJiang My mistake, forgot to add todo


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-856800464


   Hi @totalo  
   Which scene got the error,  It looks like `sharding-readwrite-splitting` ?   
   
   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857543741


   > Hi @totalo  I did not know whether my email reaches out to you or not. If you do not mind getting in touch with Wechat, could you give a look at your QQ mailbox?
   
   I checked, but I didn't get any mail.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-858347080


   > Hello @totalo
   > I found that this is still the problem of missing tables, please check whether there are `t_order ` and `t_order_item ` in database `demo_write_ds_0` and `demo_write_ds_1`.
   > 
   > You can try create the tables and then test again.
   > 
   > ```
   > CREATE TABLE IF NOT EXISTS demo_write_ds_0.t_order (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
   > CREATE TABLE IF NOT EXISTS demo_write_ds_0.t_order_item (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
   > 
   > CREATE TABLE IF NOT EXISTS demo_write_ds_1.t_order (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
   > CREATE TABLE IF NOT EXISTS demo_write_ds_1.t_order_item (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
   > ```
   
   yes,I checked and found that it was because there was no table. thx


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-855677327


   @RaigorJiang  hello for this issue. You can take a look at this pr, I evaded him like the other part of the code.https://github.com/apache/shardingsphere/pull/10532/files


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857260531


   > Hi @totalo
   > Which scene got the error, It looks like `sharding-readwrite-splitting` ?
   
   yeah! it's that.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo closed issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo closed issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584


   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo edited a comment on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo edited a comment on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857619618


   > But my test case is OK, did you modify the SQL?
   
   @RaigorJiang Sorry for being late.I modified selectAll in OrderItemMapper.xml from `SELECT * from t_order_item` to `SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id;`, and then an exception occurred.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857427259


   Hi @totalo  I did not know whether my email reaches out to you or not. If you do not mind getting in touch with Wechat, could you give a look at your QQ mailbox?


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #10584: When SQL contains aliases, the table name cannot be found correctly, resulting in the corresponding column not being found

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10584:
URL: https://github.com/apache/shardingsphere/issues/10584#issuecomment-857617926


   > Hi @totalo I did not know whether my email reaches out to you or not. If you do not mind getting in touch with Wechat, could you give a look at your QQ mailbox?
   
   Get it ! I didn’t receive it on my mobile phone, but I received it on my computer.


-- 
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:
users@infra.apache.org