
I imagine this result happens due to the way conditionals are processed when doing bulk processing. Unless the conditional is constant (Lefteris' case), first both the "true" and "false" branches are calculated, and then one or the other is selected depending on the conditional. But, please, report as bug. Floris Ouwendijk (DT) wrote:
So it is not expected behavior? Then I'll enter a bug report.
Floris
-----Original Message----- From: Lefteris [mailto:lsidir@gmail.com] Sent: donderdag 14 mei 2009 13:31 To: Communication channel for MonetDB users Subject: Re: [MonetDB-users] doc-available unuseable?
This is a weird bug.
if (0) then doc('asdasda') else element b{}
will return <b/>
while
if (doc-available('asdasda')) then doc('lala') else element b{}
will return the shred error.
On Thu, May 14, 2009 at 12:43 PM, Floris Ouwendijk (DT)
wrote: Hi,
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.
What is the proper way to return some default value when a document is not available in the database? Or is this the proper way and should this be reported as a bug?
Kind regards,
Floris
---------------------------------------------------------------------- -------- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Sjoerd Mullender