Bugs item #2388047, was opened at 2008-12-04 11:37
Message generated for change (Comment added) made by sjoerd
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2388047&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Floris Ouwendijk (floris233)
Assigned to: Nobody/Anonymous (nobody)
Summary: Mclient exit code

Initial Comment:
While investigating a problem where a collection-query returns invalid data, I 
ran into problems with mclient seemingly not generating a proper exit value.

If I run:
$ mclient -lxq -p49980 -s"element { \"log\" } {
pf:collection(\"cons02_log.xml\")//run }"
-removed a lot of xml-
</stdout>

<fault!ERROR: XML Generation: tmp_3265 BAT does not have a 24 head.
MAPI = mone...@bo...:49980
QUERY = element { "log" } { pf:collection("cons02_log.xml")//run }
ERROR = !ERROR:
!ERROR: XML Generation: NULL BAT has a 24 head, but tail is NULL.
!ERROR:
!ERROR: xquery_print_result_main: operation failed.
$ echo $?
0

The above returns a lot of correct XML, then dumps an error to stderr, but 
returns error code 0.
In contrast, the following works as expected:

$ mclient -lxq -p49980 -s"eelement { \"log\" } {
pf:collection(\"cons02_log.xml\")//run }" >/dev/null
MAPI = mone...@server:49980
QUERY = eelement { "log" } { pf:collection("cons02_log.xml")//run }
ERROR = !parse error: syntax error, unexpected {, expecting $end on line
1, column 10 (next token is `{')
!parse error: XQuery parsing failed
!# halted in parser.tab.c (PFparse), line 5716
$ echo $?
1

Which is the expected result for a flawed query.

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

Comment By: Sjoerd Mullender (sjoerd)
Date: 2008-12-15 11:13

Message:
I could implement something, but I'd first like to know what it is we want.

If there is a single query which fails, the answer is obvious: mclient
should exit with an error.
But what if there are multiple queries (assuming mclient continues--if
not, file a different bug report), but the last query succeeds.  What
should mclient return?  Should it return an indication that somewhere along
the line a query failed, or should it just return the status of the last
query?  And what if mclient is really interactive?

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

Comment By: Peter Boncz (boncz)
Date: 2008-12-12 00:07

Message:
Sjoerd: the above was a true bug that led to a runtime error. However, mapi
did see an error hence the error code of mclient should have been set.

On a related note, I have noticed that when in xquery mode and handling a
script with multiple queries (with the <> seprator), after a (correct)
XQuery error (nonexisting document, I believe( mclients stops executing the
remaining queries (and actualy hangs). Do not know whether this happens
always.

This behavior hinders the ability of NFI to replay logs, because sometimes
not all documents used in a log are available, hence errors are bound to
occur.

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

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

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to