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

   spring:
     shardingsphere:
       datasource:
         names: ds1,ds2
         ds1:
           ...
         ds2:
           ...
       rules:
         sharding:
           tables:
             t_order:
               actual-data-nodes: ds1.t_order
               table-strategy:
                 none:
               data-strategy:
                 none:
             t_order_item:
               actual-data-nodes: ds2.t_order_item
               table-strategy:
                 none:
               data-strategy:
                 none:
       props:
         sql-show: true
         sql-federation-enabled: true
   
   
   sql:  select o.id, o.user_name, i.order_desc
                from t_order o inner join t_order_item i on o.order_id = 
i.order_id order by o.id desc limit 1,10
   ---------------------------
   exception:
   2023-05-16 09:18:54.156  INFO 22196 --- [           main] ShardingSphere-SQL 
                      : Logic SQL: select o.id, o.user_name, i.order_desc
                from t_order o inner join t_order_item i on o.order_id = 
i.order_id order by o.id desc limit 1,10
   2023-05-16 09:18:54.157  INFO 22196 --- [           main] ShardingSphere-SQL 
                      : SQLStatement: 
MySQLSelectStatement(table=Optional.empty, 
limit=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment@8cd00bc],
 lock=Optional.empty, window=Optional.empty)
   2023-05-16 09:18:54.157  INFO 22196 --- [           main] ShardingSphere-SQL 
                      : Actual SQL: ds1 ::: select o.id, o.user_name, 
i.order_desc
                from t_order o inner join t_order_item i on o.order_id = 
i.order_id order by o.id desc limit 0,11
   
   org.springframework.jdbc.BadSqlGrammarException: 
   ### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: Table 
'test1.t_order_item' doesn't exist
   ### The error may exist in file 
[E:\my-study-project\sharding-sphere\target\classes\mapper\OrderMapper.xml]
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: select o.id, o.user_name, i.order_desc   from t_order o inner join 
t_order_item i on o.order_id = i.order_id order by o.id desc limit 1,10
   ### Cause: java.sql.SQLSyntaxErrorException: Table 'test1.t_order_item' 
doesn't exist
   ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 
Table 'test1.t_order_item' doesn't exist
   
   ---------------------
   If the following sql statement without limit can be executed 
successfully。why?
   select o.id, o.user_name, i.order_desc
                from t_order o inner join t_order_item i on o.order_id = 
i.order_id order by o.id desc


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