This one time, at band camp, OGURA Junya said:

OJ>Hello guys,
OJ>
OJ>  I got following backend error when using LIMIT clause with
OJ>  CastorJDO 0.9.4.3 and PostgreSQL 7.3.1.
OJ>
OJ>    ERROR:  LIMIT #,# syntax not supported.
OJ>            Use separate LIMIT and OFFSET clauses.
OJ>
OJ>  PostgreSQL 7.3 doesn't support 'LIMIT #,#' as mentioned below URL.
OJ>
OJ>    http://developer.postgresql.org/docs/postgres/release-7-3.html#AEN24452
OJ>
OJ>  Is this behavior already fixed in CVS?
OJ>  I rewrote PostgreSQLQueryExpression#Statement method to
OJ>  generate 'OFFSET # LIMIT #' style SQL, and seems to work correctly.
OJ>
OJ>
OJ>Index: src/main/org/exolab/castor/jdo/drivers/PostgreSQLQueryExpression.java
OJ>===================================================================
OJ>RCS file: 
/cvs/castor/castor/src/main/org/exolab/castor/jdo/drivers/PostgreSQLQueryExpression.java,v
OJ>retrieving revision 1.13
OJ>diff -u -r1.13 PostgreSQLQueryExpression.java
OJ>--- src/main/org/exolab/castor/jdo/drivers/PostgreSQLQueryExpression.java    19 Apr 
2001 23:18:40 -0000      1.13
OJ>+++ src/main/org/exolab/castor/jdo/drivers/PostgreSQLQueryExpression.java    20 Feb 
2003 09:34:46 -0000
OJ>@@ -49,6 +49,7 @@
OJ> 
OJ> import java.util.Enumeration;
OJ> import java.util.Hashtable;
OJ>+import java.util.StringTokenizer;
OJ> import java.util.Vector;
OJ> import org.exolab.castor.jdo.engine.JDBCSyntax;
OJ> import org.exolab.castor.persist.spi.PersistenceFactory;
OJ>@@ -77,8 +78,11 @@
OJ> 
OJ>         sql = getStandardStatement( lock, false );
OJ> 
OJ>-        if ( _limit != null )
OJ>-          sql.append(JDBCSyntax.Limit).append(_limit);
OJ>+        if ( _limit != null ) {
OJ>+          StringTokenizer tokenizer = new StringTokenizer(_limit, ",", false);
OJ>+          sql.append(JDBCSyntax.Offset).append(tokenizer.nextToken());
OJ>+          sql.append(JDBCSyntax.Limit).append(tokenizer.nextToken());
OJ>+        }
OJ> 
OJ>         // Use FOR UPDATE to lock selected tables.
OJ>         if ( lock )
OJ>Index: src/main/org/exolab/castor/jdo/engine/JDBCSyntax.java
OJ>===================================================================
OJ>RCS file: /cvs/castor/castor/src/main/org/exolab/castor/jdo/engine/JDBCSyntax.java,v
OJ>retrieving revision 1.7
OJ>diff -u -r1.7 JDBCSyntax.java
OJ>--- src/main/org/exolab/castor/jdo/engine/JDBCSyntax.java    17 Dec 2000 15:40:04 
-0000      1.7
OJ>+++ src/main/org/exolab/castor/jdo/engine/JDBCSyntax.java    20 Feb 2003 09:34:46 
-0000
OJ>@@ -89,5 +89,7 @@
OJ> 
OJ>     public String Limit = " LIMIT "; //Alex
OJ> 
OJ>+    public String Offset = " OFFSET ";
OJ>+
OJ> }


OGURA, 

This is not fixed in CVS. Please file a report in Bugzilla
(http://bugzilla.exolab.org/) and attache a contextual diff (diff -u) to that
report. 

BTW, thank you for your contribution. 

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to