exist
exist copied to clipboard
[BUG] NPE thrown on frequent updates of an XML resource
Description:
Frequent updates on any XML resource stored in the database will cause a NullPointerException when it hits the fragmentation limit.
update replace $stored-node with $new-node
This will result in
- the document effectively being removed from the database
- the data of that document to be no longer present in any configured index
Reference:
Affected versions 6.1.0 and later (6.2.0, 6.3.0-SNAPSHOT, 7.0.0-SNAPSHOT) Regression introduced in c553667
Type of tests:
Evaluate following query
xquery version "3.1";
(:sm:create-account("test", "test", "test"),:)
(:sm:create-group("test"),:)
xmldb:create-collection("/db", "test"),
sm:chgrp(xs:anyURI("/db/test"), "test"),
sm:chmod(xs:anyURI("/db/test"), "rwxrws---"),
xmldb:store("/db/test", "test.xml", <test><foo/></test>),
sm:chmod(xs:anyURI("/db/test/test.xml"), "rw-rw----"),
xmldb:create-collection("/db/apps", "test"),
sm:chmod(xs:anyURI("/db/apps/test"), "rwxrwxrwx"),
xmldb:store("/db/apps/test", "update.xql", "update replace doc('/db/test/test.xml')/test/foo with <foo updated='{util:system-time()}' />, doc('/db/test/test.xml')/test/foo", "application/xquery"),
sm:chown(xs:anyURI("/db/apps/test/update.xql"), "test"),
sm:chgrp(xs:anyURI("/db/apps/test/update.xql"), "test"),
sm:chmod(xs:anyURI("/db/apps/test/update.xql"), "rwxr-sr-x")
Then open /exist/apps/test/update.xql as guest
Reopened until fixed in 6.x.x