Skip to content

fix: add GUC_DISALLOW_IN_DB_ROLE_SETTING to ivorysql.enable_case_switch - #1467

Closed
btlqql wants to merge 1 commit into
IvorySQL:masterfrom
btlqql:fix/enable-case-switch-guc-disallow-db-role-setting
Closed

fix: add GUC_DISALLOW_IN_DB_ROLE_SETTING to ivorysql.enable_case_switch#1467
btlqql wants to merge 1 commit into
IvorySQL:masterfrom
btlqql:fix/enable-case-switch-guc-disallow-db-role-setting

Conversation

@btlqql

@btlqql btlqql commented Jul 27, 2026

Copy link
Copy Markdown

痛点

ivorysql.enable_case_switch 控制 Oracle 兼容模式下的标识符大小写转换行为。该参数已有 GUC_DISALLOW_IN_FILE 限制,但缺少 GUC_DISALLOW_IN_DB_ROLE_SETTING,导致可通过 ALTER DATABASE ... SET 或 ALTER ROLE ... SET 设置 per-database/per-role 覆盖值,影响共享同一数据库的其他会话的标识符解析。

Fixes #1449

已实现

  • 在 ivy_guc.c 中为 ivorysql.enable_case_switch 添加 GUC_DISALLOW_IN_DB_ROLE_SETTING 标志
  • 在 guc_parameters.dat 中同步添加该标志

验证

  • 改动仅涉及 GUC 标志位,不影响运行时逻辑
  • 与同文件中其他具有相同限制的参数保持一致
  • 依赖 CI 编译验证

Signed-off-by: btlqql 2977859784@qq.com

Summary by CodeRabbit

  • Bug Fixes
    • Prevented ivorysql.enable_case_switch from being overridden via database role configuration. This ensures the setting is applied consistently and can’t be changed indirectly through role-level configuration, improving administrative control and reducing unexpected behavior.

@coderabbitai

coderabbitai Bot commented Jul 27, 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: a0b8ce8d-c21d-4875-8fb6-dcf27be5235e

📥 Commits

Reviewing files that changed from the base of the PR and between 356dd5a and eb2f079.

⛔ Files ignored due to path filters (1)
  • src/backend/utils/misc/guc_parameters.dat is excluded by !**/*.dat
📒 Files selected for processing (1)
  • src/backend/utils/misc/ivy_guc.c
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/backend/utils/misc/ivy_guc.c

📝 Walkthrough

Walkthrough

The ivorysql.enable_case_switch GUC flag mask now includes GUC_DISALLOW_IN_DB_ROLE_SETTING, preventing persistence through database or role settings.

Changes

GUC protection

Layer / File(s) Summary
Restrict persistent role and database settings
src/backend/utils/misc/ivy_guc.c
Adds GUC_DISALLOW_IN_DB_ROLE_SETTING to the ivorysql.enable_case_switch GUC flags.

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

Possibly related PRs

🚥 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 and concisely describes the main change: adding GUC_DISALLOW_IN_DB_ROLE_SETTING to ivorysql.enable_case_switch.
Linked Issues check ✅ Passed The change matches issue #1449 by protecting ivorysql.enable_case_switch from persistent DB/role-level overrides.
Out of Scope Changes check ✅ Passed The PR stays focused on the GUC-flag fix and introduces no unrelated behavior changes.
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.

The ivorysql.enable_case_switch parameter controls case conversion
behavior and should not be settable via ALTER DATABASE ... SET or
ALTER ROLE ... SET, consistent with its existing GUC_DISALLOW_IN_FILE
restriction. Without this flag, per-database or per-role overrides
can silently break Oracle-compatible identifier resolution for other
sessions sharing the same database.

Add GUC_DISALLOW_IN_DB_ROLE_SETTING to both ivy_guc.c and
guc_parameters.dat.

Fixes IvorySQL#1449

Signed-off-by: btlqql <2977859784@qq.com>
@btlqql
btlqql force-pushed the fix/enable-case-switch-guc-disallow-db-role-setting branch from 356dd5a to eb2f079 Compare July 27, 2026 15:17
@hanjianqiao

Copy link
Copy Markdown
Collaborator

Thank you for your contribution, but this issue has already been claimed by someone else and is in the process of being fixed. Before submitting a PR, please claim the issue first and confirm that it hasn't already been claimed by someone else. For more information, please refer to the community contribution guidelines.

@hs-liuxh hs-liuxh closed this Jul 28, 2026
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.

ivorysql.enable_case_switch 缺少 GUC_DISALLOW_IN_DB_ROLE_SETTING 保护

4 participants