{"record":{"id":"8ea53a60084fc2b9","repo":"apache/seatunnel","slug":"is-set-to-true-this-setting-is-not-recomme","errorCode":null,"errorMessage":"'{}' is set to 'true'. This setting is not recommended and can result in timezone issues.","messagePattern":"'(.+?)' is set to 'true'\\. This setting is not recommended and can result in timezone issues\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnection.java","lineNumber":633,"sourceCode":"                    jdbcConfigBuilder.with(\n                            \"trustCertificateKeyStorePassword\",\n                            String.valueOf(sslTrustStorePassword()));\n                }\n                if (!Strings.isNullOrBlank(sslKeyStore())) {\n                    jdbcConfigBuilder.with(\"clientCertificateKeyStoreUrl\", \"file:\" + sslKeyStore());\n                }\n                if (sslKeyStorePassword() != null) {\n                    jdbcConfigBuilder.with(\n                            \"clientCertificateKeyStorePassword\",\n                            String.valueOf(sslKeyStorePassword()));\n                }\n            }\n\n            final String legacyDateTime = dbConfig.getString(JDBC_PROPERTY_LEGACY_DATETIME);\n            if (legacyDateTime == null) {\n                jdbcConfigBuilder.with(JDBC_PROPERTY_LEGACY_DATETIME, \"false\");\n            } else if (\"true\".equals(legacyDateTime)) {\n                LOGGER.warn(\n                        \"'{}' is set to 'true'. This setting is not recommended and can result in timezone issues.\",\n                        JDBC_PROPERTY_LEGACY_DATETIME);\n            }\n\n            jdbcConfigBuilder.with(\n                    JDBC_PROPERTY_CONNECTION_TIME_ZONE, determineConnectionTimeZone(dbConfig));\n\n            this.jdbcConfig = JdbcConfiguration.adapt(jdbcConfigBuilder.build());\n            String driverClassName = this.jdbcConfig.getString(MySqlConnectorConfig.JDBC_DRIVER);\n            factory =\n                    JdbcConnection.patternBasedFactory(\n                            MySqlConnection.URL_PATTERN,\n                            driverClassName,\n                            getClass().getClassLoader());\n        }\n\n        private static String determineConnectionTimeZone(final Configuration dbConfig) {\n            // Debezium by default expects timezoned data delivered in server timezone","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnection.java#L615-L651","documentation":"When building the MySQL JDBC configuration, MySqlConnectionConfiguration checks the legacy connection property useLegacyDatetimeCode. If it is explicitly set to 'true', this warning is logged because the legacy datetime handling changes how DATE/TIME/TIMESTAMP values are converted, commonly producing timezone shifts. The value is kept as configured but is not recommended.","triggerScenarios":"The user's database config (jdbc properties map) contains JDBC_PROPERTY_LEGACY_DATETIME (useLegacyDatetimeCode) set to the string 'true' while constructing MySqlConnectionConfiguration for CDC snapshot/stream reading.","commonSituations":"Copy-pasted old Debezium/connector configs from pre-Connector/J 8 era; trying to 'fix' timestamp discrepancies by enabling legacy datetime code; migrating configs from Flink CDC or older SeaTunnel versions.","solutions":["Remove the useLegacyDatetimeCode=true property from the JDBC config entirely (the code defaults it to false).","Set serverTimezone/connectionTimeZone explicitly to the actual server timezone instead.","Verify timestamps read by the CDC job match the database after the change.","If timezone problems persist, align the JVM timezone with the MySQL server timezone."],"exampleFix":"// before (url/config)\njdbc.properties.useLegacyDatetimeCode = true\n// after: remove it and set explicit zone\njdbc.properties.connectionTimeZone = Asia/Shanghai","handlingStrategy":"validation","validationCode":"// before building config, assert legacy datetime is off\nif (\"true\".equals(props.get(\"database.jdbc.properties.useLegacyDatetimeCode\"))) {\n    throw new IllegalArgumentException(\"Remove useLegacyDatetimeCode=true\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never copy legacy useLegacyDatetimeCode settings from old Debezium/Flink-CDC configs.","Handle timezones with connectionTimeZone/serverTimezone explicitly instead.","Snapshot-compare a few TIMESTAMP rows between DB and sink after connector upgrades."],"tags":["mysql","cdc","jdbc","timezone","deprecated"],"backgroundTag":"deprecated-api-usage","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}