-
Notifications
You must be signed in to change notification settings - Fork 1.1k
server(bug): fix json mget crash on invalid path #4940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: adi_holden <[email protected]>
@@ -1274,6 +1274,8 @@ std::vector<std::optional<std::string>> OpJsonMGet(const WrappedJsonPath& json_p | |||
json_val, std::move(cb), CallbackResultOptions::DefaultEvaluateOptions()); | |||
|
|||
if (eval_result.IsV1()) { | |||
if (eval_result.Empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we should also return nullopt for V2. Let me check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we now have the correct behavior:
snippet from redis:
127.0.0.1:6379> json.set json1 . '{"text":"some text"}'
OK
127.0.0.1:6379> json.set json2 . '{"text":"another text"}'
OK
127.0.0.1:6379> json.mget json1 json2 .[0]
1) (nil)
2) (nil)
127.0.0.1:6379> json.mget json1 json2 $.[0]
1) "[]"
2) "[]"
Signed-off-by: adi_holden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
You just need to update output of the Json mget command. It skips for now nullable values |
Signed-off-by: adi_holden <[email protected]>
* server: fix json mget crash on invalid path --------- Signed-off-by: adi_holden <[email protected]>
* server: fix json mget crash on invalid path --------- Signed-off-by: adi_holden <[email protected]>
* server: fix json mget crash on invalid path --------- Signed-off-by: adi_holden <[email protected]>
fixes #4936