You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "a1424132610 (via GitHub)" <gi...@apache.org> on 2023/05/16 01:20:39 UTC
[GitHub] [shardingsphere] a1424132610 opened a new issue, #25685: Does sql-federation support limit paging?
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on issue #25685: Does sql-federation support limit paging?
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1562148254
Hi @a1424132610 , yes, spring boot starter doesn't exist version 5.3.2. You could try `ShardingSphereDriver`, refer to [ShardingSphere-JDBC]( https://shardingsphere.apache.org/document/5.3.2/cn/quick-start/shardingsphere-jdbc-quick-start/ ) for more details.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #25685: Does sql-federation support limit paging?
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548873353
You can refer this document - https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/props/.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #25685: Does sql-federation support limit paging?
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548835266
Please format your yaml config and exception stack with markdown. It's hard to read.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] a1424132610 commented on issue #25685: Does sql-federation support limit paging?
Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548852960
> Please format your yaml config and exception stack with markdown. It's hard to read.
ok I repasted the error message
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] a1424132610 commented on issue #25685: Does sql-federation support limit paging?
Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548852113
```yml
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
```
```text
2023-05-16 09:53:36.408 INFO 24632 --- [ 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
2023-05-16 09:53:36.408 INFO 24632 --- [ main] ShardingSphere-SQL : SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment@72426ced], lock=Optional.empty, window=Optional.empty)
2023-05-16 09:53:36.408 INFO 24632 --- [ 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 1
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
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
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:234)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy216.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForIPage(MybatisMapperMethod.java:121)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:85)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy219.listByPage(Unknown Source)
at com.zhj.AppTest.test_order(AppTest.java:69)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.sql.SQLSyntaxErrorException: Table 'test1.t_order_item' doesn't exist
```
```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
```
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] a1424132610 commented on issue #25685: Does sql-federation support limit paging?
Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548921798
> You can refer this document - https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/props/.
May I ask if 5.3.2 does not provide the configuration of spring boot starter?
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] a1424132610 commented on issue #25685: Does sql-federation support limit paging?
Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548897383
> You can refer this document - https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/props/.
ok, I'll try to see if the new version supports it, thanks
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] a1424132610 commented on issue #25685: Does sql-federation support limit paging?
Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548867869
> > ```yaml
> > ```yaml
> > sql-federation-enabled: true
> > ```
>
> From this config, probably not the latest version. Can you try latest 5.3.2?
There seems to be no documentation for 5.3.2 on the official website
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #25685: Does sql-federation support limit paging?
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548855003
Hi @a1424132610, What version are you using?
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Does sql-federation support limit paging? [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1763911317
Hi @a1424132610, any result for this issue?
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] a1424132610 commented on issue #25685: Does sql-federation support limit paging?
Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548857176
> 你好@a1424132610, 你用的是什么版本?
I am currently using version 5.1.1
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #25685: Does sql-federation support limit paging?
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1548856379
> ```yaml
> ```yaml
> sql-federation-enabled: true
> ```
>
>
>
>
>
>
>
>
>
>
>
> ```
From this config, probably not the latest version. Can you try latest 5.3.2?
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] a1424132610 commented on issue #25685: Does sql-federation support limit paging?
Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1562168944
>
ok,thank you
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Does sql-federation support limit paging? [shardingsphere]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #25685:
URL: https://github.com/apache/shardingsphere/issues/25685#issuecomment-1973838722
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org