Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-1094

LP #1690656: Grants applied differently on the master to the slave

    Details

      Description

      **Reported in Launchpad by Ceri WIlliams last update 05-07-2017 03:45:28

      Whilst the grant is indeed superfluous in this case as it is accompanied by a full SELECT privilege, this causes all slaves to have a different set of grants to the master:

      master [localhost]

      {root} ((none)) > create user test_grant@'%' identified with mysql_native_password;
      Query OK, 0 rows affected (0.02 sec)

      master [localhost] {root}

      ((none)) > grant select, select(user) on mysql.user to test_grant@'%';
      Query OK, 0 rows affected (0.01 sec)

      master [localhost]

      {root} ((none)) > show grants for test_grant@'%';
      -------------------------------------------------------------------
      | Grants for test_grant@% |
      -------------------------------------------------------------------
      | GRANT USAGE ON . TO 'test_grant'@'%' |
      | GRANT SELECT, SELECT (user) ON `mysql`.`user` TO 'test_grant'@'%' |
      -------------------------------------------------------------------
      2 rows in set (0.00 sec)

      slave1 [localhost] {msandbox} ((none)) > show grants for test_grant@'%';
      ----------------------------------------------------
      | Grants for test_grant@% |
      ----------------------------------------------------
      | GRANT USAGE ON . TO 'test_grant'@'%' |
      | GRANT SELECT ON `mysql`.`user` TO 'test_grant'@'%' |
      ----------------------------------------------------
      2 rows in set (0.00 sec)


      master [localhost] {root}

      ((none)) > show binlog events in 'mysql-bin.000001' from 4515 limit 1\G

                                                          • 1. row ***************************
                                                            Log_name: mysql-bin.000001
                                                            Pos: 4515
                                                            Event_type: Query
                                                            Server_id: 1
                                                            End_log_pos: 4652
                                                            Info: GRANT SELECT ON `mysql`.`user` TO 'test_grant'@'%'
                                                            1 row in set (0.00 sec)

      This needs to be fixed so that the master applies the grant statement in the same way as it is written to the binary log

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lpjirasync lpjirasync (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: