Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

kdb editor deletes keys when executed on cascading key-name #1288

Closed
krit0n opened this issue Jan 22, 2017 · 4 comments
Closed

kdb editor deletes keys when executed on cascading key-name #1288

krit0n opened this issue Jan 22, 2017 · 4 comments

Comments

@krit0n
Copy link
Contributor

krit0n commented Jan 22, 2017

The kdb editor seems to delete keys, when it is called on cascading key-names.

In my opinion it should either not be possible to execute the editor on cascading key-names or this feature should be documented.

Describe what you wanted to do

kdb set /test/a 42
#> Using name user/test/a
#> Create a new key user/test/a with string 42

kdb editor -v /test/a ni
## ;Ni1
## ; Generated by Nickel Plugin using Elektra (see libelektra.org).
##
## user = 42
#
# replace 42 by something else:
#
## ;Ni1
## ; Generated by Nickel Plugin using Elektra (see libelektra.org).
##
## user = 1
#
# ...and save it:
#
#> filename set to /tmp/elektra-test.y9mbjl
#> running editor with /tmp/elektra-test.y9mbjl
#> 1 keys in the result
#> 4294967295 keys were equal
#> 2 keys were resolved
#> The merged keyset with strategy preserve is:
#> /test/a/user
#> about to write result keys /test/a/user
#> 
#> successful, cleaning up /tmp/elektra-test.y9mbjl

kdb get /test/a
#> Did not find key

Describe what you expected

It was not clear what to expect, because it is not really documented when the editor is used on cascading keys.

Although judging from the documentation of kdb editor

   -N, --namespace=ns
          Specify  the  namespace  to use when writing cascading keys (validation strategy only). See below in
          KDB.

my guess is, that just the keys in the default namespace should be edited.

System Information

  • Elektra Version: master
@krit0n krit0n added the bug label Jan 22, 2017
@sanssecours
Copy link
Member

Looks like this bug happens even when we do not change the key at all. Just saving the file again deletes user/test/a. The output of kdb editor

…
The merged keyset with strategy preserve is:
/test/a/user
about to write result keys /test/a/user
…

looks suspicious. As far as I can tell the merged keyset should be user/test/a, not /test/a/user.

@markus2330
Copy link
Contributor

Thank you for reporting and conforming this bug!

I agree it should prohibit to let you edit something outside of one namespace (as given with -N).

@stale
Copy link

stale bot commented May 6, 2020

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added the stale label May 6, 2020
@stale
Copy link

stale bot commented May 20, 2020

I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot closed this as completed May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants