Skip to content

fix: allow COMMIT/ROLLBACK in nested PL/iSQL procedure calls#1125

Merged
gaoxueyu merged 1 commit intoIvorySQL:masterfrom
rophy:fix/1007
Feb 10, 2026
Merged

fix: allow COMMIT/ROLLBACK in nested PL/iSQL procedure calls#1125
gaoxueyu merged 1 commit intoIvorySQL:masterfrom
rophy:fix/1007

Conversation

@rophy
Copy link
Copy Markdown
Contributor

@rophy rophy commented Dec 7, 2025

Summary

  • Enable COMMIT/ROLLBACK in PL/iSQL anonymous blocks (DO) and procedure calls in Oracle compatibility mode
  • Fix crash in multi-statement queries when nested procedures contain COMMIT/ROLLBACK
  • Add regression tests for nested procedure call scenarios

Changes

src/backend/tcop/utility.c

  • Pass atomic=false for DO and CALL statements in Oracle mode at top-level

src/pl/plisql/src/pl_gram.y

  • Set requires_procedure_resowner = true for Oracle-style procedure calls (T_WORD/T_CWORD)

src/pl/plisql/src/pl_exec.c

  • Clear simple_econtext_stack in exec_stmt_commit() and exec_stmt_rollback() to handle cases where xact callbacks are not fired

Test plan

  • 17/17 PL/iSQL tests pass
  • 234/234 Oracle compatibility tests pass
  • 228/228 PostgreSQL tests pass
  • New tests for nested calls with COMMIT/ROLLBACK in multi-statement queries

Known limitations

  • Procedures must use SECURITY INVOKER (PL/iSQL defaults to SECURITY DEFINER which forces atomic mode)
  • Procedures with SET options also force atomic mode

Fixes #1007

Summary by CodeRabbit

  • Improvements

    • Procedure call execution now marks calls with a resource-owner requirement, improving resource management during calls.
  • Tests

    • Added extensive SQL tests and test objects exercising nested COMMIT/ROLLBACK scenarios (multiple nesting levels, CALL and Oracle-style invocations) and cleanup steps.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 7, 2025

📝 Walkthrough

Walkthrough

Sets a resource-owner requirement flag when PL/iSQL constructs CALLs from parsed SQL statements and adds extensive nested COMMIT/ROLLBACK tests (including package-based scenarios) exercising multi-level and Oracle-style call patterns; the transaction test block appears inserted twice.

Changes

Cohort / File(s) Summary
Grammar change
src/pl/plisql/src/pl_gram.y
When building a PLiSQL_stmt_call from execsql (T_WORD and T_CWORD branches), sets plisql_curr_compile->requires_procedure_resowner = true, marking CALLs as requiring a procedure resource-owner.
PL/iSQL transaction tests
src/pl/plisql/src/sql/plisql_transaction.sql
Adds a comprehensive nested COMMIT/ROLLBACK test suite: test_nested_commit table, multiple procedures (nested_inner_commit, nested_outer_commit, nested_outer_oracle_style, nested_level1–4, nested_inner_rollback, nested_outer_rollback, nested_outer_rollback_oracle_style), test runs and cleanup. Note: the same test block is inserted twice in the file.
Oracle-compatible regression test
src/oracle_test/regress/sql/ora_package.sql
Adds test_nested_commit table and pkg_commit_test package (procedures do_commit and main) to validate COMMIT behavior inside nested package calls; includes test flow and cleanup statements.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • OreoYang
  • jiaoshuntian

Poem

🐰 I hop through grammar, soft and fleet,
A tiny flag, a careful feat,
I plant some tests to watch commits,
Deep-nested hops and package fits,
May transactions purr, not skip a beat.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: allow COMMIT/ROLLBACK in nested PL/iSQL procedure calls' directly and clearly summarizes the primary change in the PR, matching the main code modification in pl_gram.y and the nested procedure test cases.
Linked Issues check ✅ Passed The PR addresses all primary coding objectives from issue #1007: setting requires_procedure_resowner=true in pl_gram.y enables COMMIT/ROLLBACK in nested procedures, comprehensive regression tests verify the fix across standalone procedures and package calls, and resource leaks are prevented.
Out of Scope Changes check ✅ Passed All changes are within scope: pl_gram.y modification directly fixes the issue, plisql_transaction.sql and ora_package.sql provide regression tests covering nested COMMIT/ROLLBACK scenarios matching issue #1007 requirements, with disputed changes (utility.c, pl_exec.c) already removed per review consensus.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/pl/plisql/src/pl_gram.y (1)

