Skip to content

branch-4.1: [fix](be) Escape JSONB path member control characters #63517 - #64364

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63517-branch-4.1
Jun 16, 2026
Merged

branch-4.1: [fix](be) Escape JSONB path member control characters #63517#64364
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63517-branch-4.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #63517

### What problem does this PR solve?
Issue Number: None
Problem Summary: JSONB path serialization emitted raw control characters
in member names. This could make paths returned by JSON functions or
shown in diagnostics contain raw newlines/tabs and fail path round-trip
parsing. Escape JSONB path member names with JSON-compatible sequences,
decode those sequences while parsing path members, and reset per-leg
escape parser state so escaped nested members followed by additional
legs round-trip correctly.
### Release note
None
### Check List (For Author)
- Test:
- Unit Test: `./run-be-ut.sh --run
--filter=JsonbDocumentTest.jsonb_path_member_to_string_escapes_control_characters
-j 16`
- Unit Test: standalone JsonbPath nested escaped-member repro compiled
and ran successfully
- Build check: `DORIS_HOME=$PWD ninja -C be/ut_build_ASAN
test/CMakeFiles/doris_be_test.dir/core/jsonb/jsonb_document_test.cpp.o`
- Format check: `build-support/clang-format.sh`;
`build-support/check-format.sh`; `git diff --check`
- Static Analysis: attempted `build-support/run-clang-tidy.sh --base
d7d516f --build-dir be/ut_build_ASAN`,
blocked by existing clang-tidy/toolchain diagnostics outside the change
- Full `doris_be_test` link: attempted locally, but stopped because this
worktree triggered a large 1955-target rebuild
- Behavior changed: Yes. JSONB path member serialization now escapes
control characters instead of emitting raw control bytes, and escaped
nested path members followed by additional legs now parse and round-trip
correctly.
- Does this need documentation: No
@github-actions
github-actionsBot requested a review from yiguolei as a code ownerJune 10, 2026 07:46
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (91/91) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage71.65% (26533/37031)
Line Coverage54.80% (282119/514780)
Region Coverage52.22% (234846/449721)
Branch Coverage53.46% (101634/190097)

@yiguolei

Copy link
Copy Markdown
Contributor

skip buildall

@yiguoleiyiguolei reopened this Jun 11, 2026
@yiguolei
yiguolei merged commit 5452369 into branch-4.1Jun 16, 2026
32 of 34 checks passed
@morningman
morningman deleted the auto-pick-63517-branch-4.1 branch July 8, 2026 14:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hello-stephen@yiguolei@mrhhsg