Skip to content

Using --collect.slave_hosts with MariaDB and user with inadequate permissions results in a Syntax Errors instead of a Permission Denied error. #970

@markus456

Description

@markus456

Using --collect.slave_hosts with MariaDB which does not yet support SHOW REPLICAS and a user who does not have the required grants to run the SHOW SLAVE HOSTS command causes a syntax error to be logged.

This seems to originate from commit f6a64d7 (#837) which added support for SHOW REPLICAS results but the implementation assumes that the first error is due to the old syntax not being supported and overwrites the error with the result of SHOW REPLICAS which will result in a syntax error for everything other than MySQL 8.4 for users with incorrect grants.

Steps to reproduce

  1. Install any versio of MariaDB or MySQL 8.0
  2. Create a user without the REPLICATION SLAVE privilege
  3. Run mysqld_exporter with --collect.slave_hosts

The result should be that a syntax error is logged instead of the correct error that shows the user doesn't have the correct grants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions