dice icon indicating copy to clipboard operation
dice copied to clipboard

Inconsistent `SET`: Insertion of escape characters is not handled properly

Open swaingotnochill opened this issue 4 months ago • 2 comments

Steps to reproduce

> SET key\5 "value5"
OK
> KEYS *
1) "key\\5"

Expected output

1) "key5"

The expected output when the above set of commands (maybe when run on Redis)

REDIS OUTPUT:

redis> SET key\5 "value4"
"OK"
redis> KEYS *
1) "key5"

Observed output

The observed output when the above set of commands when run on DiceDB

127.0.0.1:7379> SET key\5 "value5"
OK
127.0.0.1:7379> KEYS key\5
KEYS will hang redis server, use SCAN instead.
Do you want to proceed? (y/n): y
Your Call!!
(empty list or set)
127.0.0.1:7379> KEYS key5
KEYS will hang redis server, use SCAN instead.
Do you want to proceed? (y/n): y
Your Call!!
(empty list or set)
127.0.0.1:7379> KEYS key*
KEYS will hang redis server, use SCAN instead.
Do you want to proceed? (y/n): y
Your Call!!
1) "key\\5"

Expectations for resolution

This issue will be considered resolved when the following things are done

  1. changes in the dice code to meet the expected behavior
  2. addition of relevant test case to ensure we catch the regression

You can find the tests under the tests directory of the dice repository and the steps to run are in the README file. Refer to the following links to set up DiceDB and Redis 7.2.5 locally

swaingotnochill avatar Sep 29 '24 10:09 swaingotnochill