Bugs item #2791704, was opened at 2009-05-14 14:51
Message generated for change (Comment added) made by tsheyar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2791704&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: PF/compiler
>Group: Pathfinder "stable"
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Floris Ouwendijk (floris233)
>Assigned to: Jan Rittinger (tsheyar)
Summary: Unuseable 'doc-available' test

Initial Comment:
Given the following code, I'd assume to get an empty b element (for a database 
not containing the given document). 

if (doc-available('asdasda'))
then doc('asdasda')
else element b{}

The result happens to be
QUERY = if (doc-available('asdasda'))
ERROR = !ERROR: [shred_url]: 1 times inserted nil due to errors at tuples 
0...@0.
        !ERROR: [shred_url]: first error was:
        !ERROR: shred: cannot stat `asdasda': No such file or directory
        !ERROR: CMDshred_url: operation failed.
        !ERROR: interpret_params: leftfetchjoin(param 2): evaluation error.

If I do
if (doc-available('asdasda'))
then  element a{}
else element b{}

Then i get b.



----------------------------------------------------------------------

>Comment By: Jan Rittinger (tsheyar)
Date: 2009-05-20 16:44

Message:
I implemented the side effect for fn:doc (as proposed before) in the
algebra:
An error is now only triggered whenever the condition chooses the branch
with the non-exisiting document.

Added test (unuseable_doc-available.SF-2791704).

Note: The call to fn:doc (and all subsequent operations) in the
then-branch are still evaluated... 

----------------------------------------------------------------------

Comment By: Jan Rittinger (tsheyar)
Date: 2009-05-14 17:44

Message:
The only clean solution I see is to mimic the side effects in the algebra
and remove the error from the doc_tbl MIL proc.

----------------------------------------------------------------------

Comment By: Jan Rittinger (tsheyar)
Date: 2009-05-14 16:33

Message:
Hmmm... 

I have no good solution for that but I can explain the problem: The
algebraic optimizer detected that the if-, then-, and else-branches are
independent of each other. Therefore all three expressions (also containing
the doc() call) are evaluated in parallel and their respective interaction
is only resolved later.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2791704&group_id=56967

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to