1 # This tests not performed with embedded server
2 -- source include/not_embedded.inc
7 # BUG#16777: Can not create trigger nor view w/o definer if --skip-grant-tables
10 # Also, the following test cases have been moved here:
11 # - test that we can create VIEW if privileges check switched off has been
13 # - test that we can create and drop procedure without warnings (BUG#9993);
14 # - BUG#17595: "DROP FUNCTION IF EXISTS" crashes server;
15 # - BUG#13504: creation view with DEFINER clause if --skip-grant-tables
22 DROP VIEW IF EXISTS v1;
23 DROP VIEW IF EXISTS v2;
24 DROP VIEW IF EXISTS v3;
26 DROP TABLE IF EXISTS t1;
28 DROP PROCEDURE IF EXISTS p1;
29 DROP PROCEDURE IF EXISTS p2;
30 DROP PROCEDURE IF EXISTS p3;
32 DROP FUNCTION IF EXISTS f1;
33 DROP FUNCTION IF EXISTS f2;
34 DROP FUNCTION IF EXISTS f3;
40 CREATE TABLE t1(c INT);
42 # - try to create with implicit definer (definer would be ''@'');
44 CREATE TRIGGER t1_bi BEFORE INSERT ON t1
48 CREATE VIEW v1 AS SELECT * FROM t1;
53 CREATE FUNCTION f1() RETURNS INT
56 # - try to create with explicit definer;
58 CREATE DEFINER=a@b TRIGGER ti_ai AFTER INSERT ON t1
62 CREATE DEFINER=a@b VIEW v2 AS SELECT * FROM t1;
64 CREATE DEFINER=a@b PROCEDURE p2()
67 CREATE DEFINER=a@b FUNCTION f2() RETURNS INT
70 # - try to create with explicit definer with empty host;
72 CREATE DEFINER=a@'' TRIGGER ti_bu BEFORE UPDATE ON t1
76 CREATE DEFINER=a@'' VIEW v3 AS SELECT * FROM t1;
78 CREATE DEFINER=a@'' PROCEDURE p3()
81 CREATE DEFINER=a@'' FUNCTION f3() RETURNS INT
84 # - check that empty host name is treated correctly;
88 SHOW CREATE PROCEDURE p3;
90 SHOW CREATE FUNCTION f3;
113 # Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server
115 --error ER_OPTION_PREVENTS_STATEMENT
116 set global event_scheduler=1;
119 # Bug#26285 Selecting information_schema crahes server
121 select count(*) from information_schema.COLUMN_PRIVILEGES;
122 select count(*) from information_schema.SCHEMA_PRIVILEGES;
123 select count(*) from information_schema.TABLE_PRIVILEGES;
124 select count(*) from information_schema.USER_PRIVILEGES;
125 --echo End of 5.0 tests
128 --echo # Bug#29817 Queries with UDF fail with non-descriptive error
129 --echo # if mysql.proc is missing
131 --error ER_SP_DOES_NOT_EXIST
132 select no_such_function(1);
134 --echo End of 5.1 tests