Skip to content

Disconnect SPI at end of Function_create - #549

Merged
jcflack merged 2 commits into
REL1_6_STABLEfrom
bug/REL1_6_STABLE/issue544
Aug 14, 2026
Merged

Disconnect SPI at end of Function_create#549
jcflack merged 2 commits into
REL1_6_STABLEfrom
bug/REL1_6_STABLE/issue544

Conversation

@jcflack

@jcflack jcflack commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

The bug in issue #544 was exposed by the check_function_bodies setting having an effect on actual runtime behavior, not just on validation. This PR fixes that bug and also adds testing with check_function_bodies = off to the CI script.

Addresses #544.

Issue #544 presented a mystery where the regression test for trigger
transition tables would succeed with check_function_bodies on, but fail
with check_function_bodies off.

In the 'on' case, the function would be ready to use ahead of its first
invocation (the validator having done all the necessary work). The first
invocation would find the function cached and invoke it, with SPI not yet
connected. On the function's first use of SPI, Invocation_assertConnect
sees there is a TriggerData associated with the invocation, and registers
the transition tables to make them visible by the expected names.

In the 'off' case, the function's first invocation requires Function_create
to do its work, which may involve an SPI connection from PL/Java's class
loader. Taking place before the invocation has been recognized as handling
a trigger, this connection is made without registering the transition
tables. By the time the function itself first uses SPI, the TriggerData
has been associated with the invocation, but no registration occurs because
SPI is already connected.

Ending any SPI connection that Function_create may have made ensures that
the first use of SPI by the function itself makes a new SPI connection
that is appropriately set up.

It is a bug for check_function_bodies to have an effect on a function's
runtime behavior and not just on its validation. To catch such behavior
in the future, the regression test script now repeats the example jar
installation and test execution with check_function_bodies set to off.
The failing run on initial creation of this PR was from a CI system that
should not even have been activated for this PR.
@jcflack
jcflack merged commit 2904347 into REL1_6_STABLE Aug 14, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant