Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3.9, 10.3(EOL)
-
None
Description
In MariaDB 10.3.9 the Privilege_Type returned from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES is different for the new privilege type DELETE VERSIONING ROWS from the allowed grants in grant/revoke statements.
Example:
MariaDB [(none)]> GRANT DELETE VERSIONING ROWS ON tests.* TO alice;
|
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VERSIONING ROWS ON tests.* TO alice' at line 1
|
MariaDB [(none)]> GRANT DELETE HISTORY ON tests.* TO alice;
|
Query OK, 0 rows affected (0.001 sec)
|
|
MariaDB [(none)]> SELECT * FROM information_schema.SCHEMA_PRIVILEGES WHERE GRANTEE LIKE '\'alice%';
|
+-------------+---------------+--------------+------------------------+--------------+
|
| GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | PRIVILEGE_TYPE | IS_GRANTABLE |
|
+-------------+---------------+--------------+------------------------+--------------+
|
| 'alice'@'%' | def | tests | DELETE VERSIONING ROWS | NO |
|
+-------------+---------------+--------------+------------------------+--------------+
|
1 row in set (0.010 sec)
|
MariaDB [(none)]> SHOW GRANTS FOR alice;
|
+----------------------------------------------------------+
|
| Grants for alice@% |
|
+----------------------------------------------------------+
|
| GRANT USAGE ON *.* TO 'alice'@'%' |
|
| GRANT DELETE VERSIONING ROWS ON `tests`.* TO 'alice'@'%' |
|
+----------------------------------------------------------+
|
2 rows in set (0.001 sec)
|
We have some in-house scripting which compares the granted rights in the database with a config, and produces grant/revoke-statements when things are different. At this moment it cannot use the produced grants to automatically generate revoke-statements for DELETE VERSIONING ROWS. Neither can it confirm that DELETE HISTORY has been granted.
Proposal for fix:
- Add DELETE VERSIONING ROWS as valid grant to the grant/revoke statements
Attachments
Issue Links
- relates to
-
MDEV-20382 SHOW PRIVILEGES displays "Delete versioning rows" rather than "Delete History"
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
In MariaDB 10.3.9 the Privilege_Type returned from [INFORMATION_SCHEMA.SCHEMA_PRIVILEGES|https://mariadb.com/kb/en/library/information-schema-schema_privileges-table/] is different for the new privilege type {{DELETE VERSIONING ROWS}} from the allowed [grants|https://mariadb.com/kb/en/library/grant/#table-privileges] in grant/revoke statements.
Example: {noformat}MariaDB [(none)]> GRANT DELETE VERSIONING ROWS ON tests.* TO alice; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VERSIONING ROWS ON tests.* TO alice' at line 1 MariaDB [(none)]> GRANT DELETE HISTORY ON tests.* TO alice; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> SELECT * FROM information_schema.SCHEMA_PRIVILEGES WHERE GRANTEE LIKE '\'alice%'; +-------------+---------------+--------------+------------------------+--------------+ | GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | PRIVILEGE_TYPE | IS_GRANTABLE | +-------------+---------------+--------------+------------------------+--------------+ | 'alice'@'%' | def | tests | DELETE VERSIONING ROWS | NO | +-------------+---------------+--------------+------------------------+--------------+ 1 row in set (0.010 sec) MariaDB [(none)]> SHOW GRANTS FOR alice; +----------------------------------------------------------+ | Grants for alice@% | +----------------------------------------------------------+ | GRANT USAGE ON *.* TO 'alice'@'%' | | GRANT DELETE VERSIONING ROWS ON `tests`.* TO 'alice'@'%' | +----------------------------------------------------------+ 2 rows in set (0.001 sec) {noformat} We have some in-house scripting which compares the granted rights in the database with a config, and produces grant/revoke-statements when things are different. At this moment it cannot use the produced grants to automatically generate revoke-statements for {{DELETE VERSIONING ROWS}}. Neither can it confirm that {{DELETE HISTORY}} has been granted. Proposal for fix: * Add {{DELETE VERSIONING ROWS}} as valid grants to the grant/revoke statements |
In MariaDB 10.3.9 the Privilege_Type returned from [INFORMATION_SCHEMA.SCHEMA_PRIVILEGES|https://mariadb.com/kb/en/library/information-schema-schema_privileges-table/] is different for the new privilege type {{DELETE VERSIONING ROWS}} from the allowed [grants|https://mariadb.com/kb/en/library/grant/#table-privileges] in grant/revoke statements.
Example: {noformat}MariaDB [(none)]> GRANT DELETE VERSIONING ROWS ON tests.* TO alice; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VERSIONING ROWS ON tests.* TO alice' at line 1 MariaDB [(none)]> GRANT DELETE HISTORY ON tests.* TO alice; Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> SELECT * FROM information_schema.SCHEMA_PRIVILEGES WHERE GRANTEE LIKE '\'alice%'; +-------------+---------------+--------------+------------------------+--------------+ | GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | PRIVILEGE_TYPE | IS_GRANTABLE | +-------------+---------------+--------------+------------------------+--------------+ | 'alice'@'%' | def | tests | DELETE VERSIONING ROWS | NO | +-------------+---------------+--------------+------------------------+--------------+ 1 row in set (0.010 sec) MariaDB [(none)]> SHOW GRANTS FOR alice; +----------------------------------------------------------+ | Grants for alice@% | +----------------------------------------------------------+ | GRANT USAGE ON *.* TO 'alice'@'%' | | GRANT DELETE VERSIONING ROWS ON `tests`.* TO 'alice'@'%' | +----------------------------------------------------------+ 2 rows in set (0.001 sec) {noformat} We have some in-house scripting which compares the granted rights in the database with a config, and produces grant/revoke-statements when things are different. At this moment it cannot use the produced grants to automatically generate revoke-statements for {{DELETE VERSIONING ROWS}}. Neither can it confirm that {{DELETE HISTORY}} has been granted. Proposal for fix: * Add {{DELETE VERSIONING ROWS}} as valid grant to the grant/revoke statements |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Component/s | System versioning [ 14303 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Assignee | Alexander Krizhanovsky [ krizhanovsky ] |
Assignee | Alexander Krizhanovsky [ krizhanovsky ] | Aleksey Midenok [ midenok ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Assignee | Aleksey Midenok [ midenok ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Fix Version/s | 10.4 [ 22408 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.3.15 [ 23309 ] | |
Fix Version/s | 10.4.5 [ 23311 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Assignee | Sergei Golubchik [ serg ] | Aleksey Midenkov [ midenok ] |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Link |
This issue relates to |
Workflow | MariaDB v3 [ 90518 ] | MariaDB v4 [ 155177 ] |
I don't know whether we can add a privilege type (or a synonym) to a post-GA version. serg, krizhanovsky, opinions?
It should, however, be possible to change the privilege type which SHOW GRANTS returns from the invalid one DELETE VERSIONING ROWS to DELETE HISTORY.