2720-2721: Marking Oracle‑style procedure calls as requiring a procedure ResourceOwner looks correct

Setting plisql_curr_compile->requires_procedure_resowner = true in the T_WORD and T_CWORD call branches aligns Oracle‑style calls (nested_inner_commit(); and qualified variants) with the existing K_DO/K_CALL handling, so they get the same resource‑owner treatment during execution. This is the right place to flip the flag and should address the resource/leak/mismatch symptoms seen with nested COMMIT/ROLLBACK from such calls.

If you touch this area again, consider centralizing the flag assignment in a helper that’s invoked whenever a PLiSQL_stmt_call is constructed, to avoid missing future call sites, but that’s optional given the current limited set of creators.

Also applies to: 2750-2751

src/pl/plisql/src/sql/plisql_transaction.sql (1)

652-800: Nested COMMIT/ROLLBACK regression tests are well‑structured and aligned with the bugfix

The new test_nested_commit table and associated nested_* procedures:

  • Exercise the key scenarios from Issue #1007: COMMIT/ROLLBACK in inner procedures, deep nesting, Oracle‑style calls (no CALL keyword), and multi‑statement query strings.
  • Correctly mark all new procedures as SECURITY INVOKER, matching the documented limitation that SECURITY DEFINER and SET options force atomic mode.
  • Clean up after themselves by truncating between tests and dropping all created procedures and test_nested_commit at the end of the script.

This provides solid coverage of the newly introduced behavior. If you want to extend coverage later, you could add a couple of nested SECURITY DEFINER / SET procedures to assert that transaction commands still fail there, but that’s not necessary for this PR.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7261f1c and 20c3898.

