[Mulgara-svn] r745 - branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples

pag at mulgara.org pag at mulgara.org
Mon Apr 7 18:20:26 UTC 2008


Author: pag
Date: 2008-04-07 11:20:25 -0700 (Mon, 07 Apr 2008)
New Revision: 745

Modified:
   branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/LeftJoin.java
Log:
Corrected getColumnValue for the unbound case, and made isColumnEverUnbond more prudent

Modified: branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/LeftJoin.java
===================================================================
--- branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/LeftJoin.java	2008-04-05 04:51:46 UTC (rev 744)
+++ branches/mgr-61-sparql/src/jar/tuples/java/org/mulgara/store/tuples/LeftJoin.java	2008-04-07 18:20:25 UTC (rev 745)
@@ -132,7 +132,7 @@
     int nrLeftVars = lhs.getNumberOfVariables();
     if (column < nrLeftVars) return lhs.getColumnValue(column);
     // return the column minus the LHS columns, and then skip over the matching vars
-    return rhs.getColumnValue(column - rhsOffset);
+    return rightMatches ? rhs.getColumnValue(column - rhsOffset) : UNBOUND;
   }
 
 
@@ -148,8 +148,12 @@
   public boolean isColumnEverUnbound(int column) throws TuplesException {
     int nrLeftVars = lhs.getNumberOfVariables();
     if (column < nrLeftVars) return lhs.isColumnEverUnbound(column);
-    // return the column minus the LHS columns, and then skip over the matching vars
-    return rhs.isColumnEverUnbound(column - rhsOffset);
+    // If there are rows on the left that are not in the right, then this columns will be unbound
+
+    // Can't know for sure if the column is unbound without iterating through
+    if (rhs.isColumnEverUnbound(column - rhsOffset)) return true;
+    // err on the side of caution
+    return true;
   }
 
 




More information about the Mulgara-svn mailing list