Fix/remove v5 warnings#1190
Conversation
📝 WalkthroughWalkthroughInitialize psql timing baseline and simplify PL/PLiSQL control flow: set timing baseline in ExecQueryUsingCursor; replace flag-based matches with early returns/assertions in PL/PLiSQL package and subprocedure helpers; ensure memcpy copy in varlena string handling includes explicit NUL terminator. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pl/plisql/src/pl_package.c`:
- Around line 2732-2737: The code currently assumes via Assert that func is in
psource->source.funclist before removing it and decrementing
psource->source.use_count; replace that ASSERT-only protection with a runtime
check: call list_member_ptr(psource->source.funclist, func) and only perform
list_delete_ptr(psource->source.funclist, (void *) func) and
psource->source.use_count-- when the check returns true, otherwise skip the
delete/decrement (and optionally log or elog a warning/error) to avoid underflow
and use-after-free; refer to PLiSQL_package, psource, funclist, use_count,
list_member_ptr, list_delete_ptr and func to locate the change.
🧹 Nitpick comments (1)
src/bin/psql/common.c (1)
2897-2899: UseINSTR_TIME_SET_ZERO()for consistency with the opaqueinstr_timeAPI.On Line 2898,
before.ticks = 0directly accesses struct fields. Theinstr_timetype is documented as opaque and should only be manipulated via provided macros. UsingINSTR_TIME_SET_ZERO(before)maintains API abstraction and is consistent with the same function's initialization pattern at lines 1456 and 1676.🔧 Suggested fix
*elapsed_msec = 0; -before.ticks = 0; +INSTR_TIME_SET_ZERO(before);
use INSTR_TIME_SET_ZERO instead of setting ticks directly
50b0abe to
1e335b2
Compare
|
Thanks for cleaning up the code warnings. |
…h of the source argument
This PR fixes all the warnings in IVORY_REL_5_STABLE branch.
Summary by CodeRabbit
Bug Fixes
Refactor