mrhhsg opened a new pull request, #63579:
URL: https://github.com/apache/doris/pull/63579

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Problem Summary: JSON modify functions build a parent path by iterating to 
the element before the last JSON path leg. The loop used `get_leg_vector_size() 
- 1` on an unsigned size, which can underflow for an empty path expression even 
though normal root-path execution resolves to the root value before that 
branch. This patch caches the leg count once, asserts the non-empty invariant 
for the insert-parent branch, and uses `j + 1 < legs_count` to avoid unsigned 
subtraction while preserving behavior.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test:
       - Manual test: `git diff --check`
       - Manual test: `DORIS_HOME=/mnt/disk7/hushenggang/doris-fix-spill ninja 
-C be/ut_build_ASAN -j 1 
src/exprs/CMakeFiles/Exprs.dir/function/function_jsonb.cpp.o`
   - Behavior changed: No
   - Does this need documentation: No
   


-- 
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