From 75029eae76d4caece7a425aa3b9094163f78181f Mon Sep 17 00:00:00 2001 From: Lukas Jungmann Date: Thu, 30 May 2024 15:49:39 +0200 Subject: [PATCH] Add missing offset for mysql pagination Signed-off-by: Lukas Jungmann --- .../eclipse/persistence/platform/database/MySQLPlatform.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/MySQLPlatform.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/MySQLPlatform.java index e5b7931250b..4f6716cf756 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/MySQLPlatform.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/MySQLPlatform.java @@ -83,6 +83,7 @@ public class MySQLPlatform extends DatabasePlatform { private static final String LIMIT = " LIMIT "; + private static final String OFFSET = " OFFSET "; /** Support fractional seconds in time values since MySQL v. 5.6.4. */ private boolean isFractionalTimeSupported; @@ -908,9 +909,9 @@ public void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter prin statement.setUseUniqueFieldAliases(true); call.setFields(statement.printSQL(printer)); printer.printString(LIMIT); - printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD); - printer.printString(", "); printer.printParameter(DatabaseCall.MAXROW_FIELD); + printer.printString(OFFSET); + printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD); statement.appendForUpdateClause(printer); call.setIgnoreFirstRowSetting(true); call.setIgnoreMaxResultsSetting(true);