version for 1.9.10

This commit is contained in:
inrgihc
2024-10-31 21:24:24 +08:00
parent 577d8f846f
commit 1bf6fe61c1
40 changed files with 46 additions and 107 deletions

View File

@@ -6,6 +6,7 @@ body:
attributes:
label: dbswitch版本
options:
- "1.9.10"
- "1.9.9"
- "1.9.8"
- "1.9.7"

View File

@@ -3,7 +3,7 @@
![](https://gitee.com/inrgihc/dbswitch/badge/star.svg)
![](https://gitee.com/inrgihc/dbswitch/badge/fork.svg?theme=gvp)
![dbswitch](https://gitee.com/dromara/dbswitch/raw/master/dbswitch-admin-ui/src/assets/logo.png#pic_center)
![dbswitch](https://gitee.com/dromara/dbswitch/raw/master/images/dbswitch-logo.png#pic_center)
## 一、工具介绍

View File

@@ -2,7 +2,7 @@
set -e
DBSWITCH_VERSION=1.9.9
DBSWITCH_VERSION=1.9.10
BUILD_DOCKER_DIR="$( cd "$( dirname "$0" )" && pwd )"
PROJECT_ROOT_DIR=$( dirname "$BUILD_DOCKER_DIR")
DOCKER_DBSWITCH_DIR=$BUILD_DOCKER_DIR/dbswitch

View File

@@ -1,7 +1,7 @@
services:
mysqldb:
container_name: dbswitch_mysqldb
image: mysql:5.7
image: registry.cn-hangzhou.aliyuncs.com/inrgihc/mysql:5.7
volumes:
- "/data/mysql:/var/lib/mysql"
environment:

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-parent</artifactId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<artifactId>dbswitch-admin</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-parent</artifactId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<artifactId>dbswitch-common</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-parent</artifactId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<artifactId>dbswitch-core</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-parent</artifactId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<artifactId>dbswitch-data</artifactId>

View File

@@ -13,16 +13,14 @@ import cn.hutool.core.util.ClassLoaderUtil;
import com.gitee.dbswitch.common.entity.CloseableDataSource;
import com.gitee.dbswitch.common.entity.InvisibleDataSource;
import com.gitee.dbswitch.common.entity.JarClassLoader;
import com.gitee.dbswitch.common.type.ProductTypeEnum;
import com.gitee.dbswitch.common.util.ExamineUtils;
import com.gitee.dbswitch.common.util.ProductTypeUtils;
import com.gitee.dbswitch.data.domain.WrapCommonDataSource;
import com.gitee.dbswitch.data.domain.WrapHikariDataSource;
import com.gitee.dbswitch.data.entity.SourceDataSourceProperties;
import com.gitee.dbswitch.data.entity.TargetDataSourceProperties;
import com.zaxxer.hikari.HikariDataSource;
import java.net.URLClassLoader;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
@@ -130,15 +128,9 @@ public final class DataSourceUtils {
);
// 如果是Greenplum数据库这里需要关闭会话的查询优化器
if (properties.getDriverClassName().contains("postgresql")) {
try (Connection connection = dataSource.getConnection()) {
if (ProductTypeUtils.isGreenplum(connection)) {
ds.setConnectionInitSql("set optimizer to 'off'");
log.info("Greenplum: Close Optimizer now: set optimizer to 'off'");
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
if (ProductTypeEnum.GREENPLUM == properties.getType()) {
ds.setConnectionInitSql("set optimizer to 'off'");
log.info("Greenplum: Close Optimizer now: set optimizer to 'off'");
}
ds.setDataSource(dataSource);

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-parent</artifactId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<artifactId>dbswitch-dist</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-dm</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-doris</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-elasticsearch</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-mongodb</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-mysql</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-oceanbase</artifactId>

View File

@@ -11,7 +11,6 @@ package com.gitee.dbswitch.product.oceanbase;
import com.gitee.dbswitch.annotation.Product;
import com.gitee.dbswitch.common.type.ProductTypeEnum;
import com.gitee.dbswitch.common.util.ProductTypeUtils;
import com.gitee.dbswitch.features.DefaultProductFeatures;
import com.gitee.dbswitch.features.ProductFeatures;
import com.gitee.dbswitch.product.mysql.MysqlFeatures;
@@ -43,7 +42,7 @@ public class OceanbaseFactoryProvider extends AbstractFactoryProvider {
super(dataSource);
try (Connection connection = getDataSource().getConnection()) {
this.isMySqlMode = ProductTypeUtils.isOceanBaseUseMysqlMode(connection);
this.isMySqlMode = OceanbaseUtils.isOceanBaseUseMysqlMode(connection);
if (log.isDebugEnabled()) {
log.debug("#### Target OceanBase is {} Mode ", this.isMySqlMode ? "MySQL" : "Oracle");
}

View File

@@ -7,52 +7,19 @@
// Date : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.gitee.dbswitch.common.util;
package com.gitee.dbswitch.product.oceanbase;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Objects;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public final class ProductTypeUtils {
public static boolean isGreenplum(Connection connection) {
try (PreparedStatement statement = connection.prepareStatement("SELECT version()")) {
try (ResultSet resultSet = statement.executeQuery()) {
if (resultSet.next()) {
String version = resultSet.getString(1);
if (Objects.nonNull(version) && version.contains("Greenplum")) {
if (log.isDebugEnabled()) {
log.debug("#### Target database is Greenplum Cluster");
}
return true;
}
}
}
} catch (SQLException sqlException) {
if (log.isDebugEnabled()) {
log.debug("#### Failed to execute sql :select version(), and guesses it is not Greenplum datasource!");
}
}
return false;
}
public static boolean isStarRocks(Connection connection) {
// 此查询语句是StarRocks查询be节点是否存活可以用来判断是否是StarRocks数据源
String sql = "SHOW BACKENDS";
try (Statement statement = connection.createStatement()) {
return statement.execute(sql);
} catch (SQLException sqlException) {
if (log.isDebugEnabled()) {
log.debug("Failed to execute sql :show backends, and guesses it is mysql datasource!");
}
}
return false;
}
@UtilityClass
public class OceanbaseUtils {
public static boolean isOceanBaseUseMysqlMode(Connection connection) {
String sql = "show global variables where variable_name = 'ob_compatibility_mode'";
@@ -80,5 +47,4 @@ public final class ProductTypeUtils {
}
return true;
}
}

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-starrocks</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>dbswitch-parent</artifactId>
<groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product</artifactId>

View File

@@ -1,30 +1,14 @@
<!--
Copyright 2010-2020 Redgate Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-parent</artifactId>
<version>1.9.9</version>
<version>1.9.10</version>
</parent>
<artifactId>flyway-core</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
@@ -57,8 +41,6 @@
<artifactId>postgresql</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
@@ -166,5 +148,4 @@
</plugins>
</reporting>
</project>

BIN
images/dbswitch-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-parent</artifactId>
<version>1.9.9</version>
<version>1.9.10</version>
<packaging>pom</packaging>
<name>dbswitch</name>
<description>database switch project</description>

View File

@@ -1,6 +1,6 @@
@echo off
set APP_VERSION=1.9.9
set APP_VERSION=1.9.10
echo "Clean Project ..."
call mvn clean -f pom.xml