⛔ Files ignored due to path filters (1)
  • src/pl/plisql/src/expected/plisql_transaction.out is excluded by !**/*.out
📒 Files selected for processing (4)
  • src/backend/tcop/utility.c (3 hunks)
  • src/pl/plisql/src/pl_exec.c (2 hunks)
  • src/pl/plisql/src/pl_gram.y (2 hunks)
  • src/pl/plisql/src/sql/plisql_transaction.sql (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/backend/tcop/utility.c (1)
src/backend/commands/functioncmds.c (2)
  • ExecuteDoStmt (2794-2962)
  • ExecuteCallStmt (2992-3182)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: meson_build (ubuntu-latest)
  • GitHub Check: pg_regression (ubuntu-latest)
  • GitHub Check: oracle_regression (ubuntu-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: contrib_regression
  • GitHub Check: oracle_pg_regression (ubuntu-latest)
🔇 Additional comments (4)
src/pl/plisql/src/pl_exec.c (2)

5318-5335: Explicitly resetting simple-expression globals on COMMIT is sound and matches the design

Clearing simple_econtext_stack, shared_simple_eval_estate, and shared_simple_eval_resowner after SPI_commit() is consistent with the transaction/subxact callbacks and with the before_lxid/after_lxid handling in exec_stmt_call(). It prevents use of stale pointers when callbacks are skipped (e.g., implicit transaction blocks in multi‑statement queries), and is idempotent when callbacks do run. The subsequent plisql_create_econtext() correctly rebuilds per‑estate simple‑expression state in the new transaction.


5353-5370: Symmetric cleanup on ROLLBACK correctly mirrors COMMIT behavior

The added comment and the explicit NULLing of simple_econtext_stack, shared_simple_eval_estate, and shared_simple_eval_resowner after SPI_rollback() mirror the COMMIT path and ensure we don’t retain stack entries or shared state from the aborted transaction. Combined with the reinitialization via plisql_create_econtext(), this avoids stale pointers in both rollback and nested procedure scenarios while remaining safe when xact callbacks already performed the cleanup.

src/backend/tcop/utility.c (2)

70-70: Oracle‑compatibility header inclusion is appropriate

Including utils/ora_compatible.h here is necessary for accessing compatible_db / ORA_PARSER and is scoped appropriately to the new DO/CALL atomicity logic.


716-735: Oracle‑mode DO/CALL atomicity override matches the PR goal but changes behavior inside explicit transactions

The new doAtomicContext / callAtomicContext logic:

  • Leaves behavior unchanged for non‑Oracle modes.
  • In Oracle mode, forces DO and CALL to be non‑atomic whenever context is PROCESS_UTILITY_TOPLEVEL or PROCESS_UTILITY_QUERY_NONATOMIC, regardless of IsTransactionBlock(), so COMMIT/ROLLBACK are allowed inside anonymous blocks and procedures (and nested calls) in those contexts.
  • Still respects existing safeguards in ExecuteCallStmt() (proconfig and SECURITY DEFINER forcing atomic=true), so such procedures continue to disallow transaction control as before.

This seems correct for fixing nested PL/iSQL COMMIT/ROLLBACK and multi‑statement query crashes, and it’s nicely constrained to Oracle compatibility mode.

One thing to be aware of is that in Oracle mode this also makes top‑level DO/CALL non‑atomic even when the user has explicitly started a transaction block (BEGIN; CALL ...;), so COMMIT inside those blocks will now terminate the outer transaction as well. If that’s intentional for Oracle parity, you might want to document it; if not, consider additionally gating the override on !IsTransactionBlock() to keep DO/CALL atomic when wrapped in an explicit user transaction.

Also applies to: 878-897

@rophy
Copy link
Copy Markdown
Contributor Author

rophy commented Dec 7, 2025

Oracle compatibility verification

Verified behavior against Oracle 23.26 Free:

Test Oracle Result IvorySQL Result
Basic nested call with COMMIT 0, 1, 2, 3 0, 1, 2, 3 ✓
Deeply nested calls (3 levels) 101, 102, 103, 104, 105 101, 102, 103, 104, 105 ✓
ROLLBACK in nested procedure 202, 203 202, 203 ✓
AUTHID DEFINER with COMMIT Works Fails (known limitation)
Oracle test script
-- Setup
CREATE TABLE test_nested_commit (id NUMBER);

-- Inner procedure with COMMIT
CREATE OR REPLACE PROCEDURE nested_inner_commit AS
BEGIN
    INSERT INTO test_nested_commit VALUES (1);
    COMMIT;
    INSERT INTO test_nested_commit VALUES (2);
END;
/

-- Outer procedure calling inner
CREATE OR REPLACE PROCEDURE nested_outer_commit AS
BEGIN
    INSERT INTO test_nested_commit VALUES (0);
    nested_inner_commit();
    INSERT INTO test_nested_commit VALUES (3);
END;
/

-- Test 1: Basic nested call with COMMIT
TRUNCATE TABLE test_nested_commit;
EXEC nested_outer_commit;
SELECT * FROM test_nested_commit ORDER BY id;
-- Result: 0, 1, 2, 3

-- Test 2: Deeply nested calls (3 levels)
CREATE OR REPLACE PROCEDURE nested_level3 AS
BEGIN
    INSERT INTO test_nested_commit VALUES (103);
    COMMIT;
END;
/

CREATE OR REPLACE PROCEDURE nested_level2 AS
BEGIN
    INSERT INTO test_nested_commit VALUES (102);
    nested_level3();
    INSERT INTO test_nested_commit VALUES (104);
END;
/

CREATE OR REPLACE PROCEDURE nested_level1 AS
BEGIN
    INSERT INTO test_nested_commit VALUES (101);
    nested_level2();
    INSERT INTO test_nested_commit VALUES (105);
END;
/

TRUNCATE TABLE test_nested_commit;
EXEC nested_level1;
SELECT * FROM test_nested_commit ORDER BY id;
-- Result: 101, 102, 103, 104, 105

-- Test 3: ROLLBACK in nested procedure
CREATE OR REPLACE PROCEDURE nested_inner_rollback AS
BEGIN
    INSERT INTO test_nested_commit VALUES (201);
    ROLLBACK;
    INSERT INTO test_nested_commit VALUES (202);
END;
/

CREATE OR REPLACE PROCEDURE nested_outer_rollback AS
BEGIN
    INSERT INTO test_nested_commit VALUES (200);
    nested_inner_rollback();
    INSERT INTO test_nested_commit VALUES (203);
END;
/

TRUNCATE TABLE test_nested_commit;
EXEC nested_outer_rollback;
SELECT * FROM test_nested_commit ORDER BY id;
-- Result: 202, 203 (200 and 201 were rolled back)

@OreoYang
Copy link
Copy Markdown
Collaborator

OreoYang commented Jan 7, 2026

Known limitations
Procedures must use SECURITY INVOKER (PL/iSQL defaults to SECURITY DEFINER which forces atomic mode)

I tried to understand this statement, and found the followings:

  1. SECURITY INVOKER indicates that the procedure is to be executed with the privileges of the user that calls it. That is the default. SECURITY DEFINER specifies that the procedure is to be executed with the privileges of the user that owns it.
    A SECURITY DEFINER procedure cannot execute transaction control statements (for example, COMMIT and ROLLBACK, depending on the language).

commit ee895a6
Author: Tom Lane [email protected]
Date: Mon Jan 25 22:28:29 2021 -0500

Improve performance of repeated CALLs within plpgsql procedures.

This patch essentially is cleaning up technical debt left behind
by the original implementation of plpgsql procedures, particularly
commit d92bc83c4.  That patch (or more precisely, follow-on patches
fixing its worst bugs) forced us to re-plan CALL and DO statements
each time through, if we're in a non-atomic context.  That wasn't
for any fundamental reason, but just because use of a saved plan
requires having a ResourceOwner to hold a reference count for the
plan, and we had no suitable resowner at hand, nor would the
available APIs support using one if we did.  While it's not that
expensive to create a "plan" for CALL/DO, the cycles do add up
in repeated executions.

...

Now, when running a non-atomic procedure or DO block that contains
any CALL or DO commands, plpgsql creates a ResourceOwner that
will be used to pin the plans of the CALL/DO commands.  (In an
atomic context, we just use CurrentResourceOwner, as before.)
Having done this, we can just save CALL/DO plans normally,
whether or not they are used across transaction boundaries.
This seems to be good for something like 2X speedup of a CALL
of a trivial procedure with a few simple argument expressions.
By restricting the creation of an extra ResourceOwner like this,
there's essentially zero penalty in cases that can't benefit.

Pavel Stehule, with some further hacking by me

Discussion: https://postgr.es/m/CAFj8pRCLPdDAETvR7Po7gC5y_ibkn_-bOzbeJb39WHms01194Q@mail.gmail.com

@yuanyl630 yuanyl630 self-requested a review January 22, 2026 08:22
new->is_call = true;

/* Remember we may need a procedure resource owner */
plisql_curr_compile->requires_procedure_resowner = true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!requires_procedure_resowner is necessary for stmt_execsql;

