I found a bug on the view implementation.
According to the manual some view is updatable if the view satisfies the “one-to-one relationship” between the rows in the view definition and the rows in the underlying tables. To be more specific a view is not updatable if it contains any of the following:
- aggregate functions (AVG(), SUM(), MIN(), …)
- DISTINCT
- GROUP BY
- HAVING
- UNION (ALL)
- subquery in select list
- JOIN (with some exception)
- non-updatable view in the FROM clause
- algorithm=temptable
- refers only to literal values
So, let’s try this simple example:
mysql> create table t1 (a int);
Query OK, 0 rows affected (0.21 sec)
mysql> create view v1 as select a from t1;
Query OK, 0 rows affected (0.00 sec) …