Skip to content

Commit

Permalink
quick workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikeW committed Mar 4, 2024
1 parent 79d301a commit 08c235a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
9 changes: 5 additions & 4 deletions e2e_test/source/cdc/mysql_cdc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ VALUES (1,1,'no'),
(3,3,'no'),
(4,4,'no');

-- user rwcdc used for shared mysql source
CREATE USER 'rwcdc'@'%' IDENTIFIED BY '123456';
GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'rwcdc'@'%';

CREATE USER 'dbz'@'%' IDENTIFIED BY '123456';
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'dbz'@'%';

CREATE USER 'rwcdc'@'%' IDENTIFIED BY '123456';
GRANT SELECT, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'rwcdc'@'%';

FLUSH PRIVILEGES;

CREATE TABLE tt3 (v1 int primary key, v2 timestamp);
INSERT INTO tt3 VALUES (1, '2020-07-30 10:08:22');
INSERT INTO tt3 VALUES (2, '2020-07-31 10:09:22');
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,10 @@ private void validateTableSchema() throws SQLException {
}

private void validatePrivileges() throws SQLException {
final String[] dedicatedSourcePrivileges = {
"SELECT", "RELOAD", "SHOW DATABASES", "REPLICATION SLAVE", "REPLICATION CLIENT",
String[] privilegesRequired = {
"SELECT", "RELOAD", "REPLICATION SLAVE", "REPLICATION CLIENT",
};

final String[] sharedSourcePrivileges = {
"SELECT", "REPLICATION SLAVE", "REPLICATION CLIENT",
};

String[] privilegesRequired =
isMultiTableShared ? sharedSourcePrivileges : dedicatedSourcePrivileges;
var hashSet = new HashSet<>(List.of(privilegesRequired));
try (var stmt = jdbcConnection.createStatement()) {
var res = stmt.executeQuery(ValidatorUtils.getSql("mysql.grants"));
Expand Down

0 comments on commit 08c235a

Please sign in to comment.