Repository navigation
fix: ALTER ... SET ... TO DEFAULT 可绕过新限制 - #1372
Conversation
src/backend/catalog/pg_db_role_setting.c 仅在 valuestr != NULL 时检查 GUC_DISALLOW_IN_DB_ROLE_SETTING, 修复并添加测试
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesGUC_DISALLOW_IN_DB_ROLE_SETTING Guard Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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
🧹 Nitpick comments (1)
src/oracle_test/regress/sql/psql.sql (1)
1364-1368: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a positive
RESET ALLregression for the new exemption.This block locks in the three rejected forms, but the C change also makes
VAR_RESET_ALLthe one allowed branch. A smallALTER ROLE ... RESET ALLcase would keep that exception covered too. As per path instructions, "Test SQL files. Ensure comprehensive coverage of features."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/oracle_test/regress/sql/psql.sql` around lines 1364 - 1368, Add a positive regression case for the new ALTER ROLE RESET ALL exemption in psql.sql, since the current block only covers the rejected compatible_mode variants. Update the surrounding regress_psql_cm_role sequence to include a successful ALTER ROLE ... RESET ALL check so the VAR_RESET_ALL branch in the compatibility handling is exercised alongside the existing rejected forms. Keep the test close to the current regress_psql_cm_role statements so the coverage stays easy to find and maintain.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/backend/catalog/pg_db_role_setting.c`:
- Around line 41-45: The error message in pg_db_role_setting’s handling of the
role/database setting statement is too specific to SET, but this path now also
covers RESET. Update the ereport in the pg_db_role_setting logic (using
setstmt->kind if needed) so the errmsg is command-agnostic and applies to both
ALTER USER/ROLE/DATABASE SET and RESET, while keeping the existing hint behavior
consistent.
---
Nitpick comments:
In `@src/oracle_test/regress/sql/psql.sql`:
- Around line 1364-1368: Add a positive regression case for the new ALTER ROLE
RESET ALL exemption in psql.sql, since the current block only covers the
rejected compatible_mode variants. Update the surrounding regress_psql_cm_role
sequence to include a successful ALTER ROLE ... RESET ALL check so the
VAR_RESET_ALL branch in the compatibility handling is exercised alongside the
existing rejected forms. Keep the test close to the current regress_psql_cm_role
statements so the coverage stays easy to find and maintain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3120ad7c-9ac7-4e9b-bdcd-f32fe1357a5f
📒 Files selected for processing (3)
src/backend/catalog/pg_db_role_setting.csrc/oracle_test/regress/expected/psql.outsrc/oracle_test/regress/sql/psql.sql
|
@bigplaice will follow up. |
|
Thanks for the patch! Basically looks good to me. |
@bigplaice already done. |
fix: ALTER ... SET ... TO DEFAULT 可绕过新限制 (cherry picked from commit 6467152)
fix: ALTER ... SET ... TO DEFAULT 可绕过新限制 (cherry picked from commit 6467152)
fix issue #1374
Summary by CodeRabbit
Summary by CodeRabbit
ALTER ... SETorRESET.SETandRESET.ivorysql.compatible_modecannot be persisted or reset via role-levelALTER ... SET/RESET.