You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/05/21 16:08:15 UTC
svn commit: r1125704 - in
/incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb:
compiler/SDBCompile.java core/SDBRequest.java
Author: andy
Date: Sat May 21 14:08:14 2011
New Revision: 1125704
URL: http://svn.apache.org/viewvc?rev=1125704&view=rev
Log:
Explicitly set defaults for each database type when creating a request.
Modified:
incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/compiler/SDBCompile.java
incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/core/SDBRequest.java
Modified: incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/compiler/SDBCompile.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/compiler/SDBCompile.java?rev=1125704&r1=1125703&r2=1125704&view=diff
==============================================================================
--- incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/compiler/SDBCompile.java (original)
+++ incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/compiler/SDBCompile.java Sat May 21 14:08:14 2011
@@ -41,40 +41,69 @@ public class SDBCompile
if ( binding != null && ! binding.isEmpty() )
op = Substitute.substitute(op, binding) ;
+ // Defaults are set in SDBCompile.compile
+ // LeftJoinTranslation = true ; -- Does the DB support general join expressions?
+ // LimitOffsetTranslation = false ; -- Does the DB grok the Limit/Offset SQL?
+ // DistinctTranslation = true ; -- Some DBs can't do DISTINCT on CLOBS.
+
+
if ( StoreUtils.isHSQL(store) )
{
- request.LeftJoinTranslation = false ;
- request.LimitOffsetTranslation = false ; // ?? HSQLDB does not like the nested SQL.
+ request.LeftJoinTranslation = false ; // Does not deal with non-linear join trees.
+ request.DistinctTranslation = true ;
+ request.LimitOffsetTranslation = false ; // Does not cope with the nested SQL
}
if ( StoreUtils.isH2(store) )
{
- request.LeftJoinTranslation = false ;
- request.LimitOffsetTranslation = false ; // ?? H2 does not like the nested SQL.
+ request.LeftJoinTranslation = false ; // Does not deal with non-linear join trees.
+ request.DistinctTranslation = true ;
+ request.LimitOffsetTranslation = false ; // Does not cope with the nested SQL
}
// Any of these need fixing and testing ...
if ( StoreUtils.isDerby(store) )
+ {
+ request.LeftJoinTranslation = true ;
+ request.LimitOffsetTranslation = false ;
request.DistinctTranslation = false ;
+ }
if ( StoreUtils.isPostgreSQL(store) )
+ {
+ request.LeftJoinTranslation = true ;
request.LimitOffsetTranslation = true ;
+ request.DistinctTranslation = true ;
+ }
if ( StoreUtils.isMySQL(store) )
+ {
+ request.LeftJoinTranslation = true ;
request.LimitOffsetTranslation = true ;
+ request.DistinctTranslation = true ;
+ }
if ( StoreUtils.isSQLServer(store) )
+ {
+ request.LeftJoinTranslation = true ;
+ request.LimitOffsetTranslation = false ;
request.DistinctTranslation = false ;
+ }
if ( StoreUtils.isOracle(store) )
{
- request.DistinctTranslation = false ;
+ request.LeftJoinTranslation = true ;
request.LimitOffsetTranslation = false ;
+ request.DistinctTranslation = false ;
}
if ( StoreUtils.isDB2(store) )
+ {
+ request.LeftJoinTranslation = true ;
+ request.LimitOffsetTranslation = false ;
request.DistinctTranslation = false ;
+ }
QueryCompiler queryCompiler = store.getQueryCompilerFactory().createQueryCompiler(request) ;
Op op2 = queryCompiler.compile(op) ;
Modified: incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/core/SDBRequest.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/core/SDBRequest.java?rev=1125704&r1=1125703&r2=1125704&view=diff
==============================================================================
--- incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/core/SDBRequest.java (original)
+++ incubator/jena/Jena2/SDB/trunk/src/com/hp/hpl/jena/sdb/core/SDBRequest.java Sat May 21 14:08:14 2011
@@ -36,7 +36,7 @@ public class SDBRequest extends StoreHol
// Set in SDBCompile.compile
public boolean LeftJoinTranslation = true ; // Does the DB support general join expressions?
- public boolean LimitOffsetTranslation = true ; // Does the DB grok the Limit/Offset SQL?
+ public boolean LimitOffsetTranslation = false ; // Does the DB grok the Limit/Offset SQL?
public boolean DistinctTranslation = true ; // Some DBs can't do DISTINCt on CLOBS.
private Context context ;