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!