This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 6506b2d Make BINLOG_ROW_IMAGE check compatible with MySQL old version
in scaling (#14457)
6506b2d is described below
commit 6506b2d048364be0a516269a9eda943cb2eb4702
Author: ReyYang <[email protected]>
AuthorDate: Fri Dec 31 17:06:08 2021 +0800
Make BINLOG_ROW_IMAGE check compatible with MySQL old version in scaling
(#14457)
---
.../pipeline/mysql/check/datasource/MySQLDataSourceChecker.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/check/datasource/MySQLDataSourceChecker.java
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/check/datasource/MySQLDataSourceChecker.java
index d6dd82b..1be1c85 100644
---
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/check/datasource/MySQLDataSourceChecker.java
+++
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/check/datasource/MySQLDataSourceChecker.java
@@ -45,6 +45,8 @@ public final class MySQLDataSourceChecker extends
AbstractDataSourceChecker {
private static final Map<String, String> REQUIRED_VARIABLES = new
HashMap<>(3, 1);
+ private static final String BINLOG_ROW_IMAGE = "BINLOG_ROW_IMAGE";
+
static {
REQUIRED_VARIABLES.put("LOG_BIN", "ON");
REQUIRED_VARIABLES.put("BINLOG_FORMAT", "ROW");
@@ -99,7 +101,9 @@ public final class MySQLDataSourceChecker extends
AbstractDataSourceChecker {
try (PreparedStatement preparedStatement =
connection.prepareStatement(SHOW_VARIABLES_SQL)) {
preparedStatement.setString(1, key);
try (ResultSet resultSet = preparedStatement.executeQuery()) {
- resultSet.next();
+ if (!resultSet.next() &&
BINLOG_ROW_IMAGE.equalsIgnoreCase(key)) {
+ return;
+ }
String actualValue = resultSet.getString(2);
if (!toBeCheckedValue.equalsIgnoreCase(actualValue)) {
throw new
PipelineJobPrepareFailedException(String.format("Source data source required
`%s = %s`, now is `%s`", key, toBeCheckedValue, actualValue));