github-actions[bot] commented on code in PR #63517:
URL: https://github.com/apache/doris/pull/63517#discussion_r3321622374


##########
be/src/util/jsonb_document.h:
##########
@@ -363,19 +418,51 @@ struct leg_info {

Review Comment:
   `has_escapes` is never reset between path legs, so once an escaped member is 
parsed every later member also calls `remove_escapes()`. For a nested path 
produced by this change, for example a search result like `$."a\nb".c.d`, 
parsing the first member sets the flag; parsing the following unescaped `c` 
then calls `remove_escapes()`, which writes `\0` at `leg_ptr[new_len]` and 
overwrites the next `.` delimiter. The next loop in `seek()` sees the corrupted 
delimiter and the round-trip fails; if the following member is the final leg 
this write is at the end of the caller's path slice. Please clear `has_escapes` 
for each leg (for example alongside `clear_leg_ptr()`/`clear_leg_len()`, or 
after removal) and add a nested JSON_SEARCH -> JSON_EXTRACT / JsonbPath 
round-trip test so escaped member paths with trailing legs are covered.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to