Fix finalization for json_objectagg and friends
Andrew Dunstan <andrew@dunslane.net>
Fix finalization for json_objectagg and friends Commit f4fb45d15c misguidedly tried to free some state during aggregate finalization for json_objectagg. This resulted in attempts to access freed memory, especially when the function is used as a window function. Commit 4eb9798879 attempted to ameliorate that, but in fact it should just be ripped out, which is done here. Also add some regression tests for json_objectagg in various flavors as a window function. Original report from Jaime Casanova, diagnosis by Andres Freund. Discussion: https://postgr.es/m/YkfeMNYRCGhySKyg@ahch-to
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/json.c | modified | +0 −12 |
| src/test/regress/expected/sqljson.out | modified | +35 −0 |
| src/test/regress/sql/sqljson.sql | modified | +18 −0 |
Discussion
- JSON constructors and window functions 15 messages · 2022-04-02 → 2022-05-10