Comment 1 for bug 794038

Revision history for this message
Igor Babaev (igorb-seattle) wrote :

The following example demonstrates the problem:

MariaDB [test]> CREATE TABLE t1 (a int);
Query OK, 0 rows affected (0.02 sec)

MariaDB [test]> CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT * FROM t1;
Query OK, 0 rows affected (0.01 sec)

MariaDB [test]> CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> CREATE ALGORITHM = TEMPTABLE VIEW v3 AS SELECT * FROM v2;
Query OK, 0 rows affected (0.01 sec)

MariaDB [test]> INSERT INTO v1 VALUES (1);
ERROR 1471 (HY000): The target table v1 of the INSERT is not insertable-into
MariaDB [test]> INSERT INTO v2 VALUES (1);
ERROR 1471 (HY000): The target table v2 of the INSERT is not insertable-into
MariaDB [test]> INSERT INTO v3 VALUES (1);
ERROR 2013 (HY000): Lost connection to MySQL server during query <-- !!!

while this test case works correctly:

MariaDB [test]> CREATE ALGORITHM = MERGE VIEW v4 AS SELECT * FROM t1;
Query OK, 0 rows affected (0.01 sec)

MariaDB [test]> CREATE ALGORITHM = TEMPTABLE VIEW v5 AS SELECT * FROM v4;
Query OK, 0 rows affected (0.01 sec)

MariaDB [test]> INSERT INTO v5 VALUES (1);
ERROR 1471 (HY000): The target table v5 of the INSERT is not insertable-into