Does MariaDB require aliases for subquery table locks?
Really peculiar behaviour, unfortunate this limitation still exists atleast in my version of MariaDB:

MariaDB [test]&gt; select @@version;
+-----------------+
| @@version       |
+-----------------+
| 10.0.23-MariaDB |
+-----------------+
1 row in set (0.00 sec)


MariaDB [test]&gt; create table t ( x int not null );
Query OK, 0 rows affected (0.05 sec)

MariaDB [test]&gt; lock tables t read;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]&gt; select * from t t1, t t2;
ERROR 1100 (HY000): Table 't1' was not locked with LOCK TABLES


Locking the aliases does not seem to help

MariaDB [test]&gt; lock tables t read, t1 read, t2 read;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]&gt; select * from t t1, t t2;
ERROR 1100 (HY000): Table 't1' was not locked with LOCK TABLES


Weird indeed.