Skip to content

Unit Tests fail on Amazon RDS because SET GLOBAL statements are blocked #3918

@HappyZombies

Description

@HappyZombies

When running the mysql2 test suite against an Amazon RDS MySQL instance, several tests fail because Amazon RDS restricts the use of SET GLOBAL. RDS blocks changes to global server parameters, so any test that issues SET GLOBAL (e.g., this one) produces an access denied error.

See this Stackoverflow Issue on the matter

I understand the test suite wasn’t originally designed with RDS MySQL in mind. However in this setup with RDS, the mysql2 tests can’t run to completion, even though the library itself works fine.

In addition, due to #3859 , the tests can hang as well.

Reproduction:

  1. Point the test suite at an RDS MySQL endpoint.
  2. Run npm test.
  3. Tests involving SET GLOBAL fail with "command denied" errors and result in the following error:
SQL Error [1227] [42000]: Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation

Ideas so resolve:

  • Replace SET GLOBAL with session-level alternatives where feasible

  • Skip/guard those tests when the target server blocks global parameter changes

  • Provide a configuration option that disables tests requiring elevated privileges

Any of these would allow the full suite (or all relevant portions) to run on RDS without errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions