title: Can't unlock table in MariaDB 10.2
body: <p>I'm using MariaDB 10.2. I have a table that has ~60M rows. Originally was I was trying to run:</p>
  
  <pre><code>insert into signals select * from signals_tmp where signal_num = 21;
  </code></pre>
  
  <p>And MariaDB froze. Since then I tried to restart mysqld and my laptop so I don't have the exact state of when it first froze. Now when I tried to do this:</p>
  
  <pre><code>select count(*) from signals where signal_num = 20
  </code></pre>
  
  <p>It froze, so I pressed <kbd>Ctrl</kbd>+<kbd>C</kbd> in MySQL. Then I run the following:</p>
  
  <pre><code>MariaDB [phd]&gt; show open tables where In_use = 1;
  +----------+---------+--------+-------------+
  | Database | Table   | In_use | Name_locked |
  +----------+---------+--------+-------------+
  | phd      | signals |      1 |           0 |
  +----------+---------+--------+-------------+
  1 row in set (0.00 sec)
  
  MariaDB [phd]&gt; show processlist;
  +----+-------------+-----------------+------+---------+------+--------------------------+----------------------------------------------------+----------+
  | Id | User        | Host            | db   | Command | Time | State                    
  | Info                                               | Progress |
  +----+-------------+-----------------+------+---------+------+--------------------------+----------------------------------------------------+----------+
  |  1 | system user |                 | NULL | Daemon  | NULL | InnoDB purge coordinator | NULL                                               |    0.000 |
  |  2 | system user |                 | NULL | Daemon  | NULL | InnoDB purge worker      | NULL                                               |    0.000 |
  |  3 | system user |                 | NULL | Daemon  | NULL | InnoDB purge worker      | NULL                                               |    0.000 |
  |  4 | system user |                 | NULL | Daemon  | NULL | InnoDB purge worker      | NULL                                               |    0.000 |
  |  5 | system user |                 | NULL | Daemon  | NULL | InnoDB shutdown handler  | NULL                                               |    0.000 |
  |  8 | root        | localhost:50473 | phd  | Killed  |  402 | Sending data             
  | select count(*) from signals where signal_num = 20 |    0.000 |
  | 10 | root        | localhost:50477 | phd  | Query   |    0 | init                     
  | show processlist                                   |    0.000 |
  | 11 | root        | localhost:50489 | NULL | Query   |   48 | Filling schema table     | SHOW STATUS                                        |    0.000 
  |
  +----+-------------+-----------------+------+---------+------+--------------------------+----------------------------------------------------+----------+
  8 rows in set (0.00 sec)
  </code></pre>
  
  <p>When I tried to do flush tables, it hanged there with no CPU usage (i.e., looks like it's not doing anything?).</p>
  
  <p>[EDIT] as per comment, here is the statistics result.</p>
  
  <pre><code>MariaDB [(none)]&gt; select distinct COMMENT from information_schema.statistics where TABLE_SCHEMA='phd' and table_schema='signals';
  Empty set (0.00 sec)
  </code></pre>
  
  <p>Any idea what has happened to my database?</p>