MariaDB [test]> update (select * from t1 where a < 3) as t set a=14;
|
ERROR 1288 (HY000): The target table t of the UPDATE is not updatable
|
|
MariaDB [test]> update (select a from t1 where a < 3) as t, t2 set t.a=10 where t.a=t2.b;
|
ERROR 1288 (HY000): The target table t of the UPDATE is not updatable
|
|
MariaDB [test]> create view v1 as (select a from t1 where a < 3);
|
|
MariaDB [test]> explain update v1 set a=14;
|
+------+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
| 1 | SIMPLE | t1 | ALL | NULL | NULL | NULL | NULL | 4 | Using where |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
|
MariaDB [test]> explain update v1 as t, t2 set t.a=10 where t.a=t2.b;
|
+------+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
| 1 | SIMPLE | t1 | ALL | NULL | NULL | NULL | NULL | 4 | Using where |
|
| 1 | SIMPLE | t2 | ALL | NULL | NULL | NULL | NULL | 5 | Using where |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
|