diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-10-31 08:40:23 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-10-31 08:40:23 +0100 |
commit | 526f4f096e3257482d36a922767c86503e36f707 (patch) | |
tree | 4027574f04d652018410da98f8ab72c63859862b | |
parent | b641ada84fdbdd74a6af22e2af1ec9b5e9169d47 (diff) | |
download | sonarqube-526f4f096e3257482d36a922767c86503e36f707.tar.gz sonarqube-526f4f096e3257482d36a922767c86503e36f707.zip |
SONAR-5605 Restore mysql client side cursor
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java | 7 |
1 files changed, 6 insertions, 1 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); } } |