Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
89874: cmdccl: remove `enc_utils` r=jbowens a=nicktrav Remove an obsolete, broken command. The functionality has been superseded by #89095 and #89873. Touches #89095. Epic: None. Release note: None. 89905: multitenant: fix failing distsql test r=cucaroach a=cucaroach Test was erroneously expecting a bundle in the bundle=off config. Fixes: #89720 Release note: None 89910: sql: `tree.ParseJSON` should not ignore trailing data r=miretskiy a=miretskiy `tree.ParseJSON` uses `Decoder.More()` method to determine if the input contains trailing data. The implementation made incorrect assumptions as to the reason why `Decoder.More()` allows input to contain `]` or `}` characters, even when JSON object has been consumed. This PR fixes and comments those faulty assumptions, and fixes multiple existing tests that seemed to rely on those faulty assumptions. In particular, prior to this PR, the following input would be allowed (i.e. extra end of object character `}`): ``` [email protected]:26257/movr> select '{"longKey1":"longValue1"}}'::jsonb; jsonb ------------------------------ {"longKey1": "longValue1"} (1 row) ``` But so would the following be allowed: ``` [email protected]:26257/movr> select '{"longKey1":"longValue1"}} should this data be ignored?'::jsonb; jsonb ------------------------------ {"longKey1": "longValue1"} (1 row) ``` So, the issue is: if above conversion was executed to insert JSONB into the database, we would silently truncate (corrupt) JSON input, and instead of returning an error, we would return success. This behavior is wrong, and this PR fixes it so that an error is returned: ``` select '{"longKey1":"longValue1"}} should this data be ignored?'::jsonb; ERROR: could not parse JSON: trailing characters after JSON document SQLSTATE: 22P02 ``` Release note (bug fix): Do not silently truncate trailing characters when attempting to convert corrupt JSON string input into JSONb. Release note (backward-incompatible change): This change may be backward incompatible to the applications that previously might have been able to insert corrupt JSON data, but now will receive an error. Co-authored-by: Nick Travers <[email protected]> Co-authored-by: Tommy Reilly <[email protected]> Co-authored-by: Yevgeniy Miretskiy <[email protected]>
- Loading branch information