Hi Jennie, I can only answer the second question (what triggered the warning): In the type checking a warning is triggered in case we get back the type none+ because we assumed at some time that type none represents an error. Because you had to instances of put you got the result type none+ (as with query '(put (<a/>, "foo"), put (<b/>, "bar"))'). The answer to the first question is probably hidden in milprint_summer.c and the way it generates code for put() as the generated core code still contains both calls to put(). Jan On 07/04/2008 03:01 PM, Ying Zhang wrote with possible deletions:
Hello,
In stable branch + milprint_summer, executing the following query (you need to have a "hello.xml" doc shredded in collection "hello"):
let $path := 'backup/test/hello/' let $index := element documents { for $document at $pos in pf:documents('hello') let $uri := concat($path, string(10000 + (($pos div 10000)) cast as xs:integer), '/', string($pos) , '.xml') return (text { " " }, element document { attribute uri {$uri}, $document/text() }), text { " " } } return (put($index, concat($path,'documents.xml')), for $document in $index/document return put(exactly-one(doc(string($document))), exactly-one($document/@uri)))
Results in the first 'put' is done, while the second 'put' is not executed, actually, the MIL code generated by 'pf' contains only translation of (the first) one 'put'. Also, the query gives a warning: query will always return an error If I comment out the first 'put', the second 'put' in the for-loop get executed, *without* the warning.
Executing a similar query:
(put(<a/>, "a.xml"), for $n in ("b.xml", "c.xml") return put(exactly-one(doc("hello.xml")), $n) )
also results in the warning, however, the generated MIL code contains translation of both 'put' and three documents are put in dbfarm.
I'd like to know why the first query fails, and what has triggered the warning. Thanks a lot!
Kind regards,
Jennie
------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Jan Rittinger Database Systems Technische Universität München (Germany) http://www-db.in.tum.de/~rittinge/