Strabon

changeset 96:00cdb7b244b4

simple workaround for MonetDB Bug http://bugs.monetdb.org/show_bug.cgi?id=3065. (Remove these changes when bug is fixed)
author George Garbis <ggarbis@di.uoa.gr>
date Thu Apr 05 12:56:46 2012 +0300 (2012-04-05)
parents 31fea69dccba
children 369029414139
files generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBSqlTable.java generaldb/src/main/java/org/openrdf/sail/generaldb/schema/GeoValueTable.java generaldb/src/main/java/org/openrdf/sail/generaldb/schema/ValueTable.java monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBSqlTable.java monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBSqlExprBuilder.java postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBSqlTable.java	Thu Apr 05 12:45:48 2012 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBSqlTable.java	Thu Apr 05 12:56:46 2012 +0300
     1.3 @@ -48,4 +48,6 @@
     1.4  	public abstract String buildDummyFromAndWhere(String fromDummy);
     1.5  	
     1.6  	public abstract String buildDynamicParameterInteger();
     1.7 +	
     1.8 +	public abstract String buildWhere();
     1.9  }
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/GeoValueTable.java	Thu Apr 05 12:45:48 2012 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/GeoValueTable.java	Thu Apr 05 12:56:46 2012 +0300
     2.3 @@ -139,7 +139,7 @@
     2.4  		INSERT = sb.toString();
     2.5  		sb.delete(0, sb.length());
     2.6  		sb.append("DELETE FROM ").append(table.getName()).append("\n");
     2.7 -		sb.append("WHERE 1=1 ");
     2.8 +		sb.append(((GeneralDBSqlTable)table).buildWhere());
     2.9  		EXPUNGE = sb.toString();
    2.10  		if (temporary != null) {
    2.11  			sb.delete(0, sb.length());
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/ValueTable.java	Thu Apr 05 12:45:48 2012 +0300
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/ValueTable.java	Thu Apr 05 12:56:46 2012 +0300
     3.3 @@ -136,7 +136,7 @@
     3.4  		INSERT = sb.toString();
     3.5  		sb.delete(0, sb.length());
     3.6  		sb.append("DELETE FROM ").append(table.getName()).append("\n");
     3.7 -		sb.append("WHERE 1=1 ");
     3.8 +		sb.append(table.buildWhere());
     3.9  		EXPUNGE = sb.toString();
    3.10  		if (temporary != null) {
    3.11  			sb.delete(0, sb.length());
     4.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBSqlTable.java	Thu Apr 05 12:45:48 2012 +0300
     4.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBSqlTable.java	Thu Apr 05 12:56:46 2012 +0300
     4.3 @@ -74,4 +74,9 @@
     4.4  	public String buildDynamicParameterInteger() {
     4.5  			return "CAST( ? AS INTEGER)";
     4.6  	}
     4.7 +	
     4.8 +	@Override
     4.9 +	public String buildWhere() {
    4.10 +		return " WHERE (1=1 OR 1=1) ";
    4.11 +	}
    4.12  }
    4.13 \ No newline at end of file
     5.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBSqlExprBuilder.java	Thu Apr 05 12:45:48 2012 +0300
     5.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBSqlExprBuilder.java	Thu Apr 05 12:56:46 2012 +0300
     5.3 @@ -25,10 +25,10 @@
     5.4  	@Override
     5.5  	public void appendBoolean(boolean booleanValue) {
     5.6  		if (booleanValue) {
     5.7 -			where.append(" (1=1) ");
     5.8 +			where.append(" (1=1 or 1=1) ");
     5.9  		}
    5.10  		else {
    5.11 -			where.append(" (0=1) ");
    5.12 +			where.append(" (0=1 or 0=1) ");
    5.13  		}
    5.14  	}
    5.15  	
     6.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java	Thu Apr 05 12:45:48 2012 +0300
     6.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java	Thu Apr 05 12:56:46 2012 +0300
     6.3 @@ -75,4 +75,9 @@
     6.4  	public String buildDynamicParameterInteger() {
     6.5  			return "?";
     6.6  	}
     6.7 +	
     6.8 +	@Override
     6.9 +	public String buildWhere() {
    6.10 +		return " WHERE (1=1) ";
    6.11 +	}
    6.12  }
    6.13 \ No newline at end of file