Comment thread src/backend/tcop/utility.c Outdated
* an atomic context (e.g., called from a function), we must
* respect that.
*/
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes to utility.c used for correcting the "invalid transaction termination" error reported by 2 existing regression cases in plisql_transaction.sql?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. These changes make DO and CALL non-atomic in Oracle mode at top level, which fixes the "invalid transaction termination" error in those 2 existing cases. The expected output has been updated accordingly.

Note that the CALL transaction_test1(9, 'error') case (line 47) still errors because that procedure uses SECURITY DEFINER, which forces atomic mode in ExecuteCallStmt().

@yuanyl630
Copy link
Copy Markdown
Collaborator

For commit 307b066 (fix: allow COMMIT in nested procedure calls for Oracle compatibility)

  1. src/pl/plisql/src/pl_gram.y changes - LGTM
    The changes to set requires_procedure_resowner = true for Oracle-style procedure calls (T_WORD/T_CWORD) look correct and should be kept.
  2. src/backend/tcop/utility.c changes - Should be removed
    I don't think the changes to utility.c are necessary. Looking at the expected output changes:
    The case START TRANSACTION; DO LANGUAGE plisql $$ BEGIN COMMIT; END $$; - This is explicitly calling DO within a transaction block. The "invalid transaction termination" error is expected and correct behavior here - you cannot commit inside an explicit transaction block. START TRANSACTION is also a PG behavior. Oracle doesn't have similiar statement.
    The case with data_source(i int) function and DO block - The current error is expected because the function definition and the DO block are parsed together as a single SQL statement due to missing terminator.
    Suggested alternative: Instead of modifying utility.c to change atomicity behavior globally for Oracle mode, we can fix the test file directly. Please add /; after the CREATE FUNCTION data_source(i int) definition in plisql_transaction.sql (around line 396) to properly separate it from the following DO block:
    CREATE FUNCTION data_source(i int) RETURNS TEXT LANGUAGE sql
    AS 'select f1 from test4' IMMUTABLE;
    /; -- Add this line to separate statements

