[Mulgara-dev] CONSTRUCT query regression?

Paul Gearon gearon at ieee.org
Tue Dec 7 03:50:35 UTC 2010


Hi,

Well, what was a nasty cough turned into bronchitis, and has left me
feeling miserable for weeks now. So I'm sorry to be taking so long to
get things done. But I looked at this tonight...


On Wed, Dec 1, 2010 at 8:07 PM, Hugh Cayless <hugh.cayless at nyu.edu> wrote:
> Or, better:
>
> Index: GraphAnswer.java
> ===================================================================
> --- GraphAnswer.java    (revision 1989)
> +++ GraphAnswer.java    (working copy)
> @@ -280,7 +280,7 @@
>     boolean nextResult;
>     do {
>       nextResult = rawAnswer.next();
> -    } while (hasUnboundVar());
> +    } while (nextResult && hasUnboundVar());

Heh. Seems obvious now that you point it out.

There is no way that rawAnswer.next() should be called again if it
returns false. That's a really obvious error. Thanks for figuring it
out, especially given that the stacktrace was so misleading.

> On Dec 1, 2010, at 12:38 PM, Hugh Cayless wrote:
>
>> I've gotten a bit further with this.  What seems to be happening is the hasUnboundVar() method (which looks like it skips rows with unbound variables?) that was added in r1970 (http://www.mulgara.org/trac/changeset/1970), checks for a null object from rawAnswer.getObject.  But if you're at the end of the result set it gets instead a TuplesException, thrown from org.mulgara.store.statement.xa.TripleAVLFile.  This bubbles up, getting its message and stacktrace lost in the process, and messes up the transaction.
>>
>> It looks like the logic in internalNext() just needs to be rewritten to check whether rawAnswer.next() is true before calling hasUnboundVar().
>>
>> The following patch does that, and works for my current data set at least.  I don't have my head around the code base enough to know if there are other potential side effects though.

Well, I'm happy to help with getting your head around any of the code
that seems obscure, if you're interested. Meanwhile, what you've done
is just right. If there are side effects, then that was poor coding on
my part, and not your fault. (ie. I hope there aren't any!)  Thanks.

Paul


More information about the Mulgara-dev mailing list