From 1ddf3ee7dbf26116afb767003a8a0698965c4f70 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 22 Aug 2017 20:32:34 +0200 Subject: [PATCH] SONAR-9745 Drop support of Microsoft SQLServer 2012 --- .cix.yml | 5 ----- .../java/org/sonar/db/DatabaseChecker.java | 3 +-- .../java/org/sonar/db/DatabaseCheckerTest.java | 18 ++++++++++++++++++ .../src/main/assembly/conf/sonar.properties | 3 ++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.cix.yml b/.cix.yml index 992f1604978..5cbe48382dd 100644 --- a/.cix.yml +++ b/.cix.yml @@ -3,7 +3,6 @@ RUN_ACTIVITY: - run-db-unit-tests-mysql56 - - run-db-unit-tests-mssql2012 - run-db-unit-tests-mssql2014 - run-db-unit-tests-oracle11g - run-db-unit-tests-oracle12c @@ -42,8 +41,6 @@ RUN_ACTIVITY: exclude: - RUN_ACTIVITY: run-db-unit-tests-mysql56 SLAVE_TYPE: performance - - RUN_ACTIVITY: run-db-unit-tests-mssql2012 - SLAVE_TYPE: performance - RUN_ACTIVITY: run-db-unit-tests-mssql2014 SLAVE_TYPE: performance - RUN_ACTIVITY: run-db-unit-tests-oracle11g @@ -116,8 +113,6 @@ exclude: - RUN_ACTIVITY: run-db-unit-tests-mysql56 SLAVE_TYPE: windows - - RUN_ACTIVITY: run-db-unit-tests-mssql2012 - SLAVE_TYPE: windows - RUN_ACTIVITY: run-db-unit-tests-mssql2014 SLAVE_TYPE: windows - RUN_ACTIVITY: run-db-unit-tests-oracle11g diff --git a/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java b/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java index 110fcae0daa..0c5e699286a 100644 --- a/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java +++ b/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java @@ -41,10 +41,9 @@ import org.sonar.db.dialect.PostgreSql; public class DatabaseChecker implements Startable { private static final Map MINIMAL_SUPPORTED_DB_VERSIONS = ImmutableMap.of( - // MsSQL 2012 is 11.x // MsSQL 2014 is 12.x // https://support.microsoft.com/en-us/kb/321185 - MsSql.ID, Version.create(11, 0, 0), + MsSql.ID, Version.create(12, 0, 0), MySql.ID, Version.create(5, 6, 0), Oracle.ID, Version.create(11, 0, 0), PostgreSql.ID, Version.create(8, 0, 0)); diff --git a/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java b/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java index 79b8fabe357..8e64ebfcf34 100644 --- a/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java +++ b/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java @@ -27,6 +27,7 @@ import org.mockito.Mockito; import org.sonar.api.utils.MessageException; import org.sonar.db.dialect.Dialect; import org.sonar.db.dialect.H2; +import org.sonar.db.dialect.MsSql; import org.sonar.db.dialect.MySql; import org.sonar.db.dialect.Oracle; @@ -107,6 +108,23 @@ public class DatabaseCheckerTest { // no error } + @Test + public void mssql_2012_is_not_supported() throws Exception { + expectedException.expect(MessageException.class); + expectedException.expectMessage("Unsupported mssql version: 11.0. Minimal supported version is 12.0."); + + Database db = mockDb(new MsSql(), 11, 0, "6.1"); + new DatabaseChecker(db).start(); + // no error + } + + @Test + public void mssql_2014_is_supported() throws Exception { + Database db = mockDb(new MsSql(), 12, 0, "6.1"); + new DatabaseChecker(db).start(); + // no error + } + @Test public void fail_if_mysql_less_than_5_6() throws Exception { expectedException.expect(MessageException.class); diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index 4b01bbbd6e0..083c9a6df18 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -17,6 +17,7 @@ #----- Embedded Database (default) # H2 embedded database server listening port, defaults to 9092 #sonar.embeddedDatabase.port=9092 + #----- MySQL 5.6 or greater # Only InnoDB storage engine is supported (not myISAM). # Only the bundled driver is supported. It can not be changed. @@ -36,7 +37,7 @@ #sonar.jdbc.url=jdbc:postgresql://localhost/sonar -#----- Microsoft SQLServer 2012/2014 and SQL Azure +#----- Microsoft SQLServer 2014 and SQL Azure # A database named sonar must exist and its collation must be case-sensitive (CS) and accent-sensitive (AS) # Use the following connection string if you want to use integrated security with Microsoft Sql Server # Do not set sonar.jdbc.username or sonar.jdbc.password property if you are using Integrated Security -- 2.39.5