title: Force-release a user-level lock in MySQL/MAriaDB
body: <p>My session management (Zebra Session) uses user-level locks to avoid race conditions between two requests in the same session. To start the session, GET_LOCK is used. After closing the session, RELEASE_LOCK is used.</p>
  <pre><code>MariaDB [planner_20201026]&gt; select GET_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587aaaa', '5');
  +-------------------------------------------------------------------+
  | GET_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587aaaa', '5') |
  +-------------------------------------------------------------------+
  |                                                                 1 |
  +-------------------------------------------------------------------+
  1 row in set (0.000 sec)
  
  MariaDB [planner_20201026]&gt; select  RELEASE_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587aaa');
  +-----------------------------------------------------------------+
  | RELEASE_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587aaa') |
  +-----------------------------------------------------------------+
  |                                                            NULL |
  +-----------------------------------------------------------------+
  1 row in set (0.000 sec)
  </code></pre>
  <p>Now I am in a situation because of a reason which I do not know yet where the lock was not released properly. GET_LOCK finishes because of the timeout, RELEASE_LOCK tells me that it cannot release the lock because it was (according to the documentation) established by another thread:</p>
  <pre><code>MariaDB [xyz]&gt; select GET_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587ac8b', '5');
  +-------------------------------------------------------------------+
  | GET_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587ac8b', '5') |
  +-------------------------------------------------------------------+
  |                                                                 0 |
  +-------------------------------------------------------------------+
  1 row in set (5.015 sec)
  
  MariaDB [xyz]&gt; select  RELEASE_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587ac8b');
  +------------------------------------------------------------------+
  | RELEASE_LOCK('session_ebe210e9b39f1ad3a409763be60efebff587ac8b') |
  +------------------------------------------------------------------+
  |                                                                0 |
  +------------------------------------------------------------------+
  1 row in set (0.000 sec)
  </code></pre>
  <p>The session is now more or less blocked/useless/doomed, each request takes TIMEOUT seconds extra.</p>
  <p>Is there any chance how I can clear that lock, especially after a timeout?</p>