Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix][mysql][e2e] mysql silent unclassified size copy,table names cannot be capitalized by default. #1341

Merged
merged 2 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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