diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-10-17 09:13:15 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-10-17 09:13:15 +0200 |
commit | 0f6775907280ff2d0b5e3ea9d4c2cff9755c63d1 (patch) | |
tree | f08cff09972440967c44d2dd19b40eac0182421b | |
parent | e2dd32eff8f27428f4c94b7c77e92feef38e0948 (diff) | |
parent | cbd911bcb1bc40510fdf56639ef7476612bec24c (diff) | |
download | sonarqube-0f6775907280ff2d0b5e3ea9d4c2cff9755c63d1.tar.gz sonarqube-0f6775907280ff2d0b5e3ea9d4c2cff9755c63d1.zip |
Merge remote-tracking branch 'origin/branch-4.5'
Conflicts:
sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java
4 files changed, 9 insertions, 5 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java index d0724aaa813..b49fc88edee 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java @@ -21,6 +21,7 @@ package org.sonar.server.db.migrations; import org.apache.commons.dbutils.DbUtils; import org.sonar.core.persistence.Database; +import org.sonar.core.persistence.dialect.MySql; import java.sql.Connection; import java.sql.PreparedStatement; @@ -82,7 +83,11 @@ class SelectImpl extends BaseSqlStatement<Select> implements Select { static SelectImpl create(Database db, Connection connection, String sql) throws SQLException { PreparedStatement pstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); - pstmt.setFetchSize(1000); + if (db.getDialect().getId().equals(MySql.ID)) { + pstmt.setFetchSize(Integer.MIN_VALUE); + } else { + pstmt.setFetchSize(1000); + } return new SelectImpl(pstmt); } } diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index 064e2beafac..4c720ee9982 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -28,7 +28,7 @@ #----- MySQL 5.x -#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useCursorFetch=true +#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance #----- Oracle 10g/11g diff --git a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java index b2f36dbb6c0..4a34e55a642 100644 --- a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java +++ b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java @@ -95,7 +95,6 @@ public class JdbcSettings { if (Provider.MYSQL.equals(provider)) { checkRequiredParameter(url, "useUnicode=true"); checkRequiredParameter(url, "characterEncoding=utf8"); - checkRequiredParameter(url, "useCursorFetch=true"); checkRecommendedParameter(url, "rewriteBatchedStatements=true"); checkRecommendedParameter(url, "useConfigs=maxPerformance"); } diff --git a/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java b/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java index d6fd2af70e2..5a2708ab5c8 100644 --- a/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java +++ b/sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java @@ -65,11 +65,11 @@ public class JdbcSettingsTest { // minimal -> ok settings.checkUrlParameters(JdbcSettings.Provider.MYSQL, - "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&useCursorFetch=true"); + "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8"); // full -> ok settings.checkUrlParameters(JdbcSettings.Provider.MYSQL, - "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useCursorFetch=true"); + "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance"); // missing required -> ko try { |