diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
commit | a2a2e32c02643a0cec111511220227703fda1cd5 (patch) | |
tree | 69cc2b631234c2a8e026b9cd4d72676c61c594df /scripts/sys_schema/README.md | |
parent | Releasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff) | |
download | mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip |
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | scripts/sys_schema/README.md | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/scripts/sys_schema/README.md b/scripts/sys_schema/README.md index 3c90f41f..e06f78e1 100644 --- a/scripts/sys_schema/README.md +++ b/scripts/sys_schema/README.md @@ -1635,6 +1635,60 @@ mysql> select * from schema_object_overview; 10 rows in set (1.58 sec) ``` +#### privileges_by_table_by_level + +##### Description + +-- Shows granted privileges broken down by table on which they allow access +-- and level on which they were granted: +-- - user_privileges +-- - schema_privileges +-- - table_privileges + +##### Structure + +```SQL +MariaDB [test]> desc sys.privileges_by_table_by_level; ++--------------+--------------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++--------------+--------------+------+-----+---------+-------+ +| TABLE_SCHEMA | varchar(64) | NO | | NULL | | +| TABLE_NAME | varchar(64) | NO | | NULL | | +| GRANTEE | varchar(385) | NO | | | | +| PRIVILEGE | varchar(64) | NO | | | | +| LEVEL | varchar(6) | NO | | | | ++--------------+--------------+------+-----+---------+-------+ +5 rows in set (0.002 sec) +``` + +##### Example + +```SQL +mysql> select * from sys.privileges_by_table_by_level; ++--------------+------------+--------------------+----------------+--------+ +| TABLE_SCHEMA | TABLE_NAME | GRANTEE | PRIVILEGE_TYPE | LEVEL | ++--------------+------------+--------------------+----------------+--------+ +| test | v1 | 'oleg'@'localhost' | SELECT | GLOBAL | +| test | t1 | 'oleg'@'localhost' | SELECT | GLOBAL | +| test | v1 | 'oleg'@'localhost' | INSERT | GLOBAL | +| test | t1 | 'oleg'@'localhost' | INSERT | GLOBAL | +| test | v1 | 'oleg'@'localhost' | UPDATE | GLOBAL | +| test | v1 | 'PUBLIC'@'' | SELECT | SCHEMA | +| test | t1 | 'PUBLIC'@'' | SELECT | SCHEMA | +| test | v1 | 'PUBLIC'@'' | INSERT | SCHEMA | +| test | t1 | 'PUBLIC'@'' | INSERT | SCHEMA | +| test | v1 | 'PUBLIC'@'' | UPDATE | SCHEMA | +| test | t1 | 'PUBLIC'@'' | UPDATE | SCHEMA | +| test | v1 | 'PUBLIC'@'' | DELETE HISTORY | SCHEMA | +| test | t1 | 'PUBLIC'@'' | DELETE HISTORY | SCHEMA | +| test | t1 | 'oleg'@'%' | SELECT | TABLE | +| test | t1 | 'oleg'@'%' | UPDATE | TABLE | +| test | v1 | 'oleg'@'%' | SELECT | TABLE | ++--------------+------------+--------------------+----------------+--------+ +16 rows in set (1.58 sec) +``` + + #### schema_table_statistics / x$schema_table_statistics ##### Description @@ -5323,8 +5377,8 @@ mysql> CREATE OR REPLACE VIEW mydb.my_statements AS -> SELECT sys.format_statement(DIGEST_TEXT) AS query, -> SCHEMA_NAME AS db, -> COUNT_STAR AS exec_count, - -> sys.format_time(SUM_TIMER_WAIT) AS total_latency, - -> sys.format_time(AVG_TIMER_WAIT) AS avg_latency, + -> format_pico_time(SUM_TIMER_WAIT) AS total_latency, + -> format_pico_time(AVG_TIMER_WAIT) AS avg_latency, -> ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg, -> ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0)) AS rows_examined_avg, -> ROUND(IFNULL(SUM_ROWS_AFFECTED / NULLIF(COUNT_STAR, 0), 0)) AS rows_affected_avg, |