Thread: pgsql: Fix logical_decoding_timelines test crashes

pgsql: Fix logical_decoding_timelines test crashes

From
Alvaro Herrera
Date:
Fix logical_decoding_timelines test crashes

In the test_slot_timelines test module, we were abusing passing NULL
values which was received as zeroes in x86, but this breaks in ARM
(buildfarm member hamster) by crashing instead.  Fix the breakage by
marking these functions as STRICT; the InvalidXid value that was
previously implicit in NULL values (on x86 at least) can now be passed
as 0.  Failing to follow the fmgr protocol to check for NULLs beforehand
was causing ARM to fail, as evidenced by segmentation faults in
buildfarm member hamster.

In order to use the new functionality in the test script, use COALESCE
in the right spot to avoid forwarding NULL values.

This was diagnosed from the hamster crash by Craig Ringer, who also
proposed a different patch (checking for NULL values explicitely in the
C function code, and keeping the non-strictness in the C functions).
I decided to go with this approach instead.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/82c83b337202fa0f5b235bdfaeb992a5cee40ed5

Modified Files
--------------
.../test_slot_timelines/expected/load_extension.out     |  2 +-
.../modules/test_slot_timelines/sql/load_extension.sql  |  2 +-
.../test_slot_timelines/test_slot_timelines--1.0.sql    |  8 ++++----
.../modules/test_slot_timelines/test_slot_timelines.c   |  6 +++---
src/test/recovery/t/006_logical_decoding_timelines.pl   | 17 ++++++++++-------
5 files changed, 19 insertions(+), 16 deletions(-)