diff --git a/.github/workflows/debezium-workflow.yml b/.github/workflows/debezium-workflow.yml index 8fd350e12..876aafc9b 100644 --- a/.github/workflows/debezium-workflow.yml +++ b/.github/workflows/debezium-workflow.yml @@ -291,11 +291,10 @@ jobs: -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 - ## Add this as until 5.7 will be EOL in October 2023 - build_mysql_5_7: + build_mysql_8_0: needs: [ check_style, file_changes ] if: ${{ needs.file_changes.outputs.common-changed == 'true' || needs.file_changes.outputs.mysql-changed == 'true' || needs.file_changes.outputs.mysql-ddl-parser-changed == 'true' || needs.file_changes.outputs.schema-generator-changed == 'true' }} - name: "MySQL 5.7" + name: "MySQL 8.0" runs-on: ubuntu-latest steps: - name: Checkout Action @@ -318,8 +317,7 @@ jobs: - name: Build Debezium Connector MySQL run: > ./mvnw clean install -B -pl debezium-connector-mysql -am -Passembly - -Dmysql.server.image.source=mysql/mysql-server - -Dversion.mysql.server=5.7 + -Dversion.mysql.server=8.0 -Dcheckstyle.skip=true -Dformat.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn diff --git a/debezium-connector-mysql/NOTES.md b/debezium-connector-mysql/NOTES.md index a36742d98..191c2183a 100644 --- a/debezium-connector-mysql/NOTES.md +++ b/debezium-connector-mysql/NOTES.md @@ -4,7 +4,7 @@ The [mysql](https://hub.docker.com/r/_/mysql/) images are maintained by Docker, ## Using MySQL Server -As mentioned in the [README.md]() file, our Maven build can be used to start a container using either one of these images. The `container-registry.oracle.com/mysql/community-server:8.1` image is used: +As mentioned in the [README.md]() file, our Maven build can be used to start a container using either one of these images. The `container-registry.oracle.com/mysql/community-server:8.2` image is used: $ mvn docker:start @@ -31,9 +31,9 @@ or Although using the Maven command is far simpler, the Maven command for the `alt-server` profile really just runs (via the Jolokia Maven plugin) a Docker command to start the container, so it's equivalent to: - $ docker run -it --name database -p 3306:3306 -v $(pwd)/src/test/docker/alt-server:/etc/mysql/conf.d -v $(pwd)/src/test/docker/init:/docker-entrypoint-initdb.d -e MYSQL_DATABASE=mysql -e MYSQL_ROOT_PASSWORD=debezium-rocks -e MYSQL_USER=mysqluser -e MYSQL_PASSWORD=mysqlpw mysql:5.7 + $ docker run -it --name database -p 3306:3306 -v $(pwd)/src/test/docker/alt-server:/etc/mysql/conf.d -v $(pwd)/src/test/docker/init:/docker-entrypoint-initdb.d -e MYSQL_DATABASE=mysql -e MYSQL_ROOT_PASSWORD=debezium-rocks -e MYSQL_USER=mysqluser -e MYSQL_PASSWORD=mysqlpw mysql:8.2 -This will use the `mysql:5.7` image to start a new container named `database` where the MySQL instance uses the combined startup settings from `/etc/mysql/my.cnf` (defined in the Docker image) and the same local configuration file we used in the integration test MySQL container, `src/test/docker/mysql.cnf` (mounted into the container at `/etc/mysql/conf.d/mysql.cnf`). The settings from the latter file take precedence. +This will use the `mysql:8.2` image to start a new container named `database` where the MySQL instance uses the combined startup settings from `/etc/mysql/my.cnf` (defined in the Docker image) and the same local configuration file we used in the integration test MySQL container, `src/test/docker/mysql.cnf` (mounted into the container at `/etc/mysql/conf.d/mysql.cnf`). The settings from the latter file take precedence. The second volume mount, namely `-v src/test/docker/init:/docker-entrypoint-initdb.d`, makes available all of our existing scripts inside the `src/test/docker/init` directory so that they are run upon server initialization. @@ -43,4 +43,4 @@ The command also defines the same `mysql` database and uses the same username an The following command can be used to manually start up a Docker container to run the MySQL command line client: - $ docker run -it --link database:mysql --rm mysql:5.7 sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' + $ docker run -it --link database:mysql --rm mysql:8.2 sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' diff --git a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlHistoryRecordComparator.java b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlHistoryRecordComparator.java index 5a6aff0ab..b846e16bb 100644 --- a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlHistoryRecordComparator.java +++ b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlHistoryRecordComparator.java @@ -75,7 +75,7 @@ protected boolean isPositionAtOrBefore(Document recorded, Document desired) { // recorded position is older since GTIDs are often enabled but rarely disabled. And if they are disabled, // it is likely that the desired position would not include GTIDs as we would be trying to read the binlog of a // server that no longer has GTIDs. And if they are enabled, disabled, and re-enabled, per - // https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-failover.html all properly configured slaves that + // https://dev.mysql.com/doc/refman/8.2/en/replication-gtids-failover.html all properly configured slaves that // use GTIDs should always have the complete set of GTIDs copied from the master, in which case // again we know that recorded not having GTIDs is before the desired position ... return true; diff --git a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java index 430bfcf04..8f23d78cc 100644 --- a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java +++ b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java @@ -178,9 +178,9 @@ protected void lockTablesForSchemaSnapshot(ChangeEventSourceContext sourceContex // from the same MVCC snapshot. Thus each plain (non-locking) SELECT statements within the same transaction are // consistent also with respect to each other. // - // See: https://dev.mysql.com/doc/refman/5.7/en/set-transaction.html - // See: https://dev.mysql.com/doc/refman/5.7/en/innodb-transaction-isolation-levels.html - // See: https://dev.mysql.com/doc/refman/5.7/en/innodb-consistent-read.html + // See: https://dev.mysql.com/doc/refman/8.2/en/set-transaction.html + // See: https://dev.mysql.com/doc/refman/8.2/en/innodb-transaction-isolation-levels.html + // See: https://dev.mysql.com/doc/refman/8.2/en/innodb-consistent-read.html connection.connection().setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ); connection.executeWithoutCommitting("SET SESSION lock_wait_timeout=" + connectorConfig.snapshotLockTimeout().getSeconds()); try { @@ -225,7 +225,7 @@ protected void releaseSchemaSnapshotLocks(RelationalSnapshotContext WITH READ LOCK'. However, if we were to do this, the 'UNLOCK TABLES' // would implicitly commit our active transaction, and this would break our consistent snapshot logic. // Therefore, we cannot unlock the tables here! - // https://dev.mysql.com/doc/refman/5.7/en/flush.html + // https://dev.mysql.com/doc/refman/8.2/en/flush.html LOGGER.warn("Tables were locked explicitly, but to get a consistent snapshot we cannot release the locks until we've read all tables."); } } diff --git a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSystemVariables.java b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSystemVariables.java index 826b9943f..b37fd93f2 100644 --- a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSystemVariables.java +++ b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlSystemVariables.java @@ -38,7 +38,7 @@ public int priority() { /** * The system variable name for the name of the character set that the server uses by default. - * See http://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_character-set-server + * See http://dev.mysql.com/doc/refman/8.2/en/server-options.html#option_mysqld_character-set-server */ public static final String CHARSET_NAME_SERVER = "character_set_server"; @@ -52,7 +52,7 @@ public int priority() { /** * The system variable name to see if the MySQL tables are stored and looked-up in case sensitive way. - * See https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_lower_case_table_names + * See https://dev.mysql.com/doc/refman/8.2/en/server-system-variables.html#sysvar_lower_case_table_names */ public static final String LOWER_CASE_TABLE_NAMES = "lower_case_table_names"; diff --git a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlUnsignedIntegerConverter.java b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlUnsignedIntegerConverter.java index 60416e4de..d94fe6847 100644 --- a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlUnsignedIntegerConverter.java +++ b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlUnsignedIntegerConverter.java @@ -17,7 +17,7 @@ public class MySqlUnsignedIntegerConverter { /** * Maximum values for Unsigned Integer Types. Needed in order to calculate actual value of an Unsigned Integer Types from binlog value. - * Reference to {@see https://dev.mysql.com/doc/refman/5.7/en/integer-types.html} + * Reference to {@see https://dev.mysql.com/doc/refman/8.2/en/integer-types.html} */ private static final short TINYINT_MAX_VALUE = 255; private static final int SMALLINT_MAX_VALUE = 65535; diff --git a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlValueConverters.java b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlValueConverters.java index 4b4879f2d..ae3594781 100644 --- a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlValueConverters.java +++ b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlValueConverters.java @@ -56,7 +56,7 @@ *

* This class always uses UTC for the default time zone when converting values without timezone information to values that require * timezones. This is because MySQL {@code TIMESTAMP} values are always - * stored in UTC (unlike {@code DATETIME} values) and + * stored in UTC (unlike {@code DATETIME} values) and * are replicated in this form. Meanwhile, the MySQL Binlog Client library will {@link AbstractRowsEventDataDeserializer * deserialize} these as {@link java.sql.Timestamp} values that have no timezone and, therefore, are presumed to be in UTC. * When the column is properly marked with a {@link Types#TIMESTAMP_WITH_TIMEZONE} type, the converters will need to convert @@ -91,7 +91,7 @@ public interface ParsingErrorHandler { private static final Pattern TIMESTAMP_FIELD_PATTERN = Pattern.compile("([0-9]*)-([0-9]*)-([0-9]*) .*"); /** - * A utility method that adjusts ambiguous 2-digit + * A utility method that adjusts ambiguous 2-digit * year values of DATETIME, DATE, and TIMESTAMP types using these MySQL-specific rules: *