From 9d66e17ce9b12bb9b6b4e18f9702770b02d1ab4c Mon Sep 17 00:00:00 2001 From: zhao_wei_nan <326747337@qq.com> Date: Mon, 24 Oct 2022 16:14:50 +0800 Subject: [PATCH] [hotfix][mysql][e2e] mysql silent unclassified size copy,table names cannot be capitalized by default. --- .../chunjun/connector/mysql/dialect/MysqlDialect.java | 8 +------- .../connector/containers/mysql/MysqlBaseContainer.java | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/chunjun-connectors/chunjun-connector-mysql/src/main/java/com/dtstack/chunjun/connector/mysql/dialect/MysqlDialect.java b/chunjun-connectors/chunjun-connector-mysql/src/main/java/com/dtstack/chunjun/connector/mysql/dialect/MysqlDialect.java index 0abe9ccebb..724b80e4cd 100644 --- a/chunjun-connectors/chunjun-connector-mysql/src/main/java/com/dtstack/chunjun/connector/mysql/dialect/MysqlDialect.java +++ b/chunjun-connectors/chunjun-connector-mysql/src/main/java/com/dtstack/chunjun/connector/mysql/dialect/MysqlDialect.java @@ -25,8 +25,6 @@ import org.apache.flink.api.java.tuple.Tuple3; -import org.apache.commons.lang3.StringUtils; - import java.util.Arrays; import java.util.Optional; import java.util.function.Function; @@ -126,10 +124,6 @@ public Optional getReplaceStatement( @Override public Function> getTableIdentify() { - return conf -> - Tuple3.of( - null, - StringUtils.upperCase(conf.getSchema()), - StringUtils.upperCase(conf.getTable())); + return conf -> Tuple3.of(conf.getSchema(), null, conf.getTable()); } } diff --git a/chunjun-e2e/src/test/java/com/dtstack/chunjun/connector/containers/mysql/MysqlBaseContainer.java b/chunjun-e2e/src/test/java/com/dtstack/chunjun/connector/containers/mysql/MysqlBaseContainer.java index 8c06edf29c..e04fc969ff 100644 --- a/chunjun-e2e/src/test/java/com/dtstack/chunjun/connector/containers/mysql/MysqlBaseContainer.java +++ b/chunjun-e2e/src/test/java/com/dtstack/chunjun/connector/containers/mysql/MysqlBaseContainer.java @@ -18,6 +18,7 @@ package com.dtstack.chunjun.connector.containers.mysql; +import com.github.dockerjava.api.command.CreateContainerCmd; import org.testcontainers.containers.JdbcDatabaseContainer; import org.testcontainers.containers.wait.strategy.WaitStrategy; import org.testcontainers.containers.wait.strategy.WaitStrategyTarget; @@ -26,6 +27,7 @@ import java.net.URISyntaxException; import java.nio.file.Path; import java.time.Duration; +import java.util.function.Consumer; public class MysqlBaseContainer extends JdbcDatabaseContainer { @@ -40,6 +42,8 @@ public MysqlBaseContainer(String imageName, Path dockerfile) throws URISyntaxExc withEnv("MYSQL_USER", "admin"); withEnv("MYSQL_PASSWORD", password); withEnv("MYSQL_ROOT_PASSWORD", password); + withCreateContainerCmdModifier( + (Consumer) cmd -> cmd.withCmd("--lower_case_table_names=1")); withExposedPorts(MYSQL_PORT); waitingFor( new WaitStrategy() {