In recordExtensionInitPriv(), keep the scan til we're done with it
Stephen Frost <sfrost@snowman.net>
In recordExtensionInitPriv(), keep the scan til we're done with it For reasons of sheer brain fade, we (I) was calling systable_endscan() immediately after systable_getnext() and expecting the tuple returned by systable_getnext() to still be valid. That's clearly wrong. Move the systable_endscan() down below the tuple usage. Discovered initially by Pavel Stehule and then also by Alvaro. Add a regression test based on Alvaro's testing.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/aclchk.c | modified | +2 −2 |
| src/test/modules/test_extensions/expected/test_extensions.out | modified | +3 −0 |
| src/test/modules/test_extensions/Makefile | modified | +3 −3 |
| src/test/modules/test_extensions/sql/test_extensions.sql | modified | +4 −0 |
| src/test/modules/test_extensions/test_ext6--1.0.sql | added | +1 −0 |
| src/test/modules/test_extensions/test_ext6.control | added | +5 −0 |