Skip to content

Commit

Permalink
sql: add missing dynamic privileges and update optm lock version (#12541
Browse files Browse the repository at this point in the history
) (#12583)
  • Loading branch information
ti-chi-bot authored Feb 20, 2023
1 parent 60966a7 commit 3a037f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ In TiDB, you can also use the system variable [`tidb_enable_ordered_result_mode`

## Does TiDB support `SELECT FOR UPDATE`?

Yes. When using pessimistic locking (the default since TiDB v3.0) the `SELECT FOR UPDATE` execution behaves similar to MySQL.
Yes. When using pessimistic locking (the default since TiDB v3.0.8) the `SELECT FOR UPDATE` execution behaves similar to MySQL.

When using optimistic locking, `SELECT FOR UPDATE` does not lock data when the transaction is started, but checks conflicts when the transaction is committed. If the check reveals conflicts, the committing transaction rolls back.

Expand Down
10 changes: 9 additions & 1 deletion privilege-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,17 @@ Dynamic privileges include:

* `BACKUP_ADMIN`
* `RESTORE_ADMIN`
* `SYSTEM_USER`
* `SYSTEM_VARIABLES_ADMIN`
* `ROLE_ADMIN`
* `CONNECTION_ADMIN`
* `SYSTEM_VARIABLES_ADMIN`
* `PLACEMENT_ADMIN` allows privilege owners to create, modify, and remove placement policies.
* `DASHBOARD_CLIENT` allows privilege owners to log in to TiDB Dashboard.
* `RESTRICTED_TABLES_ADMIN` allows privilege owners to view system tables when SEM is enabled.
* `RESTRICTED_STATUS_ADMIN` allows privilege owners to view all status variables in [`SHOW [GLOBAL|SESSION] STATUS`](/sql-statements/sql-statement-show-status.md) when SEM is enabled.
* `RESTRICTED_VARIABLES_ADMIN` allows privilege owners to view all system variables when SEM is enabled.
* `RESTRICTED_USER_ADMIN` prohibits privilege owners to have their access revoked by SUPER users when SEM is enabled.
* `RESTRICTED_CONNECTION_ADMIN` allows privilege owners to kill connections of `RESTRICTED_USER_ADMIN` users. This privilege affects `KILL` and `KILL TIDB` statements.
* `RESTRICTED_REPLICA_WRITER_ADMIN` allows privilege owners to perform write or update operations without being affected when the read-only mode is enabled in the TiDB cluster. For details, see [`tidb_restricted_read_only`](/system-variables.md#tidb_restricted_read_only-new-in-v520).

To see the full set of dynamic privileges, execute the `SHOW PRIVILEGES` statement. Because plugins are permitted to add new privileges, the list of privileges that are assignable might differ based on your TiDB installation.
Expand Down

0 comments on commit 3a037f3

Please sign in to comment.