]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5605 Restore mysql client side cursor
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 31 Oct 2014 07:40:23 +0000 (08:40 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 31 Oct 2014 07:40:23 +0000 (08:40 +0100)
server/sonar-server/src/main/java/org/sonar/server/db/migrations/SelectImpl.java

index d0724aaa8138ac7389eb07a4f30d0dc2ffb07855..b49fc88edee07aba640a4af55da644521cd3bd64 100644 (file)
@@ -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);
   }
 }