Strange behaviour with db:copy and put-value
Monday, 12 May 2025 · 2 messages
ML
Marco Lettere12 May 2025 14:47 #
Dear all,
running 11.7 I'm trying to rename some resources that have been inserted into a database with
db:put-value().
Uncommenting and executing single lines of the following sequence [1] I get the output in [2] for the first db:list-details but the output in [3] for the second list-details.
It somehow has to do with multiple renaming because if I rename the resources one by one this doesn't seem to happen.
Could you provide some insight?
Thank you,
Marco.
[1](:db:create("test"):)
(:db:put-value("test", <a/>, "first/a"), db:put-value("test", <b/>,
"first/b"):)
(:db:list-details("test", "first"):)
(:db:rename("test", "first", "second"):)
(db:list-details("test"))[2]
<resource type="value" content-type="application/octet-stream"
modified-date="2025-05-12T12:42:35.403Z" size="7">first/a</resource>
<resource type="value" content-type="application/octet-stream"
modified-date="2025-05-12T12:42:35.403Z" size="7">first/b</resource>[3]
<resource type="value" content-type="application/octet-stream"
modified-date="2025-05-12T12:37:24.563Z" size="7">second.basex/a</resource>
<resource type="value" content-type="application/octet-stream"
modified-date="2025-05-12T12:37:24.564Z" size="7">second.basex/b</resource>CG
Christian Grün12 May 2025 17:16 #
Hi again,
Thanks for the observation. The bug has been fixed, a new snapshot is available [1].
Ciao,
Christian
[1] https://files.basex.org/releases/latest/
Quoted text · Marco Lettere · 43 lines
On Mon, May 12, 2025 at 2:47 PM Marco Lettere <m.lettere at gmail.com> wrote: > Dear all, > > running 11.7 I'm trying to rename some resources that have been inserted > into a database with db:put-value(). > > Uncommenting and executing single lines of the following sequence [1] I > get the output in [2] for the first db:list-details but the output in > [3] for the second list-details. > > It somehow has to do with multiple renaming because if I rename the > resources one by one this doesn't seem to happen. > > Could you provide some insight? > > Thank you, > > Marco. > > [1] > > (:db:create("test"):) > (:db:put-value("test", <a/>, "first/a"), db:put-value("test", <b/>, > "first/b"):) > (:db:list-details("test", "first"):) > (:db:rename("test", "first", "second"):) > (db:list-details("test")) > > [2] > > <resource type="value" content-type="application/octet-stream" > modified-date="2025-05-12T12:42:35.403Z" size="7">first/a</resource> > <resource type="value" content-type="application/octet-stream" > modified-date="2025-05-12T12:42:35.403Z" size="7">first/b</resource> > > [3] > > <resource type="value" content-type="application/octet-stream" > modified-date="2025-05-12T12:37:24.563Z" size="7">second.basex/a</resource> > <resource type="value" content-type="application/octet-stream" > modified-date="2025-05-12T12:37:24.564Z" size="7">second.basex/b</resource> > >
Written for BaseX 11.9. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery