blob: e8766eba155fa93ebf56a40fbc6ac582e4ca32d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
connection node_2;
connection node_1;
connection node_1;
CREATE USER 'user1';
CREATE
DEFINER = 'user1'
FUNCTION f1 (param INTEGER)
RETURNS VARCHAR(200)
COMMENT 'f1_comment'
LANGUAGE SQL
NOT DETERMINISTIC
MODIFIES SQL DATA
SQL SECURITY DEFINER
RETURN 'abc';
GRANT EXECUTE ON FUNCTION f1 TO user1;
CREATE
DEFINER = CURRENT_USER
FUNCTION f2 (param VARCHAR(100))
RETURNS INTEGER
DETERMINISTIC
NO SQL
SQL SECURITY INVOKER
RETURN 123;
connection node_1;
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1 COLLATE latin1_swedish_ci
MODIFIES SQL DATA
COMMENT 'f1_comment'
RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
connection node_2;
SELECT 1 FROM DUAL;
1
1
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1 COLLATE latin1_swedish_ci
MODIFIES SQL DATA
COMMENT 'f1_comment'
RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
connection node_1;
SHOW CREATE FUNCTION f2;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f2 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11)
NO SQL
DETERMINISTIC
SQL SECURITY INVOKER
RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
connection node_2;
SHOW CREATE FUNCTION f2;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f2 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11)
NO SQL
DETERMINISTIC
SQL SECURITY INVOKER
RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
SELECT f1(1) = 'abc';
f1(1) = 'abc'
1
SELECT f2('abc') = 123;
f2('abc') = 123
1
connection node_1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP USER 'user1';
|