From 2e4a2bd1b213682f964a1243722cd6ef0c72c9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 19 Sep 2025 10:39:07 +0100 Subject: [PATCH 1/7] statements: add privilege details --- sql-statements/sql-statement-create-binding.md | 4 ++++ sql-statements/sql-statement-show-processlist.md | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-create-binding.md b/sql-statements/sql-statement-create-binding.md index c34bfd9842ee5..653b35beaefaa 100644 --- a/sql-statements/sql-statement-create-binding.md +++ b/sql-statements/sql-statement-create-binding.md @@ -314,6 +314,10 @@ Empty set (0.002 sec) ## SQL statement truncation When you use `CREATE BINDING ... FROM HISTORY USING PLAN DIGEST`, the binding can fail if the SQL statement stored in [statement summary tables](/statement-summary-tables.md) for that digest is truncated because it is longer than [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-new-in-v40). In this case, you need to increase `tidb_stmt_summary_max_sql_length`. +======= +## Permissions + +The `CREATE BINDING` statements requires the `SUPER` privilege. ## MySQL compatibility diff --git a/sql-statements/sql-statement-show-processlist.md b/sql-statements/sql-statement-show-processlist.md index 712e269852e50..1b8498e1f992c 100644 --- a/sql-statements/sql-statement-show-processlist.md +++ b/sql-statements/sql-statement-show-processlist.md @@ -6,7 +6,7 @@ aliases: ['/docs/dev/sql-statements/sql-statement-show-processlist/','/docs/dev/ # SHOW [FULL] PROCESSLIST -This statement lists the current sessions connected to the same TiDB server. The `Info` column contains the query text, which will be truncated unless the optional keyword `FULL` is specified. +This statement lists the current sessions connected to the same TiDB server. The `Info` column contains the query text, which will be truncated unless the optional keyword `FULL` is specified. The [`information_schema.cluster_processlist`](/information-schema/information-schema-processlist.md#cluster_processlist) table can be used to see the cluster wide processlist. ## Synopsis @@ -27,6 +27,10 @@ mysql> SHOW PROCESSLIST; 1 rows in set (0.00 sec) ``` +## Permissions + +Unless the user has the `PROCESS` privilege the processlist will only show the sessions belonging to the user itself. + ## MySQL compatibility * The `State` column in TiDB is non-descriptive. Representing state as a single value is more complex in TiDB, since queries are executed in parallel and each goroutine will have a different state at any one time. From 38b445c363db0afa925a9f829d71837682ffaeba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Mon, 22 Sep 2025 08:46:15 +0200 Subject: [PATCH 2/7] processlist: add permission details --- information-schema/information-schema-processlist.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index 1ac3ea78188a7..130baf1b7e3fa 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -152,3 +152,7 @@ SELECT * FROM information_schema.cluster_processlist; | 127.0.0.1:10080 | 1268776964 | root | 127.0.0.1:59922 | NULL | Query | 0 | autocommit | SELECT * FROM information_schema.cluster_processlist | b1e38e59fbbc3e2b35546db5c8053040db989a497ac6cd71ff8dd4394395701a | 0 | 0 | 07-29 12:39:24.282(451471727468740609) | default | | 0 | 0 | 0 | +-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+----------+----------+ ``` + +## Permissions + +Unless the user has the `PROCESS` privilege the processlist will only show the sessions belonging to the user itself. From 31a9a7c47cfad5e3c3e06cf29cbfc36db23b3b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Mon, 22 Sep 2025 10:54:02 +0200 Subject: [PATCH 3/7] Apply suggestion from @qiancai Co-authored-by: Grace Cai --- information-schema/information-schema-processlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index 130baf1b7e3fa..b05371c71ddd6 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -155,4 +155,4 @@ SELECT * FROM information_schema.cluster_processlist; ## Permissions -Unless the user has the `PROCESS` privilege the processlist will only show the sessions belonging to the user itself. +If the current user does not have the `PROCESS` privilege, `PROCESSLIST` only shows the requests from the user’s own sessions. From c756cf76f4b818bb45d5ebd36d67d7e184a585a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Mon, 22 Sep 2025 10:54:14 +0200 Subject: [PATCH 4/7] Apply suggestion from @qiancai Co-authored-by: Grace Cai --- sql-statements/sql-statement-create-binding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-create-binding.md b/sql-statements/sql-statement-create-binding.md index 653b35beaefaa..001ea73acf825 100644 --- a/sql-statements/sql-statement-create-binding.md +++ b/sql-statements/sql-statement-create-binding.md @@ -317,7 +317,7 @@ When you use `CREATE BINDING ... FROM HISTORY USING PLAN DIGEST`, the binding ca ======= ## Permissions -The `CREATE BINDING` statements requires the `SUPER` privilege. +The `CREATE BINDING` statement requires the `SUPER` privilege. ## MySQL compatibility From 34600a747b511351b55792f2dbb93dce10e7a583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Mon, 22 Sep 2025 10:54:32 +0200 Subject: [PATCH 5/7] Apply suggestion from @qiancai Co-authored-by: Grace Cai --- sql-statements/sql-statement-show-processlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-show-processlist.md b/sql-statements/sql-statement-show-processlist.md index 1b8498e1f992c..acf1ac4711c80 100644 --- a/sql-statements/sql-statement-show-processlist.md +++ b/sql-statements/sql-statement-show-processlist.md @@ -6,7 +6,7 @@ aliases: ['/docs/dev/sql-statements/sql-statement-show-processlist/','/docs/dev/ # SHOW [FULL] PROCESSLIST -This statement lists the current sessions connected to the same TiDB server. The `Info` column contains the query text, which will be truncated unless the optional keyword `FULL` is specified. The [`information_schema.cluster_processlist`](/information-schema/information-schema-processlist.md#cluster_processlist) table can be used to see the cluster wide processlist. +This statement lists the current sessions connected to the same TiDB server. The `Info` column contains the query text, which will be truncated unless the optional keyword `FULL` is specified. To view the processlist across the entire cluster, use the [`INFORMATION_SCHEMA.CLUSTER_PROCESSLIST`](/information-schema/information-schema-processlist.md#cluster_processlist) table. ## Synopsis From e6dff7fbfc321e9880d98b8b0b2cc50d565a00fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Mon, 22 Sep 2025 10:54:38 +0200 Subject: [PATCH 6/7] Apply suggestion from @qiancai Co-authored-by: Grace Cai --- sql-statements/sql-statement-show-processlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-show-processlist.md b/sql-statements/sql-statement-show-processlist.md index acf1ac4711c80..43cac12ff9a61 100644 --- a/sql-statements/sql-statement-show-processlist.md +++ b/sql-statements/sql-statement-show-processlist.md @@ -29,7 +29,7 @@ mysql> SHOW PROCESSLIST; ## Permissions -Unless the user has the `PROCESS` privilege the processlist will only show the sessions belonging to the user itself. +If the current user does not have the `PROCESS` privilege, `SHOW PROCESSLIST` only shows the requests from the user’s own sessions. ## MySQL compatibility From d230920804d540750bcb205dc9de74b3939e1b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Tue, 30 Sep 2025 11:45:20 +0200 Subject: [PATCH 7/7] fixup --- sql-statements/sql-statement-create-binding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-create-binding.md b/sql-statements/sql-statement-create-binding.md index 001ea73acf825..1dfdfd919f438 100644 --- a/sql-statements/sql-statement-create-binding.md +++ b/sql-statements/sql-statement-create-binding.md @@ -314,7 +314,7 @@ Empty set (0.002 sec) ## SQL statement truncation When you use `CREATE BINDING ... FROM HISTORY USING PLAN DIGEST`, the binding can fail if the SQL statement stored in [statement summary tables](/statement-summary-tables.md) for that digest is truncated because it is longer than [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-new-in-v40). In this case, you need to increase `tidb_stmt_summary_max_sql_length`. -======= + ## Permissions The `CREATE BINDING` statement requires the `SUPER` privilege.