1
by brian
clean slate |
1 |
use test;
|
2 |
DROP VIEW IF EXISTS v1;
|
|
3 |
DROP VIEW IF EXISTS v2;
|
|
4 |
DROP VIEW IF EXISTS v3;
|
|
5 |
DROP TABLE IF EXISTS t1;
|
|
6 |
DROP PROCEDURE IF EXISTS p1;
|
|
7 |
DROP PROCEDURE IF EXISTS p2;
|
|
8 |
DROP PROCEDURE IF EXISTS p3;
|
|
9 |
DROP FUNCTION IF EXISTS f1;
|
|
10 |
DROP FUNCTION IF EXISTS f2;
|
|
11 |
DROP FUNCTION IF EXISTS f3;
|
|
12 |
CREATE TABLE t1(c INT);
|
|
13 |
CREATE TRIGGER t1_bi BEFORE INSERT ON t1
|
|
14 |
FOR EACH ROW
|
|
15 |
SET @a = 1;
|
|
16 |
CREATE VIEW v1 AS SELECT * FROM t1;
|
|
17 |
CREATE PROCEDURE p1()
|
|
18 |
SELECT 1;
|
|
19 |
CREATE FUNCTION f1() RETURNS INT
|
|
20 |
RETURN 1;
|
|
21 |
CREATE DEFINER=a@b TRIGGER ti_ai AFTER INSERT ON t1
|
|
22 |
FOR EACH ROW
|
|
23 |
SET @b = 1;
|
|
24 |
CREATE DEFINER=a@b VIEW v2 AS SELECT * FROM t1;
|
|
25 |
CREATE DEFINER=a@b PROCEDURE p2()
|
|
26 |
SELECT 2;
|
|
27 |
CREATE DEFINER=a@b FUNCTION f2() RETURNS INT
|
|
28 |
RETURN 2;
|
|
29 |
CREATE DEFINER=a@'' TRIGGER ti_bu BEFORE UPDATE ON t1
|
|
30 |
FOR EACH ROW
|
|
31 |
SET @c = 1;
|
|
32 |
CREATE DEFINER=a@'' VIEW v3 AS SELECT * FROM t1;
|
|
33 |
CREATE DEFINER=a@'' PROCEDURE p3()
|
|
34 |
SELECT 3;
|
|
35 |
CREATE DEFINER=a@'' FUNCTION f3() RETURNS INT
|
|
36 |
RETURN 3;
|
|
37 |
SHOW CREATE VIEW v3;
|
|
38 |
View Create View character_set_client collation_connection
|
|
39 |
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`a`@`` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`c` AS `c` from `t1` latin1 latin1_swedish_ci
|
|
40 |
SHOW CREATE PROCEDURE p3;
|
|
41 |
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
|
42 |
p3 CREATE DEFINER=`a`@`` PROCEDURE `p3`()
|
|
43 |
SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci
|
|
44 |
SHOW CREATE FUNCTION f3;
|
|
45 |
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
|
46 |
f3 CREATE DEFINER=`a`@`` FUNCTION `f3`() RETURNS int(11)
|
|
47 |
RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci
|
|
48 |
DROP TRIGGER t1_bi;
|
|
49 |
DROP TRIGGER ti_ai;
|
|
50 |
DROP TRIGGER ti_bu;
|
|
51 |
DROP VIEW v1;
|
|
52 |
DROP VIEW v2;
|
|
53 |
DROP VIEW v3;
|
|
54 |
DROP TABLE t1;
|
|
55 |
DROP PROCEDURE p1;
|
|
56 |
DROP PROCEDURE p2;
|
|
57 |
DROP PROCEDURE p3;
|
|
58 |
DROP FUNCTION f1;
|
|
59 |
DROP FUNCTION f2;
|
|
60 |
DROP FUNCTION f3;
|
|
61 |
set global event_scheduler=1;
|
|
62 |
ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED or --skip-grant-tables option so it cannot execute this statement
|
|
63 |
select count(*) from information_schema.COLUMN_PRIVILEGES;
|
|
64 |
count(*)
|
|
65 |
0
|
|
66 |
select count(*) from information_schema.SCHEMA_PRIVILEGES;
|
|
67 |
count(*)
|
|
68 |
0
|
|
69 |
select count(*) from information_schema.TABLE_PRIVILEGES;
|
|
70 |
count(*)
|
|
71 |
0
|
|
72 |
select count(*) from information_schema.USER_PRIVILEGES;
|
|
73 |
count(*)
|
|
74 |
0
|
|
75 |
End of 5.0 tests
|
|
76 |
#
|
|
77 |
# Bug#29817 Queries with UDF fail with non-descriptive error
|
|
78 |
# if mysql.proc is missing
|
|
79 |
#
|
|
80 |
select no_such_function(1);
|
|
81 |
ERROR 42000: FUNCTION test.no_such_function does not exist
|
|
82 |
End of 5.1 tests
|