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

fix: #793 ,不同数据库方言切换问题 #795

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/main/java/com/github/pagehelper/page/PageAutoDialect.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ public static String fromJdbcUrl(String jdbcUrl) {

//获取当前的代理对象
public AbstractHelperDialect getDelegate() {
if (delegate != null) {
if (autoDialect) {
return dialectThreadLocal.get();
} else {
return delegate;
}
return dialectThreadLocal.get();
}

//移除代理对象
Expand Down Expand Up @@ -229,11 +230,11 @@ public void initDelegateDialect(MappedStatement ms, String dialectClass) {
}
}
dialectThreadLocal.set(dialect);
} else if (delegate == null) {
} else {
if (autoDialect) {
this.delegate = autoGetDialect(ms);
} else {
dialectThreadLocal.set(autoGetDialect(ms));
} else if (delegate == null) {
delegate = autoGetDialect(ms);
}
}
}
Expand Down