From: Pierre Guillot Date: Wed, 15 May 2019 15:43:20 +0000 (+0200) Subject: SONAR-11962 Warn when detecting MySQL at startup X-Git-Tag: 7.8~213 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=919604b531633e97a29964f4e4cf72bf1f058f78;p=sonarqube.git SONAR-11962 Warn when detecting MySQL at startup --- diff --git a/server/sonar-db-core/src/main/java/org/sonar/db/dialect/MySql.java b/server/sonar-db-core/src/main/java/org/sonar/db/dialect/MySql.java index 421246a493b..bc8dfe81528 100644 --- a/server/sonar-db-core/src/main/java/org/sonar/db/dialect/MySql.java +++ b/server/sonar-db-core/src/main/java/org/sonar/db/dialect/MySql.java @@ -63,6 +63,14 @@ public class MySql extends AbstractDialect { public void init(DatabaseMetaData metaData) throws SQLException { checkDbVersion(metaData, MIN_SUPPORTED_VERSION); - Loggers.get(getClass()).warn("MySQL support is deprecated and will be dropped soon."); + String message = "\n" + + "#############################################################################################################\n" + + "# End of Life of MySQL Support : SonarQube 7.8 is the last version that will support MySQL. #\n" + + "# Please consider migrating to a supported database. Get the migration detail on #\n" + + "# https://community.sonarsource.com/t/end-of-life-of-mysql-support #\n" + + "# and https://github.com/SonarSource/mysql-migrator #\n" + + "#############################################################################################################\n"; + + Loggers.get(getClass()).warn(message); } } diff --git a/server/sonar-db-core/src/test/java/org/sonar/db/dialect/MySqlTest.java b/server/sonar-db-core/src/test/java/org/sonar/db/dialect/MySqlTest.java index 44a77dfe0ba..a176c15bdf1 100644 --- a/server/sonar-db-core/src/test/java/org/sonar/db/dialect/MySqlTest.java +++ b/server/sonar-db-core/src/test/java/org/sonar/db/dialect/MySqlTest.java @@ -21,6 +21,7 @@ package org.sonar.db.dialect; import java.sql.DatabaseMetaData; import java.sql.SQLException; +import java.util.List; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -99,7 +100,8 @@ public class MySqlTest { public void init_logs_warning() throws SQLException { underTest.init(newMetadata(5, 6)); - assertThat(logs.logs(LoggerLevel.WARN)).contains("MySQL support is deprecated and will be dropped soon."); + List logs = this.logs.logs(LoggerLevel.WARN); + assertThat(logs.get(0).contains("End of Life of MySQL Support : SonarQube 7.8 is the last version that will support MySQL.")).isTrue(); } @Test