connecting as 'root'; connected; SETTING UP FOR VIEW TESTS CREATE DATABASE viewdb; use viewdb; GRANT CREATE VIEW, SELECT ON viewdb.* TO 'view_create'@'localhost' IDENTIFIED BY 'view_create'; GRANT SELECT ON viewdb.* TO 'view_select'@'localhost' IDENTIFIED BY 'view_select'; GRANT SELECT, INSERT ON viewdb.* TO 'view_insert'@'localhost' IDENTIFIED BY 'view_insert'; CREATE TABLE upgrade_t8 (a INT, b INT, c INT, PRIMARY KEY(a,b)); INSERT INTO upgrade_t8 VALUES (10,2,-1), (20,3,-2), (30,4,-3), (40,5,-4), (50,10,-5); SELECT * FROM upgrade_t8; a b c 10 2 -1 20 3 -2 30 4 -3 40 5 -4 50 10 -5 DELETE FROM upgrade_t8; INSERT INTO upgrade_t8 VALUES (10,2,-1), (20,3,-2); connecting to user 'view_create' connected CREATE SQL SECURITY INVOKER VIEW upgrade_v31 (x,y,z) AS SELECT c, b, a FROM upgrade_t8; CREATE SQL SECURITY INVOKER VIEW upgrade_v32 (x,y) AS SELECT b, a FROM upgrade_t8; CREATE SQL SECURITY INVOKER VIEW upgrade_v33 (x,y,z) AS SELECT b, a, b FROM upgrade_t8; CREATE SQL SECURITY INVOKER VIEW upgrade_v34 (x,y,z) AS SELECT c+1, b, a FROM upgrade_t8; CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW upgrade_v35 (x,y,z) AS SELECT c, b, a FROM upgrade_t8; connecting to user 'view_insert' connected INSERT INTO upgrade_v33 VALUES (-60,4,30); ERROR HY000: The target table upgrade_v33 of the INSERT is not insertable-into INSERT INTO upgrade_v34 VALUES (-60,4,30); ERROR HY000: The target table upgrade_v34 of the INSERT is not insertable-into INSERT INTO upgrade_v35 VALUES (-60,4,30); ERROR HY000: The target table upgrade_v35 of the INSERT is not insertable-into INSERT INTO upgrade_v31 VALUES (-60,4,30); INSERT INTO upgrade_v31 (z,y,x) VALUES (50,6,-100); INSERT INTO upgrade_v32 VALUES (5,40); connecting to user 'view_select' connected SELECT * FROM upgrade_t8; a b c 10 2 -1 20 3 -2 30 4 -60 50 6 -100 40 5 NULL