Skip to content

Commit

Permalink
[hotfix][mysql][e2e] mysql silent unclassified size copy,table names …
Browse files Browse the repository at this point in the history
…cannot be capitalized by default. (#1341)

Co-authored-by: FlechazoW <35768015+FlechazoW@users.noreply.github.com>
  • Loading branch information
chaozwn and FlechazoW authored Oct 24, 2022
1 parent d809666 commit 2c88dea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -126,10 +124,6 @@ public Optional<String> getReplaceStatement(

@Override
public Function<JdbcConf, Tuple3<String, String, String>> getTableIdentify() {
return conf ->
Tuple3.of(
null,
StringUtils.upperCase(conf.getSchema()),
StringUtils.upperCase(conf.getTable()));
return conf -> Tuple3.of(conf.getSchema(), null, conf.getTable());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand All @@ -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<CreateContainerCmd>) cmd -> cmd.withCmd("--lower_case_table_names=1"));
withExposedPorts(MYSQL_PORT);
waitingFor(
new WaitStrategy() {
Expand Down

0 comments on commit 2c88dea

Please sign in to comment.