You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/12/31 05:49:30 UTC
[dolphinscheduler] branch 2.0.2-release updated: [fix-7750]Compatible historical version data source connection information(#7750) (#7751)
This is an automated email from the ASF dual-hosted git repository.
leonbao pushed a commit to branch 2.0.2-release
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/2.0.2-release by this push:
new a668c46 [fix-7750]Compatible historical version data source connection information(#7750) (#7751)
a668c46 is described below
commit a668c46e89c68f8289cffb7317d0016f3e1f4f9e
Author: mask <39...@users.noreply.github.com>
AuthorDate: Fri Dec 31 13:49:17 2021 +0800
[fix-7750]Compatible historical version data source connection information(#7750) (#7751)
---
.../datasource/api/provider/JdbcDataSourceProvider.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/provider/JdbcDataSourceProvider.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/provider/JdbcDataSourceProvider.java
index 16cb027..24a6a29 100644
--- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/provider/JdbcDataSourceProvider.java
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/provider/JdbcDataSourceProvider.java
@@ -98,12 +98,11 @@ public class JdbcDataSourceProvider {
logger.warn("Jdbc driver loading error. Driver {} cannot accept url.", drv);
throw new RuntimeException("Jdbc driver loading error.");
}
- if (dbType.equals(DbType.MYSQL)) {
- if (driver.getMajorVersion() >= 8) {
- properties.setDriverClassName(drv);
- } else {
- properties.setDriverClassName(Constants.COM_MYSQL_JDBC_DRIVER);
- }
+ //Compatible historical version data source connection information
+ if (dbType.equals(DbType.MYSQL) && driver.getMajorVersion() <= 8) {
+ properties.setDriverClassName(Constants.COM_MYSQL_JDBC_DRIVER);
+ } else {
+ properties.setDriverClassName(drv);
}
} catch (final Exception e) {
logger.warn("The specified driver not suitable.");