finish TODOs in to_json_is_immutable, to_jsonb_is_immutable also add tests on it
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-05-19T01:09:18Z
Lists: pgsql-hackers
Attachments
- v1-0001-enhance-json_array-json_object-expression-is-immutable-or.patch (text/x-patch) patch v1-0001
hi. somehow, I accidentally saw the TODOs (commits [3]) on jsonb.c and json.c for functions: to_json_is_immutable and to_jsonb_is_immutable. The attached patch is to finalize these TODOs. per coverage [1], [2], there was zero coverage for these two functions. so I also added extensive tests on it. [1] https://coverage.postgresql.org/src/backend/utils/adt/jsonb.c.gcov.html [2] https://coverage.postgresql.org/src/backend/utils/adt/json.c.gcov.html [3] https://git.postgresql.org/cgit/postgresql.git/commit/?id=7081ac46ace8c459966174400b53418683c9fe5c
Commits
-
make immutability tests in to_json and to_jsonb complete
- ecd9288624a1 19 (unreleased) landed
-
Include error location in errors from ComputeIndexAttrs().
- ba75f717526c 19 (unreleased) cited
-
SQL/JSON: add standard JSON constructor functions
- 7081ac46ace8 16.0 cited