Skip to content

Fix Ivyresult cleanup on early returns - #1556

Merged
gaoxueyu merged 1 commit into
IvorySQL:masterfrom
Aias00:fix/ivy-result-cleanup-1555
Aug 14, 2026
Merged

gaoxueyu merged 1 commit into
IvorySQL:masterfrom
Aias00:fix/ivy-result-cleanup-1555

Conversation

@Aias00

@Aias00 Aias00 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • release the Ivyresult when parameter-description execution fails;
  • release it before the successful no-namebind early return;
  • apply the same error-path cleanup to the OCI-style execution helper.

Fixes #1555.

Validation

  • make -C src/interfaces/libpq ivy-exec.o -j2
  • git diff --check
  • audited each changed return path to ensure res is no longer used after Ivyclear()

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling during parameter-name replacement.
    • Prevented stale or incomplete results from being returned when execution fails or no parameter bindings are available.

Copilot AI lite review requested due to automatic review settings August 11, 2026 11:33

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d6dbf4e-1070-4583-be9e-67f1e550326d

📥 Commits

Reviewing files that changed from the base of the PR and between b21cd66 and d086221.

📒 Files selected for processing (1)
  • src/interfaces/libpq/ivy-exec.c

📝 Walkthrough

Walkthrough

The named-bind replacement helpers now release Ivyresult objects before returning from metadata-query failures and the no-binding path.

Changes

Named-bind cleanup

Layer / File(s) Summary
Clear results on early returns
src/interfaces/libpq/ivy-exec.c
Ivyreplacenamebindtoposition and Ivyreplacenamebindtoposition2 now clear query results on metadata-query failures. Ivyreplacenamebindtoposition also clears the result when no name bindings exist.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 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 clearly describes the primary change: cleaning up Ivyresult objects on early returns.
Linked Issues check ✅ Passed The changes add Ivyclear() on all required success and error paths in both named-bind helpers while preserving behavior.
Out of Scope Changes check ✅ Passed The changes are limited to the Ivyresult cleanup required by issue #1555.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@jiaoshuntian

Copy link
Copy Markdown
Collaborator

LGTM..

@gaoxueyu
gaoxueyu merged commit 2f8197c into IvorySQL:master Aug 14, 2026
8 checks passed
hs-liuxh pushed a commit to hs-liuxh/IvorySQL that referenced this pull request Sep 2, 2026
Fix Ivyresult cleanup on early returns

(cherry picked from commit 2f8197c)
hs-liuxh pushed a commit to hs-liuxh/IvorySQL that referenced this pull request Sep 2, 2026
Fix Ivyresult cleanup on early returns

(cherry picked from commit 2f8197c)
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.

Named-bind preparation leaks Ivyresult objects on early returns

4 participants