Skip to content

Update privilege management guidelines for setting default roles#23020

Open
sgykfjsm wants to merge 3 commits into
pingcap:masterfrom
sgykfjsm:fix/set-default-role
Open

Update privilege management guidelines for setting default roles#23020
sgykfjsm wants to merge 3 commits into
pingcap:masterfrom
sgykfjsm:fix/set-default-role

Conversation

@sgykfjsm

@sgykfjsm sgykfjsm commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

First-time contributors' checklist

What is changed, added or deleted? (Required)

The previous documentation stated that SET DEFAULT ROLE requires SUPER, but TiDB checks different privileges in the current implementation (https://github.com/pingcap/tidb/blob/v8.5.6/pkg/executor/simple.go#L408-L432).

This update documents the self-user case separately and clarifies that changing default roles for other users requires either UPDATE on mysql.default_roles or CREATE USER.

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot Bot added the missing-translation-status This PR does not have translation status info. label Jun 8, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign csuzhangxc for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 8, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the privilege documentation in privilege-management.md regarding setting default roles. However, the changes were mistakenly placed under the ### KILL heading, overwriting the documentation for killing user sessions. The reviewer pointed out this misplacement, provided a suggestion to restore the KILL documentation and move the default roles guidelines to the correct ### SET DEFAULT ROLE section, and noted that mysql.default_roles should be enclosed in backticks per the style guide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread privilege-management.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant