
Dear users, 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 = monetdb@botswana.xiraf: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 = monetdb@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. Do you agree this is a problem that should be reported, or is there a better way of finding out whether there were problems running the query? Kind regards, Floris