Skip to content

Commit

Permalink
fix(mysql-cdc): validate mysql version less then 8.4 (#17728)
Browse files Browse the repository at this point in the history
Co-authored-by: Chengyou Liu <35356271+cyliu0@users.noreply.github.com>
  • Loading branch information
StrikeW and cyliu0 authored Jul 18, 2024
1 parent 3328025 commit 0883df5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ public MySqlValidator(
@Override
public void validateDbConfig() {
try {
// TODO: check database server version
// Check whether MySQL version is less than 8.4,
// since MySQL 8.4 introduces some breaking changes:
// https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-0.html#mysqld-8-4-0-deprecation-removal
var major = jdbcConnection.getMetaData().getDatabaseMajorVersion();
var minor = jdbcConnection.getMetaData().getDatabaseMinorVersion();

if ((major > 8) || (major == 8 && minor >= 4)) {
throw ValidatorUtils.failedPrecondition("MySQL version should be less than 8.4");
}
validateBinlogConfig();
} catch (SQLException e) {
throw ValidatorUtils.internalError(e.getMessage());
Expand Down

0 comments on commit 0883df5

Please sign in to comment.