db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r388908 - in /db/torque: runtime/trunk/src/java/org/apache/torque/util/LimitHelper.java test/trunk/test-project/src/java/org/apache/torque/DataTest.java
Date Sun, 26 Mar 2006 13:25:54 GMT
Author: tfischer
Date: Sun Mar 26 05:25:53 2006
New Revision: 388908

URL: http://svn.apache.org/viewcvs?rev=388908&view=rev
Log:
- changed DataTest to catch bad limit clauses for a limit of zero
- Fixed postgresql Oracle and DB2 limit for a limit of zero

Modified:
    db/torque/runtime/trunk/src/java/org/apache/torque/util/LimitHelper.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java

Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/LimitHelper.java
URL: http://svn.apache.org/viewcvs/db/torque/runtime/trunk/src/java/org/apache/torque/util/LimitHelper.java?rev=388908&r1=388907&r2=388908&view=diff
==============================================================================
--- db/torque/runtime/trunk/src/java/org/apache/torque/util/LimitHelper.java (original)
+++ db/torque/runtime/trunk/src/java/org/apache/torque/util/LimitHelper.java Sun Mar 26 05:25:53
2006
@@ -134,7 +134,7 @@
         }
         else
         {
-            if (limit > 0)
+            if (limit >= 0)
             {
                 limitStringBuffer.append(limit);
             }
@@ -178,7 +178,7 @@
             postLimit.append(" B.TORQUE$ROWNUM > ")
                     .append(offset);
 
-            if (limit > 0)
+            if (limit >= 0)
             {
                 postLimit.append(" AND B.TORQUE$ROWNUM <= ")
                         .append(offset + limit);
@@ -228,7 +228,7 @@
             postLimit.append(" B.TORQUE$ROWNUM > ")
                     .append(offset);
 
-            if (limit > 0)
+            if (limit >= 0)
             {
                 postLimit.append(" AND B.TORQUE$ROWNUM <= ")
                         .append(offset + limit);

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java
URL: http://svn.apache.org/viewcvs/db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java?rev=388908&r1=388907&r2=388908&view=diff
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java (original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java Sun Mar 26
05:25:53 2006
@@ -68,7 +68,6 @@
 import org.apache.torque.util.CountHelper;
 import org.apache.torque.util.Criteria;
 
-import com.workingdogs.village.DataSetException;
 import com.workingdogs.village.Record;
 
 /**
@@ -224,12 +223,13 @@
         }
         catch (TorqueException e)
         {
-        	if (!Torque.getDB(Torque.getDefaultDB()).supportsNativeLimit())
-        	{
-                log.error("testLimitOffset(): "
-                		+ "A limit of 0 is not supported for Databases "
-        				+ "without native limit support");
-        	}
+        	if (Torque.getDB(Torque.getDefaultDB()).supportsNativeLimit())
+            {
+        	    throw e;   
+            }
+            log.error("testLimitOffset(): "
+                    + "A limit of 0 is not supported for Databases "
+                    + "without native limit support");
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message