Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30023

Revoking Privilege on the Column Yields the Error

Details

    Description

      It's a regression in latest version 10.6.11, I did not try with other branches. But it used to work before this release.

      How to repeat:

      MariaDB [INFORMATION_SCHEMA]> CREATE TABLE test.test_getcolpriv(col1 INT, col2 INT);
      Query OK, 0 rows affected (0.041 sec)
      MariaDB [INFORMATION_SCHEMA]> GRANT SELECT (col1,col2) ON test.test_getcolpriv TO 'root';
      Query OK, 0 rows affected (0.025 sec)
      MariaDB [INFORMATION_SCHEMA]> GRANT INSERT (col1) ON test.test_getcolpriv TO 'root';
      Query OK, 0 rows affected (0.025 sec)
       
      MariaDB [INFORMATION_SCHEMA]> REVOKE SELECT (col1,col2) ON test.test_getcolpriv FROM 'root';
      Query OK, 0 rows affected (0.025 sec)
      MariaDB [INFORMATION_SCHEMA]> REVOKE INSERT (col1) ON test.test_getcolpriv FROM 'root';
      ERROR 1147 (42000): There is no such grant defined for user 'root' on host '%' on table 'test_getcolpriv'
      

      FLUSH PRIVILEGES in between fixes the thing. Also, any one GRANT/REVOKE from these two do not result in the error

      Attachments

        Issue Links

          Activity

            Lawrin Lawrin Novitsky created issue -
            alice Alice Sherepa made changes -
            Field Original Value New Value
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.5 [ 23123 ]
            Affects Version/s 10.6 [ 24028 ]
            Affects Version/s 10.7 [ 24805 ]
            Affects Version/s 10.8 [ 26121 ]
            Affects Version/s 10.9 [ 26905 ]
            Affects Version/s 10.10 [ 27530 ]
            alice Alice Sherepa made changes -
            Labels regression
            alice Alice Sherepa made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.7 [ 24805 ]
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.9 [ 26905 ]
            alice Alice Sherepa made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            Assignee Vicențiu Ciorbaru [ cvicentiu ]
            alice Alice Sherepa added a comment -

            caused by 145932a57b3ffba4ebab25aa5 (MDEV-29465: Inherited columns privs for roles wrongly set mysql.table…)

            alice Alice Sherepa added a comment - caused by 145932a57b3ffba4ebab25aa5 ( MDEV-29465 : Inherited columns privs for roles wrongly set mysql.table…)
            serg Sergei Golubchik made changes -
            Priority Minor [ 4 ] Blocker [ 1 ]
            serg Sergei Golubchik made changes -
            cvicentiu Vicențiu Ciorbaru made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            cvicentiu Vicențiu Ciorbaru made changes -
            Description It's a regression in latest version 5.6.11, I did not try with other branches. But it used to work before this release.

            How to repeat:

            {code:java}
            MariaDB [INFORMATION_SCHEMA]> CREATE TABLE test.test_getcolpriv(col1 INT, col2 INT);
            Query OK, 0 rows affected (0.041 sec)
            MariaDB [INFORMATION_SCHEMA]> GRANT SELECT (col1,col2) ON test.test_getcolpriv TO 'root';
            Query OK, 0 rows affected (0.025 sec)
            MariaDB [INFORMATION_SCHEMA]> GRANT INSERT (col1) ON test.test_getcolpriv TO 'root';
            Query OK, 0 rows affected (0.025 sec)

            MariaDB [INFORMATION_SCHEMA]> REVOKE SELECT (col1,col2) ON test.test_getcolpriv FROM 'root';
            Query OK, 0 rows affected (0.025 sec)
            MariaDB [INFORMATION_SCHEMA]> REVOKE INSERT (col1) ON test.test_getcolpriv FROM 'root';
            ERROR 1147 (42000): There is no such grant defined for user 'root' on host '%' on table 'test_getcolpriv'
            {code}

            FLUSH PRIVILEGES in between fixes the thing. Also, any one GRANT/REVOKE from these two do not result in the error
            It's a regression in latest version 10.6.11, I did not try with other branches. But it used to work before this release.

            How to repeat:

            {code:java}
            MariaDB [INFORMATION_SCHEMA]> CREATE TABLE test.test_getcolpriv(col1 INT, col2 INT);
            Query OK, 0 rows affected (0.041 sec)
            MariaDB [INFORMATION_SCHEMA]> GRANT SELECT (col1,col2) ON test.test_getcolpriv TO 'root';
            Query OK, 0 rows affected (0.025 sec)
            MariaDB [INFORMATION_SCHEMA]> GRANT INSERT (col1) ON test.test_getcolpriv TO 'root';
            Query OK, 0 rows affected (0.025 sec)

            MariaDB [INFORMATION_SCHEMA]> REVOKE SELECT (col1,col2) ON test.test_getcolpriv FROM 'root';
            Query OK, 0 rows affected (0.025 sec)
            MariaDB [INFORMATION_SCHEMA]> REVOKE INSERT (col1) ON test.test_getcolpriv FROM 'root';
            ERROR 1147 (42000): There is no such grant defined for user 'root' on host '%' on table 'test_getcolpriv'
            {code}

            FLUSH PRIVILEGES in between fixes the thing. Also, any one GRANT/REVOKE from these two do not result in the error
            cvicentiu Vicențiu Ciorbaru added a comment - - edited

            Hi serg

            Can you please review the patch at https://github.com/MariaDB/server/commit/6ed475f25cc20e88c66f52e13e691a2d8b0615e4

            All tests pass. The issue was caused by an incomplete update of GRANT_COLUMNS::rights vs GRANT_COLUMN::init_rights in replace_column_table.

            cvicentiu Vicențiu Ciorbaru added a comment - - edited Hi serg Can you please review the patch at https://github.com/MariaDB/server/commit/6ed475f25cc20e88c66f52e13e691a2d8b0615e4 All tests pass. The issue was caused by an incomplete update of GRANT_COLUMNS::rights vs GRANT_COLUMN::init_rights in replace_column_table.
            cvicentiu Vicențiu Ciorbaru made changes -
            Assignee Vicențiu Ciorbaru [ cvicentiu ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            6ed475f25cc2 is ok to push

            serg Sergei Golubchik added a comment - 6ed475f25cc2 is ok to push
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Vicențiu Ciorbaru [ cvicentiu ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            cvicentiu Vicențiu Ciorbaru made changes -
            Fix Version/s 10.3.38 [ 28507 ]
            Fix Version/s 10.4.28 [ 28509 ]
            Fix Version/s 10.5.19 [ 28511 ]
            Fix Version/s 10.6.12 [ 28513 ]
            Fix Version/s 10.7.8 [ 28515 ]
            Fix Version/s 10.8.7 [ 28517 ]
            Fix Version/s 10.9.5 [ 28519 ]
            Fix Version/s 10.10.3 [ 28521 ]
            Fix Version/s 10.11.2 [ 28523 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.7 [ 24805 ]
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.9 [ 26905 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            People

              cvicentiu Vicențiu Ciorbaru
              Lawrin Lawrin Novitsky
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.