| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
connection master; |
| 4 |
SET sql_mode=ORACLE; |
| 5 |
CREATE PACKAGE pack AS |
| 6 |
FUNCTION f1 RETURN INT; |
| 7 |
PROCEDURE p1; |
| 8 |
END; |
| 9 |
$$ |
| 10 |
CREATE PACKAGE BODY pack AS |
| 11 |
FUNCTION f1 RETURN INT AS |
| 12 |
BEGIN |
| 13 |
RETURN 10; |
| 14 |
END; |
| 15 |
PROCEDURE p1 AS |
| 16 |
BEGIN |
| 17 |
SELECT f1(); |
| 18 |
END; |
| 19 |
END pack; |
| 20 |
$$ |
| 21 |
connection slave; |
| 22 |
connection slave; |
| 23 |
SELECT * FROM mysql.proc WHERE db='test' AND name='pack'; |
| 24 |
db test |
| 25 |
name pack |
| 26 |
type PACKAGE |
| 27 |
specific_name pack |
| 28 |
language SQL |
| 29 |
sql_data_access CONTAINS_SQL |
| 30 |
is_deterministic NO |
| 31 |
security_type DEFINER |
| 32 |
param_list |
| 33 |
returns |
| 34 |
body AS |
| 35 |
FUNCTION f1 RETURN INT; |
| 36 |
PROCEDURE p1; |
| 37 |
END |
| 38 |
definer root@localhost |
| 39 |
created # |
| 40 |
modified # |
| 41 |
sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT |
| 42 |
comment |
| 43 |
character_set_client latin1 |
| 44 |
collation_connection latin1_swedish_ci |
| 45 |
db_collation utf8mb4_uca1400_ai_ci |
| 46 |
body_utf8 AS |
| 47 |
FUNCTION f1 RETURN INT; |
| 48 |
PROCEDURE p1; |
| 49 |
END |
| 50 |
aggregate NONE |
| 51 |
db test |
| 52 |
name pack |
| 53 |
type PACKAGE BODY |
| 54 |
specific_name pack |
| 55 |
language SQL |
| 56 |
sql_data_access CONTAINS_SQL |
| 57 |
is_deterministic NO |
| 58 |
security_type DEFINER |
| 59 |
param_list |
| 60 |
returns |
| 61 |
body AS |
| 62 |
FUNCTION f1 RETURN INT AS |
| 63 |
BEGIN |
| 64 |
RETURN 10; |
| 65 |
END; |
| 66 |
PROCEDURE p1 AS |
| 67 |
BEGIN |
| 68 |
SELECT f1(); |
| 69 |
END; |
| 70 |
END |
| 71 |
definer root@localhost |
| 72 |
created # |
| 73 |
modified # |
| 74 |
sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT |
| 75 |
comment |
| 76 |
character_set_client latin1 |
| 77 |
collation_connection latin1_swedish_ci |
| 78 |
db_collation utf8mb4_uca1400_ai_ci |
| 79 |
body_utf8 AS |
| 80 |
FUNCTION f1 RETURN INT AS |
| 81 |
BEGIN |
| 82 |
RETURN 10; |
| 83 |
END; |
| 84 |
PROCEDURE p1 AS |
| 85 |
BEGIN |
| 86 |
SELECT f1(); |
| 87 |
END; |
| 88 |
END |
| 89 |
aggregate NONE |
| 90 |
SELECT * FROM mysql.proc WHERE db='test' AND name LIKE 'pack.%'; |
| 91 |
SET @@sql_mode=ORACLE; |
| 92 |
SELECT pack.f1(); |
| 93 |
pack.f1() |
| 94 |
10 |
| 95 |
CALL pack.p1(); |
| 96 |
f1() |
| 97 |
10 |
| 98 |
SET @@sql_mode=DEFAULT; |
| 99 |
connection master; |
| 100 |
DROP PACKAGE pack; |
| 101 |
connection slave; |
| 102 |
connection slave; |
| 103 |
SELECT COUNT(*) FROM mysql.proc WHERE db='test' AND name='pack'; |
| 104 |
COUNT(*) |
| 105 |
0 |
| 106 |
# |
| 107 |
# Creating a package with a COMMENT |
| 108 |
# |
| 109 |
connection master; |
| 110 |
CREATE PACKAGE p1 COMMENT 'package-p1-comment' AS |
| 111 |
PROCEDURE p1; |
| 112 |
END; |
| 113 |
$$ |
| 114 |
CREATE PACKAGE BODY p1 COMMENT 'package-body-p1-comment' AS |
| 115 |
PROCEDURE p1 AS |
| 116 |
BEGIN |
| 117 |
NULL; |
| 118 |
END; |
| 119 |
END; |
| 120 |
$$ |
| 121 |
SELECT definer, name, security_type, type, `comment` FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type; |
| 122 |
definer name security_type type comment |
| 123 |
root@localhost p1 DEFINER PACKAGE package-p1-comment |
| 124 |
root@localhost p1 DEFINER PACKAGE BODY package-body-p1-comment |
| 125 |
connection slave; |
| 126 |
SELECT definer, name, security_type, type, `comment` FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type; |
| 127 |
definer name security_type type comment |
| 128 |
root@localhost p1 DEFINER PACKAGE package-p1-comment |
| 129 |
root@localhost p1 DEFINER PACKAGE BODY package-body-p1-comment |
| 130 |
connection master; |
| 131 |
DROP PACKAGE p1; |
| 132 |
connection slave; |
| 133 |
# |
| 134 |
# Creating a package with a different DEFINER |
| 135 |
# |
| 136 |
connection master; |
| 137 |
CREATE DEFINER=xxx@localhost PACKAGE p1 AS |
| 138 |
PROCEDURE p1; |
| 139 |
END; |
| 140 |
$$ |
| 141 |
Warnings: |
| 142 |
Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist |
| 143 |
CREATE DEFINER=xxx@localhost PACKAGE BODY p1 AS |
| 144 |
PROCEDURE p1 AS |
| 145 |
BEGIN |
| 146 |
NULL; |
| 147 |
END; |
| 148 |
END; |
| 149 |
$$ |
| 150 |
Warnings: |
| 151 |
Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist |
| 152 |
SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type; |
| 153 |
definer name security_type type |
| 154 |
xxx@localhost p1 DEFINER PACKAGE |
| 155 |
xxx@localhost p1 DEFINER PACKAGE BODY |
| 156 |
connection slave; |
| 157 |
SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type; |
| 158 |
definer name security_type type |
| 159 |
xxx@localhost p1 DEFINER PACKAGE |
| 160 |
xxx@localhost p1 DEFINER PACKAGE BODY |
| 161 |
connection master; |
| 162 |
DROP PACKAGE p1; |
| 163 |
connection slave; |
| 164 |
# |
| 165 |
# Creating a package with a different DEFINER + SQL SECURITY INVOKER |
| 166 |
# |
| 167 |
connection master; |
| 168 |
CREATE DEFINER=xxx@localhost PACKAGE p1 SQL SECURITY INVOKER AS |
| 169 |
PROCEDURE p1; |
| 170 |
END; |
| 171 |
$$ |
| 172 |
Warnings: |
| 173 |
Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist |
| 174 |
CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER AS |
| 175 |
PROCEDURE p1 AS |
| 176 |
BEGIN |
| 177 |
NULL; |
| 178 |
END; |
| 179 |
END; |
| 180 |
$$ |
| 181 |
Warnings: |
| 182 |
Note 1449 The user specified as a definer ('xxx'@'localhost') does not exist |
| 183 |
SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type; |
| 184 |
definer name security_type type |
| 185 |
xxx@localhost p1 INVOKER PACKAGE |
| 186 |
xxx@localhost p1 INVOKER PACKAGE BODY |
| 187 |
connection slave; |
| 188 |
SELECT definer, name, security_type, type FROM mysql.proc WHERE name LIKE 'p1%' ORDER BY definer, name, type; |
| 189 |
definer name security_type type |
| 190 |
xxx@localhost p1 INVOKER PACKAGE |
| 191 |
xxx@localhost p1 INVOKER PACKAGE BODY |
| 192 |
connection master; |
| 193 |
DROP PACKAGE p1; |
| 194 |
connection slave; |
| 195 |
include/rpl_end.inc |