Skip to content

MySQL GET_LOCK name length limited to 64 chars - MariaDB supports longer names → request for MariaDBMutex #84

@mkduew

Description

@mkduew

We ran into a limitation when using GET_LOCK() with MySQL: the lock name is limited to 64 characters.

MariaDB, however, allows longer lock names. In our tests with MariaDB 11.4.9, lock names with at least 192 characters work without issues.

This leads to different behavior depending on the database backend, which can cause unexpected failures when long lock names are used.

Example

The following query works in MariaDB (tested with 11.4.9), but fails in MySQL due to the 64 character limit:

SELECT GET_LOCK(
  '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012',
  10
);

Request

To properly support MariaDB and avoid unnecessary restrictions, we would like to suggest:

  • Introducing a dedicated MariaDBMutex
  • Or otherwise handling MariaDB separately so longer lock names are supported where possible

This would allow applications to fully benefit from MariaDB’s capabilities without being constrained by MySQL-specific limits.

Thanks for considering this, and happy to help with testing or further details if needed!

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