DO $$
declare x text;
...
This way "invalid transaction termination" error can be removed, and we don't need to modify the core utility processing logic.

@yuanyl630
Copy link
Copy Markdown
Collaborator

yuanyl630 commented Jan 26, 2026

For commit 20c3898 (fix: handle econtext stack in multi-statement queries with COMMIT/ROLLBACK), what crash scenario does this fix address?
The commit message mentions that in multi-statement queries, stale entries on simple_econtext_stack cause crashes. However I tested locally without applying this commit (20c3898), and ran all the test cases in plisql_transaction.sql - I did not observe any crashes.

Could you please provide:
1.The specific test case or scenario that reproduces the crash
2.The error message or stack trace when the crash occurs
3.Steps to reproduce the issue
Without being able to reproduce the crash, it's difficult to verify that this fix is both necessary and correct. The changes to pl_exec.c (clearing simple_econtext_stack, shared_simple_eval_estate, and shared_simple_eval_resowner in exec_stmt_commit() and exec_stmt_rollback()) could have side effects, so we need to understand the exact failure case this addresses.


-- Test 2: Multi-statement query with nested CALL (previously crashed)
TRUNCATE test_nested_commit;
SELECT 1 AS setup; CALL nested_outer_commit(); SELECT 2 AS done;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psql client would seperate "SELECT 1 AS setup; CALL nested_outer_commit(); SELECT 2 AS done;" into 3 simple query messages, and doesn't create implicit transaction block.

@yuanyl630
Copy link
Copy Markdown
Collaborator

Hi @rophy, thanks again for the PR. Since I haven’t heard back for a while, would you mind if I push a small follow-up commit to your branch? I’d like to keep the pl_gram.y change and adjust/drop the parts we discussed (e.g. the utility.c change and/or test tweaks), then help get this merged.
If you prefer, I can also open a separate PR from my branch instead—please let me know which you’d rather have.

@rophy
Copy link
Copy Markdown
Contributor Author

rophy commented Feb 4, 2026

Hi @rophy, thanks again for the PR. Since I haven’t heard back for a while, would you mind if I push a small follow-up commit to your branch? I’d like to keep the pl_gram.y change and adjust/drop the parts we discussed (e.g. the utility.c change and/or test tweaks), then help get this merged. If you prefer, I can also open a separate PR from my branch instead—please let me know which you’d rather have.

@yuanyl630 feel free to push things as necessary. Sorry that I'll have to wait till this weekend to continue working on PRs.

@rophy
Copy link
Copy Markdown
Contributor Author

rophy commented Feb 7, 2026

Commit 2ad34f3 removed utility.c changes as suggested in #1125 (comment), and tests pass.

