Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using multiple data sources, if an error occurs when querying one of the data sources, the SQL of the other data sources cannot automatically switch dialects to generate SQL #848

Open
SoaringCode opened this issue Feb 19, 2025 · 4 comments

Comments

@SoaringCode
Copy link

Caused by: org.postgresql.util.PSQLException: ERROR: LIMIT #,# syntax is not supported
建议:Use separate LIMIT and OFFSET clauses.
位置:420
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2420)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:180)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65)
at com.mybatisflex.core.mybatis.FlexStatementHandler.query(FlexStatementHandler.java:101)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110)
at com.github.pagehelper.util.ExecutorUtil.pageQuery(ExecutorUtil.java:215)
at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:161)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59)
at jdk.proxy2/jdk.proxy2.$Proxy275.query(Unknown Source)

@abel533
Copy link
Collaborator

abel533 commented Feb 21, 2025

@abel533
Copy link
Collaborator

abel533 commented Feb 21, 2025

@SoaringCode
Copy link
Author

helperDialect=postgresql

https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/en/HowToUse.md

We use multiple data sources, but when querying PostgreSQL's data pagination using MySQL as the main data source, an error occurs and we are unable to continue executing

@LSL1618
Copy link

LSL1618 commented Feb 27, 2025

dynamic data sources in Spring and connect different types of databases
https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/en/HowToUse.md#scene-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants