On Wed, Jul 02, 2008 at 07:26:44AM -0700, luc touraille wrote:
Hi,
Currently working on a big project with MonetDB XQuery, I stumbled upon an awkward bug (unless it is a *very* perturbing feature): after deleting a document in a collection "myColl", using the function pf:del-doc, this document is still displayed when calling fn:collection("myColl"), and not when using pf:collection("myColl"). I assume the latter result is the expected one, so why is the first query displaying data that is not supposed to be in the database anymore ? Have I misunderstood something or is it a true bug (maybe related to the http://www.nabble.com/--monetdb-Bugs-1976341---XQ%3A-leftovers-after-deletin... bug #1976341 : leftovers after deleting a document ) ?
N.B.: this problem occured with the Feb 2008 release; I tried to reproduce it with the Jun 2008 release, and this time it's the pf:collection() function that gave me the wrong results (the fn: one being unsupported yet).
Greetings,
Luc Touraille
Hi Luc, thanks for reporting this problem! (and sorry for the inconveniences...) With the Jun 2008 release, I can reproduce your bug (at least I consider it a bug, too) (only) in case there is more than one document in a collection (see below). Could you please file this as a bug report at SF? (http://sourceforge.net/tracker/?atid=482468&group_id=56967&func=browse) We'll try to investigate and fix this bug as soon as we have time. Stefan ======== $ cat /tmp/MyDoc1.xml -------- <a/> ======== $ cat /tmp/MyDoc2.xml -------- <b/> ======== ======== $ mclient -lx -s'pf:add-doc("/tmp/MyDoc1.xml","MyDoc1","MyCol")' -------- ======== $ mclient -lx -s'pf:collections()' -------- <collection updatable="false" size="99 KiB" numDocs="1">MyCol</collection> ======== $ mclient -lx -s'pf:collection("MyCol")' -------- <a/> ======== $ mclient -lx -g -s'fn:collection("MyCol")' -------- <?xml version="1.0" encoding="utf-8"?> <a/> ======== $ mclient -lx -s'pf:documents()' -------- <document updatable="false" url="/tmp/MyDoc1.xml" collection="MyCol">MyDoc1</document> ======== $ mclient -lx -s'pf:documents("MyCol")' -------- <document updatable="false" url="/tmp/MyDoc1.xml" collection="MyCol">MyDoc1</document> ======== ======== $ mclient -lx -s'pf:del-doc("MyDoc1")' -------- ======== $ mclient -lx -s'pf:collections()' -------- ======== $ mclient -lx -s'pf:collection("MyCol")' -------- ======== $ mclient -lx -g -s'fn:collection("MyCol")' -------- ======== $ mclient -lx -s'pf:documents()' -------- ======== $ mclient -lx -s'pf:documents("MyCol")' -------- ======== ======== $ mclient -lx -s'pf:add-doc("/tmp/MyDoc1.xml","MyDoc1","MyCol")' -------- ======== $ mclient -lx -s'pf:add-doc("/tmp/MyDoc2.xml","MyDoc2","MyCol")' -------- ======== $ mclient -lx -s'pf:collections()' -------- <collection updatable="false" size="99 KiB" numDocs="2">MyCol</collection> ======== $ mclient -lx -s'pf:collection("MyCol")' -------- <a/><b/> ======== $ mclient -lx -g -s'fn:collection("MyCol")' -------- <?xml version="1.0" encoding="utf-8"?> <a/> , <?xml version="1.0" encoding="utf-8"?> <b/> ======== $ mclient -lx -s'pf:documents()' -------- <document updatable="false" url="/tmp/MyDoc1.xml" collection="MyCol">MyDoc1</document>, <document updatable="false" url="/tmp/MyDoc2.xml" collection="MyCol">MyDoc2</document> ======== $ mclient -lx -s'pf:documents("MyCol")' -------- <document updatable="false" url="/tmp/MyDoc2.xml" collection="MyCol">MyDoc2</document>, <document updatable="false" url="/tmp/MyDoc1.xml" collection="MyCol">MyDoc1</document> ======== ======== $ mclient -lx -s'pf:del-doc("MyDoc2")' -------- ======== $ mclient -lx -s'pf:collections()' -------- <collection updatable="false" size="99 KiB" numDocs="1">MyCol</collection> ======== $ mclient -lx -s'pf:collection("MyCol")' -------- <a/><b/> ======== $ mclient -lx -g -s'fn:collection("MyCol")' -------- <?xml version="1.0" encoding="utf-8"?> <a/> , <?xml version="1.0" encoding="utf-8"?> <b/> ======== $ mclient -lx -s'pf:documents()' -------- <document updatable="false" url="/tmp/MyDoc1.xml" collection="MyCol">MyDoc1</document> ======== $ mclient -lx -s'pf:documents("MyCol")' -------- <document updatable="false" url="/tmp/MyDoc1.xml" collection="MyCol">MyDoc1</document> ======== ======== $ mclient -lx -s'pf:del-doc("MyDoc1")' -------- ======== $ mclient -lx -s'pf:collections()' -------- ======== $ mclient -lx -s'pf:collection("MyCol")' -------- ======== $ mclient -lx -g -s'fn:collection("MyCol")' -------- ======== $ mclient -lx -s'pf:documents()' -------- ======== $ mclient -lx -s'pf:documents("MyCol")' -------- ======== -- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |