FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: identify routine kinds in DBMS_UTILITY call stack by hexu-xu · Pull Request #2315 · IvorySQL/IvorySQL · GitHub

Repository navigation

fix: identify routine kinds in DBMS_UTILITY call stack - #2315

Open
hexu-xu wants to merge 1 commit into
IvorySQL:masterfrom
hexu-xu:fix/dbms-utility-call-stack-kinds
Open

hexu-xu wants to merge 1 commit into
IvorySQL:masterfrom
hexu-xu:fix/dbms-utility-call-stack-kinds

Conversation

hexu-xu commented Oct 6, 2026 •
edited
Loading

Copy link
Copy Markdown

Summary

FORMAT_CALL_STACK previously labeled every PL/iSQL frame as a function, including procedures and anonymous blocks. Pass the routine kind through the internal call-stack representation and display each frame as a function, procedure, or anonymous block as appropriate.

Add regression coverage for all three kinds, including nested procedures and a package procedure.

This change is independent of #2314.

Refs #2317

Testing

  • make -C contrib/ivorysql_ora oracle-check TAP_TESTS= — all 31 tests passed.
  • make -C src/oracle_test/regress oracle-check-tests TESTS="ora_plisql ora_psql" — both tests passed.
  • make -C contrib/ivorysql_ora oracle-check ORA_REGRESS=dbms_utility TAP_TESTS= — passed.

Summary by CodeRabbit

  • Bug Fixes
    • Call-stack output now correctly distinguishes procedure and function frames, displays anonymous blocks with their proper name, and provides clearer procedure names. Nested call stacks also count procedure entries accurately. Function labels remain unchanged, making frame types easier to identify consistently across standalone routines and packaged procedures.

Signed-off-by: hexu-xu <3613923395@qq.com>

coderabbitai Bot commented Oct 6, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info ⚙️ Run configuration
  • Configuration used: Repository: IvorySQL/IvorySQL/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 21228ff0-d336-4849-9657-29e1fb4b59b7
📥 Commits

Reviewing files that changed from the base of the PR and between 069766e and ebf7a08.

📒 Files selected for processing (5)
  • contrib/ivorysql_ora/expected/dbms_utility.out
  • contrib/ivorysql_ora/sql/dbms_utility.sql
  • contrib/ivorysql_ora/src/builtin_packages/dbms_utility/dbms_utility.c
  • src/pl/plisql/src/pl_comp.c
  • src/pl/plisql/src/pl_exec.c

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

PL/iSQL call-stack records now include each frame’s kind. DBMS_UTILITY uses that field to distinguish procedures, functions, and anonymous blocks. Call-stack tests check the updated frame labels and counts.

Changes

Call-stack frame kinds

Layer / File(s) Summary
Emit frame kind
src/pl/plisql/src/pl_comp.c, src/pl/plisql/src/pl_exec.c
Call-stack records now include prokind. Inline code with a VOIDOID return type is classified as an anonymous block when it is not a procedure.
Format frame kind
contrib/ivorysql_ora/src/builtin_packages/dbms_utility/dbms_utility.c
The formatter parses the added prokind field, skips records with an invalid field layout, and labels anonymous blocks, procedures, and other frames.
Verify formatted frame labels
contrib/ivorysql_ora/sql/dbms_utility.sql, contrib/ivorysql_ora/expected/dbms_utility.out
Tests check procedure and function labels, anonymous-block naming, nested procedure counts, and the package-procedure label.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: btlqql

Merge Risk: ⚪ Minimal · up to ebf7a

The call-stack labels and regression expectations are consistent with the reported change. No identified issue prevents merging after normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to ebf7a

The change affects 2 systems.

Changed systems: contrib, src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — contrib (service) was modified; 3 changed files map to changed impact.
  • observed — src (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in contrib/ivorysql_ora/expected/dbms_utility.out: The basic call-stack test now checks for a procedure TEST_CALL_STACK_BASIC() frame instead of matching the procedure name as a function, and expects the updated procedure-specific success message.
  • observed — Modified behavior in contrib/ivorysql_ora/expected/dbms_utility.out: The nested call-stack test now counts procedure entries using a divisor of 10 instead of counting function entries with a divisor of 9; the expected output now reports procedure entries.
  • observed — Modified behavior in contrib/ivorysql_ora/expected/dbms_utility.out: The expected nested-stack output now describes three procedure entries. Added a test that checks a function frame contains function TEST_CALL_STACK_KIND() and that an anonymous block contains anonymous block but not function INLINE_CODE_BLOCK.
  • observed — Modified behavior in contrib/ivorysql_ora/expected/dbms_utility.out: The package-frame assertion now requires the procedure label before CALLSTACK_NS.TEST_CALL_STACK_PKG.STACK_CALLER, rather than matching only the qualified name.
🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (2 skipped: 2 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: identifying routine kinds in the DBMS_UTILITY call stack.
✨ Finishing Touches 💡 1 🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Copy link
Copy Markdown
Collaborator

thanks for your PR

Muzzammil242 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Built the head (ebf7a08 on master 069766e) on a fresh oracle-mode cluster; the suite passes (31 of 31). With a procedure du_p called from a function du_g, DBMS_UTILITY.FORMAT_CALL_STACK read inside the procedure now shows

----- PL/SQL Call Stack -----
0x...      2  procedure public.du_p()
0x...      3  function du_g()

where master labels the first frame function. Oracle 21c labels the same frames procedure SYSTEM.DU_P and function SYSTEM.DU_F (and anonymous block for a block), so the kinds now match. The frame naming itself (lower case, the parentheses, the schema shown only when qualified) is master's existing format and not this change's. Approving.

hexu-xu commented Oct 9, 2026

Copy link
Copy Markdown
Author

Thank you for the thorough review and Oracle 21c verification!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL