r9564 - helma/helma/trunk/src/helma/objectmodel/db

[email protected]
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20090401160614.129EE3D0D6@mia>
Author: hannes
Date: 2009-04-01 18:06:13 +0200 (Wed, 01 Apr 2009)
New Revision: 9564

Modified:
   helma/helma/trunk/src/helma/objectmodel/db/Relation.java
Log:
Simplify even more.

Details at http://dev.helma.org/trac/helma/changeset/9564

Modified: helma/helma/trunk/src/helma/objectmodel/db/Relation.java
===================================================================
--- helma/helma/trunk/src/helma/objectmodel/db/Relation.java	2009-04-01 16:03:30 UTC (rev 9563)
+++ helma/helma/trunk/src/helma/objectmodel/db/Relation.java	2009-04-01 16:06:13 UTC (rev 9564)
@@ -921,13 +921,12 @@
         if (maxSize > 0) {
             if (otherType.isOracle()) {
                 // see http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
-                int maxRow = offset + maxSize;
                 if (offset > 0) {
                     q.insert(0, "SELECT * FROM ( SELECT /*+ FIRST_ROWS(n) */ a.*, ROWNUM rnum FROM (");
-                    q.append(") a WHERE ROWNUM <= ").append(maxRow).append(") WHERE rnum > ").append(offset);
+                    q.append(") a WHERE ROWNUM <= ").append(offset + maxSize).append(") WHERE rnum > ").append(offset);
                 } else {
                     q.insert(0, "SELECT /*+ FIRST_ROWS(n) */ * FROM (");
-                    q.append(") WHERE ROWNUM <= ").append(maxRow);
+                    q.append(") WHERE ROWNUM <= ").append(maxSize);
                 }
             } else {
                 q.append(" LIMIT ").append(maxSize);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.