pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix parsing mode tracking when recycling datetime format cache e 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix parsing mode tracking when recycling datetime format cache e @ 2026-11-20 06:22 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Fujii Masao @ 2026-11-20 06:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix parsing mode tracking when recycling datetime format cache entries JSONPath datetime() could accept invalid format strings depending on earlier datetime formatting operations in the same session. For example, a format containing an unquoted "z" separator could be accepted after to_char() had used it, although SQL/JSON standard mode prohibited it. The cause was that DCH_cache_getnew() did not update the std flag when recycling a cache entry. Since cache lookups matched both the format string and std, a format parsed in one mode could be reused in the other. Fix this by setting std when recycling an entry, as already done when allocating a new one. Backpatch to all supported versions. Reported-by: Michael Malis <malis@pgrust.com> Author: Andrey Rachitskiy <pl0h0yp1@gmail.com> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/19594-5d9bdc019e3f7f6e@postgresql.org Backpatch-through: 15 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/04185e794bc7a624bce7b0fdf97e9b29086ba610 Modified Files -------------- src/backend/utils/adt/formatting.c | 1 + src/test/regress/expected/jsonb_jsonpath.out | 22 ++++++++++++++++++++++ src/test/regress/sql/jsonb_jsonpath.sql | 12 ++++++++++++ 3 files changed, 35 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix parsing mode tracking when recycling datetime format cache e @ 2026-11-20 06:22 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Fujii Masao @ 2026-11-20 06:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix parsing mode tracking when recycling datetime format cache entries JSONPath datetime() could accept invalid format strings depending on earlier datetime formatting operations in the same session. For example, a format containing an unquoted "z" separator could be accepted after to_char() had used it, although SQL/JSON standard mode prohibited it. The cause was that DCH_cache_getnew() did not update the std flag when recycling a cache entry. Since cache lookups matched both the format string and std, a format parsed in one mode could be reused in the other. Fix this by setting std when recycling an entry, as already done when allocating a new one. Backpatch to all supported versions. Reported-by: Michael Malis <malis@pgrust.com> Author: Andrey Rachitskiy <pl0h0yp1@gmail.com> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/19594-5d9bdc019e3f7f6e@postgresql.org Backpatch-through: 15 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/80cf6847aa7ead14de4d9bce23b00a394c79cf99 Modified Files -------------- src/backend/utils/adt/formatting.c | 1 + src/test/regress/expected/jsonb_jsonpath.out | 22 ++++++++++++++++++++++ src/test/regress/sql/jsonb_jsonpath.sql | 12 ++++++++++++ 3 files changed, 35 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix parsing mode tracking when recycling datetime format cache e @ 2026-11-20 06:22 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Fujii Masao @ 2026-11-20 06:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix parsing mode tracking when recycling datetime format cache entries JSONPath datetime() could accept invalid format strings depending on earlier datetime formatting operations in the same session. For example, a format containing an unquoted "z" separator could be accepted after to_char() had used it, although SQL/JSON standard mode prohibited it. The cause was that DCH_cache_getnew() did not update the std flag when recycling a cache entry. Since cache lookups matched both the format string and std, a format parsed in one mode could be reused in the other. Fix this by setting std when recycling an entry, as already done when allocating a new one. Backpatch to all supported versions. Reported-by: Michael Malis <malis@pgrust.com> Author: Andrey Rachitskiy <pl0h0yp1@gmail.com> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/19594-5d9bdc019e3f7f6e@postgresql.org Backpatch-through: 15 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d0d809a6c4a13f4ff6c59ca5b56b363d15c5d451 Modified Files -------------- src/backend/utils/adt/formatting.c | 1 + src/test/regress/expected/jsonb_jsonpath.out | 22 ++++++++++++++++++++++ src/test/regress/sql/jsonb_jsonpath.sql | 12 ++++++++++++ 3 files changed, 35 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix parsing mode tracking when recycling datetime format cache e @ 2026-11-20 06:22 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Fujii Masao @ 2026-11-20 06:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix parsing mode tracking when recycling datetime format cache entries JSONPath datetime() could accept invalid format strings depending on earlier datetime formatting operations in the same session. For example, a format containing an unquoted "z" separator could be accepted after to_char() had used it, although SQL/JSON standard mode prohibited it. The cause was that DCH_cache_getnew() did not update the std flag when recycling a cache entry. Since cache lookups matched both the format string and std, a format parsed in one mode could be reused in the other. Fix this by setting std when recycling an entry, as already done when allocating a new one. Backpatch to all supported versions. Reported-by: Michael Malis <malis@pgrust.com> Author: Andrey Rachitskiy <pl0h0yp1@gmail.com> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/19594-5d9bdc019e3f7f6e@postgresql.org Backpatch-through: 15 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/47ca0f45e6fed487d9c3b83db0e7c6a631c1cfb7 Modified Files -------------- src/backend/utils/adt/formatting.c | 1 + src/test/regress/expected/jsonb_jsonpath.out | 22 ++++++++++++++++++++++ src/test/regress/sql/jsonb_jsonpath.sql | 12 ++++++++++++ 3 files changed, 35 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix parsing mode tracking when recycling datetime format cache e @ 2026-11-20 06:22 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Fujii Masao @ 2026-11-20 06:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix parsing mode tracking when recycling datetime format cache entries JSONPath datetime() could accept invalid format strings depending on earlier datetime formatting operations in the same session. For example, a format containing an unquoted "z" separator could be accepted after to_char() had used it, although SQL/JSON standard mode prohibited it. The cause was that DCH_cache_getnew() did not update the std flag when recycling a cache entry. Since cache lookups matched both the format string and std, a format parsed in one mode could be reused in the other. Fix this by setting std when recycling an entry, as already done when allocating a new one. Backpatch to all supported versions. Reported-by: Michael Malis <malis@pgrust.com> Author: Andrey Rachitskiy <pl0h0yp1@gmail.com> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/19594-5d9bdc019e3f7f6e@postgresql.org Backpatch-through: 15 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/68f4bb1d972ce5143bc587f0d542fc8a19fbbc50 Modified Files -------------- src/backend/utils/adt/formatting.c | 1 + src/test/regress/expected/jsonb_jsonpath.out | 22 ++++++++++++++++++++++ src/test/regress/sql/jsonb_jsonpath.sql | 12 ++++++++++++ 3 files changed, 35 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix parsing mode tracking when recycling datetime format cache e @ 2026-11-20 06:22 Fujii Masao <fujii@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Fujii Masao @ 2026-11-20 06:22 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix parsing mode tracking when recycling datetime format cache entries JSONPath datetime() could accept invalid format strings depending on earlier datetime formatting operations in the same session. For example, a format containing an unquoted "z" separator could be accepted after to_char() had used it, although SQL/JSON standard mode prohibited it. The cause was that DCH_cache_getnew() did not update the std flag when recycling a cache entry. Since cache lookups matched both the format string and std, a format parsed in one mode could be reused in the other. Fix this by setting std when recycling an entry, as already done when allocating a new one. Backpatch to all supported versions. Reported-by: Michael Malis <malis@pgrust.com> Author: Andrey Rachitskiy <pl0h0yp1@gmail.com> Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/19594-5d9bdc019e3f7f6e@postgresql.org Backpatch-through: 15 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4a1f87347940067bcc4bacb0ada36345b9acdd98 Modified Files -------------- src/backend/utils/adt/formatting.c | 1 + src/test/regress/expected/jsonb_jsonpath.out | 22 ++++++++++++++++++++++ src/test/regress/sql/jsonb_jsonpath.sql | 12 ++++++++++++ 3 files changed, 35 insertions(+) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2026-11-20 06:22 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-11-20 06:22 pgsql: Fix parsing mode tracking when recycling datetime format cache e Fujii Masao <fujii@postgresql.org> 2026-11-20 06:22 pgsql: Fix parsing mode tracking when recycling datetime format cache e Fujii Masao <fujii@postgresql.org> 2026-11-20 06:22 pgsql: Fix parsing mode tracking when recycling datetime format cache e Fujii Masao <fujii@postgresql.org> 2026-11-20 06:22 pgsql: Fix parsing mode tracking when recycling datetime format cache e Fujii Masao <fujii@postgresql.org> 2026-11-20 06:22 pgsql: Fix parsing mode tracking when recycling datetime format cache e Fujii Masao <fujii@postgresql.org> 2026-11-20 06:22 pgsql: Fix parsing mode tracking when recycling datetime format cache e Fujii Masao <fujii@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox