git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 1f39535) | patch
Check if ii_AmCache is NULL in aminsertcleanup
2023年11月27日 15:52:59 +0000 (16:52 +0100)
2023年11月27日 15:53:06 +0000 (16:53 +0100)
commit a82ee7ef3aacc2073d3ef5f4b7e5067fa08ea76c
Check if ii_AmCache is NULL in aminsertcleanup

Fix a bug introduced by c1ec02be1d79. It may happen that the executor
opens indexes on the result relation, but no rows end up being inserted.
Then the index_insert_cleanup still gets executed, but passes down NULL
to the AM callback. The AM callback may not expect this, as is the case
of brininsertcleanup, leading to a crash.

Fixed by only calling the cleanup callback if (ii_AmCache != NULL). This
way the AM can simply assume to only see a valid cache.

Reported-by: Richard Guo
Discussion: https://postgr.es/m/CAMbWs4-w9qC-o9hQox9UHvdVZAYTp8OrPQOKtwbvzWaRejTT=Q@mail.gmail.com
src/backend/access/index/indexam.c diff | blob | blame | history
src/test/regress/expected/brin.out diff | blob | blame | history
src/test/regress/sql/brin.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /