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

修复OceanBase validateQuery问题 #4967

Merged
merged 1 commit into from
Oct 20, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
import java.sql.Statement;

public class OceanBaseValidConnectionChecker extends ValidConnectionCheckerAdapter implements ValidConnectionChecker {
private String oracleModeValidateQuery = "SELECT 'x' FROM DUAL";
private String mysqlModeValidateQuery = "SELECT 'x'";
private String commonValidateQuery = "SELECT 'x' FROM DUAL";
private DbType dbType;

public OceanBaseValidConnectionChecker() {
Expand All @@ -47,11 +46,7 @@ public boolean isValidConnection(final Connection c,
}
if (validateQuery == null || validateQuery.isEmpty()) {
if (dbType != null) {
if (dbType == DbType.oceanbase) {
validateQuery = mysqlModeValidateQuery;
} else {
validateQuery = oracleModeValidateQuery;
}
validateQuery = commonValidateQuery;
}
}

Expand Down