incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1221968 - /incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Date Thu, 22 Dec 2011 00:29:50 GMT
Author: kwright
Date: Thu Dec 22 00:29:50 2011
New Revision: 1221968

URL: http://svn.apache.org/viewvc?rev=1221968&view=rev
Log:
Get the offset/limit clause syntax right

Modified:
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java?rev=1221968&r1=1221967&r2=1221968&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Thu Dec 22 00:29:50 2011
@@ -768,14 +768,16 @@ public class DBInterfaceMySQL extends Da
   public String constructOffsetLimitClause(int offset, int limit, boolean afterOrderBy)
   {
     StringBuilder sb = new StringBuilder();
-    if (offset != 0)
-      sb.append("OFFSET ").append(Integer.toString(offset));
     if (limit != -1)
     {
-      if (offset != 0)
-        sb.append(" ");
       sb.append("LIMIT ").append(Integer.toString(limit));
     }
+    if (offset != 0)
+    {
+      if (limit != -1)
+        sb.append(" ");
+      sb.append("OFFSET ").append(Integer.toString(offset));
+    }
     return sb.toString();
   }
 



Mime
View raw message