Skip to content

disallow setting ivorysql.enable_case_switch via ALTER USER/DATABASE SET#1450

Open
enkilee wants to merge 2 commits into
IvorySQL:masterfrom
enkilee:fix-ivy_guc-bug
Open

disallow setting ivorysql.enable_case_switch via ALTER USER/DATABASE SET#1450
enkilee wants to merge 2 commits into
IvorySQL:masterfrom
enkilee:fix-ivy_guc-bug

Conversation

@enkilee

@enkilee enkilee commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

fix: #1449

Summary by CodeRabbit

  • Bug Fixes
    • Prevented ivorysql.enable_case_switch from being configured via database role settings, ensuring consistent behavior across configurations.

给 ivorysql.enable_case_switch 的 flags 加上 GUC_DISALLOW_IN_DB_ROLE_SETTING,与 compatible_mode 一致
@coderabbitai

coderabbitai Bot commented Jul 20, 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

Run ID: 95280ed7-24a6-4789-b60f-438a3daae844

📥 Commits

Reviewing files that changed from the base of the PR and between 6345260 and 50b44cb.

📒 Files selected for processing (1)
  • src/backend/utils/misc/ivy_guc.c

📝 Walkthrough

Walkthrough

ivorysql.enable_case_switch now includes GUC_DISALLOW_IN_DB_ROLE_SETTING, preventing database or role-level persistent settings for this GUC.

Changes

GUC settings

Layer / File(s) Summary
Case-switch GUC restriction
src/backend/utils/misc/ivy_guc.c
Adds GUC_DISALLOW_IN_DB_ROLE_SETTING to the ivorysql.enable_case_switch registration.

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

Possibly related PRs

Suggested reviewers: bigplaice

🚥 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 accurately summarizes the main change: blocking persistent setting of ivorysql.enable_case_switch via ALTER USER/DATABASE SET.
Linked Issues check ✅ Passed The change adds GUC_DISALLOW_IN_DB_ROLE_SETTING to ivorysql.enable_case_switch, matching issue #1449's requirement to block DB/role persistence.
Out of Scope Changes check ✅ Passed The diff is narrowly scoped to a single GUC flag update and does not introduce unrelated 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/utils/misc/ivy_guc.c`:
- Around line 189-193: Update the documentation comment for default_with_rowids
to state that it applies only in Oracle compatibility mode and only when table
creation does not specify an explicit ROWID option; avoid describing it as
applying to all newly created tables unconditionally.
🪄 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: 9d1d8c8f-10e6-4f3c-a0fc-eb652baa14f6

📥 Commits

Reviewing files that changed from the base of the PR and between 15d3b5b and 6345260.

⛔ 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

Comment thread src/backend/utils/misc/ivy_guc.c Outdated
Comment on lines +189 to +193
* When enabled, all newly created tables will automatically include an
* Oracle-compatible ROWID pseudo-column. This provides compatibility with
* Oracle applications that rely on ROWID for row identification.
*
* Default: off
* Context: USERSET (can be changed by any user)
* Default: off Context: USERSET (can be changed by any user)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Clarify the default_with_rowids scope.

Line 189 says all newly created tables receive ROWID columns, but the runtime uses this GUC only in Oracle compatibility mode and only when no explicit ROWID option is provided. Please document those conditions to avoid misleading users.

Proposed wording
-	 * When enabled, all newly created tables will automatically include an
-	 * Oracle-compatible ROWID pseudo-column. This provides compatibility with
-	 * Oracle applications that rely on ROWID for row identification.
+	 * When enabled in Oracle compatibility mode, tables without an explicit
+	 * ROWID option default to an Oracle-compatible ROWID pseudo-column.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* When enabled, all newly created tables will automatically include an
* Oracle-compatible ROWID pseudo-column. This provides compatibility with
* Oracle applications that rely on ROWID for row identification.
*
* Default: off
* Context: USERSET (can be changed by any user)
* Default: off Context: USERSET (can be changed by any user)
* When enabled in Oracle compatibility mode, tables without an explicit
* ROWID option default to an Oracle-compatible ROWID pseudo-column.
*
* Default: off Context: USERSET (can be changed by any user)
🤖 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/backend/utils/misc/ivy_guc.c` around lines 189 - 193, Update the
documentation comment for default_with_rowids to state that it applies only in
Oracle compatibility mode and only when table creation does not specify an
explicit ROWID option; avoid describing it as applying to all newly created
tables unconditionally.

@hs-liuxh

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! I'll review it shortly.

@hanjianqiao

Copy link
Copy Markdown
Collaborator

@enkilee We noticed there are some extra modifications alongside the functional changes. Could you please revert them before merging?

@hs-liuxh hs-liuxh changed the title fix: fix issue 1449 disallow setting ivorysql.enable_case_switch via ALTER USER/DATABASE SET Jul 22, 2026
revert the format about some comment
@enkilee

enkilee commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

We noticed there are some extra modifications alongside the functional changes. Could you please revert them before merging?

already done. thx.

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 保护

3 participants