svn commit: r981622 - /ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLSelect.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r981622 - /ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLSelect.java

doogie-3
Author: doogie
Date: Mon Aug  2 17:42:28 2010
New Revision: 981622

URL: http://svn.apache.org/viewvc?rev=981622&view=rev
Log:
BUG FIX: OFFSET/LIMIT have to be after ORDER BY/GROUP BY.

Modified:
    ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLSelect.java

Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLSelect.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLSelect.java?rev=981622&r1=981621&r2=981622&view=diff
==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLSelect.java (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/SQLSelect.java Mon Aug  2 17:42:28 2010
@@ -146,12 +146,6 @@ public final class SQLSelect extends SQL
             sb.append(" HAVING ");
             havingCondition.appendTo(sb);
         }
-        if (offset != -1) {
-            sb.append(" OFFSET ").append(offset);
-        }
-        if (limit != -1) {
-            sb.append(" LIMIT ").append(limit);
-        }
         if (groupBy != null) {
             sb.append(" GROUP BY ");
             StringUtil.append(sb, groupBy, null, null, ", ");
@@ -160,6 +154,12 @@ public final class SQLSelect extends SQL
             sb.append(" ORDER BY ");
             StringUtil.append(sb, orderBy, null, null, ", ");
         }
+        if (offset != -1) {
+            sb.append(" OFFSET ").append(offset);
+        }
+        if (limit != -1) {
+            sb.append(" LIMIT ").append(limit);
+        }
         sb.append(';');
         return sb;
     }