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

   ### What problem does this PR solve?
   
   Issue Number: DORIS-25567, DORIS-25568
   
   Problem Summary:
   - Fix `json_valid` accepting incomplete JSON or inputs with trailing 
non-JSON content, such as `not json` and `null junk`.
   - Fix typed `jsonb_extract_*` functions returning implicitly cast values 
when the JSON value type does not match the requested type. These functions now 
return `NULL` on type mismatch.
   
   Root cause:
   - The simdjson parser path accepted partial top-level JSON without verifying 
that the parsed raw JSON consumed the full input.
   - Nereids rewrote typed `jsonb_extract_*` calls to `cast(jsonb_extract(...) 
as type)`, which allowed implicit casts instead of strict JSON type checks.
   
   ### Release note
   
   Fix `json_valid` and typed `jsonb_extract_*` strict JSON type behavior.
   
   ### Check List (For Author)
   
   - Test: Unit Test / Regression test
       - `./run-be-ut.sh --run 
--filter=JsonBinaryValueTest.TestValidation:FunctionJsonbTEST.JsonValidStrictTest:FunctionJsonbTEST.JsonbExtractStrictTypedTest`
       - `./build.sh --fe`
       - `./build.sh --be`
       - `env -u HTTP_PROXY -u HTTPS_PROXY -u http_proxy -u https_proxy -u 
ALL_PROXY -u all_proxy ./run-regression-test.sh --run -d jsonb_p0 -s 
test_jsonb_strict_type_extract_and_valid`
   - Behavior changed: Yes. `json_valid` rejects incomplete/trailing JSON input 
and typed `jsonb_extract_*` returns `NULL` on type mismatch.
   - 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