Still working on #1125 (comment) - honestly I don't understand and remember why I (ok, Calude) changed pl_exec.c. I vaguely remember I ased Claude to add more tests and see if this indeed fixed "COMMIT/ROLLBACK in nested PL/iSQL procedure calls", and I think the changes resulted in Claude trying to fix something in pl_exec.c.

@rophy
Copy link
Copy Markdown
Contributor Author

rophy commented Feb 7, 2026

Updated based on review feedback:

Net changes (3 files): pl_gram.y (requires_procedure_resowner for Oracle-style calls), plus test SQL and expected output.

Re @OreoYang's SECURITY INVOKER question: The PR description was inaccurate. Test procedures use SECURITY INVOKER because Oracle-syntax CREATE PROCEDURE ... IS ends up with prosecdef=true, forcing atomic mode. I'm investigating where this gets set — grammar and catalog defaults are both false, so it may be a separate bug.

The original issue's Test 1 (standalone procs without explicit SECURITY INVOKER) is still broken due to this. Test 2 (packages) works because packages skip the prosecdef check.

@rophy
Copy link
Copy Markdown
Contributor Author

rophy commented Feb 7, 2026

In reply to #1125 (comment)):

Why test procedures use SECURITY INVOKER:

Oracle-syntax CREATE PROCEDURE ... IS in IvorySQL defaults to prosecdef=true (SECURITY DEFINER). This is intentional — Oracle's default is AUTHID DEFINER. The code is in functioncmds.c:

if (ORA_PARSER == compatible_db &&
    language_item &&
    strcmp(*language, "plisql") == 0)
    *security_definer = true;   /* default is DEFINER in oracle */

PostgreSQL blocks COMMIT/ROLLBACK in SECURITY DEFINER procedures (forces atomic=true). So without explicit SECURITY INVOKER, the tests fail with "invalid transaction termination".

However, Oracle allows COMMIT in AUTHID DEFINER procedures. I verified against Oracle 23.26 Free — COMMIT works identically in both AUTHID DEFINER and AUTHID CURRENT_USER. The partial commit behavior is the same.

So the real issue is: IvorySQL applies Oracle's AUTHID default but PostgreSQL's atomic restriction, which is incompatible. Oracle-mode should either:

  1. Not force atomic=true for prosecdef procedures, or
  2. Change the default

This should probably be discussed in another issue

@rophy
Copy link
Copy Markdown
Contributor Author

rophy commented Feb 8, 2026

Final update:

  • Switched tests to AUTHID CURRENT_USER (Oracle-native syntax) instead of SECURITY INVOKER
  • Added package COMMIT test to ora_package.sql — directly tests the plancache resource leak fix

What this PR fixes:
This PR fixes Error 2 (plancache resource leak) from issue #1007 by setting requires_procedure_resowner for Oracle-style calls in pl_gram.y.

  • For packages: fully fixed — packages skip the prosecdef check, so only the plancache fix was needed
  • For standalone procedures: also fixes the plancache leak, but AUTHID CURRENT_USER is needed as a workaround for Error 1 ("invalid transaction termination"), since Oracle-syntax procedures default to AUTHID DEFINER which forces atomic mode

Error 1 is a separate issue: IvorySQL applies Oracle's AUTHID DEFINER default but PostgreSQL's restriction that blocks COMMIT in SECURITY DEFINER procedures. Oracle allows COMMIT regardless of AUTHID.

Net changes (5 files): pl_gram.y, plisql_transaction.sql/.out, ora_package.sql/.out

Ready for squash/merge. @yuanyl630 feel free to adjust.

fixes plancache resource leak from issue IvorySQL#1007 by setting requires_procedure_resowner for Oracle-style calls in pl_gram.y
codes by Rophy Tsai <[email protected]>
@gaoxueyu gaoxueyu merged commit f9192e6 into IvorySQL:master Feb 10, 2026
6 checks passed
@rophy rophy deleted the fix/1007 branch February 10, 2026 14:09
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.

PL/iSQL: COMMIT in nested procedure call fails unlike Oracle (plancache leak in packages)

4 participants