DROP PROCEDURE IF EXISTS test_invalid; DELIMITER // CREATE PROCEDURE test_invalid() DETERMINISTIC BEGIN SELECT ename FROM emp WHERE empno = 7788; END // DELIMITER ;
CREATE VIEW emp_view AS SELECT * FROM emp; SELECT * FROM emp_view;
(SELECT結果は省略)
(2) テーブル名を変更
ALTER TABLE emp RENAME emp_renamed;
(3) ビューを参照するとエラー
SELECT * FROM emp_view; ERROR 1356 (HY000): View 'scott.emp_view' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them