# # Views using MERGE algorithm give unauthorized privilege to underlying tables. # CREATE USER mysqluser1@localhost; CREATE DATABASE mysqltest1; USE mysqltest1; CREATE TABLE t1 ( a INT, b INT ); CREATE ALGORITHM = MERGE VIEW v1 AS SELECT a, b FROM t1; GRANT SELECT( b ) ON v1 TO mysqluser1@localhost; --connect (connection1, localhost, mysqluser1, , mysqltest1) # This gives an error, as should be. --error ER_COLUMNACCESS_DENIED_ERROR SELECT a, b FROM v1; # This fails to raise an error, should work as above. --error ER_COLUMNACCESS_DENIED_ERROR SELECT * FROM v1; --disconnect connection1 --connection default DROP TABLE t1; DROP VIEW v1; DROP DATABASE mysqltest1; DROP USER mysqluser1@localhost; USE test;