4
# BUG#16777: Can not create trigger nor view w/o definer if --skip-grant-tables
7
# Also, the following test cases have been moved here:
8
# - test that we can create VIEW if privileges check switched off has been
10
# - test that we can create and drop procedure without warnings (BUG#9993);
11
# - BUG#17595: "DROP FUNCTION IF EXISTS" crashes server;
12
# - BUG#13504: creation view with DEFINER clause if --skip-grant-tables
19
DROP VIEW IF EXISTS v1;
20
DROP VIEW IF EXISTS v2;
21
DROP VIEW IF EXISTS v3;
23
DROP TABLE IF EXISTS t1;
25
DROP PROCEDURE IF EXISTS p1;
26
DROP PROCEDURE IF EXISTS p2;
27
DROP PROCEDURE IF EXISTS p3;
29
DROP FUNCTION IF EXISTS f1;
30
DROP FUNCTION IF EXISTS f2;
31
DROP FUNCTION IF EXISTS f3;
37
CREATE TABLE t1(c INT);
39
# - try to create with implicit definer (definer would be ''@'');
41
CREATE TRIGGER t1_bi BEFORE INSERT ON t1
45
CREATE VIEW v1 AS SELECT * FROM t1;
50
CREATE FUNCTION f1() RETURNS INT
53
# - try to create with explicit definer;
55
CREATE DEFINER=a@b TRIGGER ti_ai AFTER INSERT ON t1
59
CREATE DEFINER=a@b VIEW v2 AS SELECT * FROM t1;
61
CREATE DEFINER=a@b PROCEDURE p2()
64
CREATE DEFINER=a@b FUNCTION f2() RETURNS INT
67
# - try to create with explicit definer with empty host;
69
CREATE DEFINER=a@'' TRIGGER ti_bu BEFORE UPDATE ON t1
73
CREATE DEFINER=a@'' VIEW v3 AS SELECT * FROM t1;
75
CREATE DEFINER=a@'' PROCEDURE p3()
78
CREATE DEFINER=a@'' FUNCTION f3() RETURNS INT
81
# - check that empty host name is treated correctly;
85
SHOW CREATE PROCEDURE p3;
87
SHOW CREATE FUNCTION f3;
110
# Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server
112
--error ER_OPTION_PREVENTS_STATEMENT
113
set global event_scheduler=1;
116
# Bug#26285 Selecting information_schema crahes server
118
select count(*) from information_schema.COLUMN_PRIVILEGES;
119
select count(*) from information_schema.SCHEMA_PRIVILEGES;
120
select count(*) from information_schema.TABLE_PRIVILEGES;
121
select count(*) from information_schema.USER_PRIVILEGES;
122
--echo End of 5.0 tests
125
--echo # Bug#29817 Queries with UDF fail with non-descriptive error
126
--echo # if mysql.proc is missing
128
--error ER_SP_DOES_NOT_EXIST
129
select no_such_function(1);
131
--echo End of 5.1 tests