Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-09-26 07:00:47 -0400
committerEike Stepper2013-09-26 07:00:47 -0400
commit5724abfa18a9c87554e280785606ed74fcb8a5f9 (patch)
tree54df228a80e656aea38d7b406563a8f1d7c458cd
parentfdd764efa685c0b0451aa03928b0d34104c52f79 (diff)
downloadcdo-5724abfa18a9c87554e280785606ed74fcb8a5f9.tar.gz
cdo-5724abfa18a9c87554e280785606ed74fcb8a5f9.tar.xz
cdo-5724abfa18a9c87554e280785606ed74fcb8a5f9.zip
[418083] [DB] SQLQueryHandler should not call next() after absolute()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=418083
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java10
-rw-r--r--plugins/org.eclipse.net4j.db.h2/src/org/eclipse/net4j/db/h2/H2Adapter.java9
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java5
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java8
4 files changed, 2 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java
index d4ac989418..7a7ee12bdc 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/SQLQueryHandler.java
@@ -17,12 +17,10 @@ import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.util.CDOQueryInfo;
import org.eclipse.emf.cdo.server.IQueryContext;
import org.eclipse.emf.cdo.server.IQueryHandler;
-import org.eclipse.emf.cdo.server.db.IDBStore;
import org.eclipse.emf.cdo.server.db.IIDHandler;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
-import org.eclipse.net4j.db.IDBAdapter;
import org.eclipse.net4j.db.IDBPreparedStatement;
import org.eclipse.net4j.db.IDBPreparedStatement.ReuseProbability;
@@ -199,11 +197,7 @@ public class SQLQueryHandler implements IQueryHandler
resultSet = stmt.executeQuery();
if (firstResult > -1)
{
- IDBStore store = (IDBStore)context.getView().getRepository().getStore();
- IDBAdapter dbAdapter = store.getDBAdapter();
-
- int row = dbAdapter.convertRowNumberToDriver(1 + firstResult);
- resultSet.absolute(row);
+ resultSet.absolute(1 + firstResult);
}
String[] columnNames = null;
@@ -219,7 +213,7 @@ public class SQLQueryHandler implements IQueryHandler
int maxResults = info.getMaxResults();
int counter = 0;
- while (resultSet.next())
+ while (firstResult > -1 || resultSet.next())
{
if (maxResults != CDOQueryInfo.UNLIMITED_RESULTS && counter++ >= maxResults)
{
diff --git a/plugins/org.eclipse.net4j.db.h2/src/org/eclipse/net4j/db/h2/H2Adapter.java b/plugins/org.eclipse.net4j.db.h2/src/org/eclipse/net4j/db/h2/H2Adapter.java
index b2df3d8a9f..02ef7e0c81 100644
--- a/plugins/org.eclipse.net4j.db.h2/src/org/eclipse/net4j/db/h2/H2Adapter.java
+++ b/plugins/org.eclipse.net4j.db.h2/src/org/eclipse/net4j/db/h2/H2Adapter.java
@@ -97,15 +97,6 @@ public class H2Adapter extends DBAdapter
}
/**
- * See H2 bug http://code.google.com/p/h2database/issues/detail?id=508
- */
- @Override
- public int convertRowNumberToDriver(int row)
- {
- return row - 1;
- }
-
- /**
* @since 4.2
*/
public static void createSchema(DataSource dataSource, final String name, final boolean dropIfExists)
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java
index 77eabe24ae..a4fe9b7dfa 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBAdapter.java
@@ -149,9 +149,4 @@ public interface IDBAdapter
* @since 4.2
*/
public String sqlModifyField(IDBField field);
-
- /**
- * @since 4.3
- */
- public int convertRowNumberToDriver(int row);
}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java
index e140e5bbc9..4011df2b89 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java
@@ -1085,14 +1085,6 @@ public abstract class DBAdapter implements IDBAdapter
}
/**
- * @since 4.3
- */
- public int convertRowNumberToDriver(int row)
- {
- return row;
- }
-
- /**
* @since 4.2
*/
public String format(PreparedStatement stmt)

Back to the top