This PR fixes two bugs I noticed related to resource grant conflicts:
It is currently impossible to create multiple grants for the same user for different tables, because the ids conflict. This fixes the IDs to include the table or procedure name.
If you try to create multiple conflicting resource grants, this may or may not be caught by the conflict detection logic because MySQL requests can be issued in parallel. This introduces a keyed mutex around grant creation and deletion to ensure that conflicts are caught.
What does this PR do?
This PR fixes two bugs I noticed related to resource grant conflicts:
It is currently impossible to create multiple grants for the same user for different tables, because the ids conflict. This fixes the IDs to include the table or procedure name.
If you try to create multiple conflicting resource grants, this may or may not be caught by the conflict detection logic because MySQL requests can be issued in parallel. This introduces a keyed mutex around grant creation and deletion to ensure that conflicts are caught.
Test Plan
Added unit tests