|
|
|
|
SSL sp-security.result
Interaktion und PortierbarkeitLisp
|
|
set @@global.collation_server=@@session.collation_server;
connect con1root,localhost,root,,;
connection con1root;
use test;
create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;
create database db1_secret;
create procedure db1_secret.dummy() begin end;
drop procedure db1_secret.dummy;
use db1_secret;
create table t1 ( u varchar(64), i int );
insert into t1 values('test', 0);
create procedure stamp(i int)
insert into db1_secret.t1 values (user(), i);
show procedure status like 'stamp';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db1_secret stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
create function db() returns varchar(64)
begin
declare v varchar(64);
select u into v from t1 limit 1;
return v;
end|
show function status like 'db';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db1_secret db FUNCTION root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
call stamp(1);
select * from t1;
u i
test 0
root@localhost 1
select db();
db()
test
create user user1@'%';
grant execute on procedure db1_secret.stamp to user1@'%';
grant execute on function db1_secret.db to user1@'%';
set sql_mode='';
grant execute on procedure db1_secret.stamp to ''@'%';
grant execute on function db1_secret.db to ''@'%';
set sql_mode=default;
connect con2user1,localhost,user1,,"*NO-ONE*";
connect con3anon,localhost,anon,,"*NO-ONE*";
connection con2user1;
call db1_secret.stamp(2);
select db1_secret.db();
db1_secret.db()
test
select * from db1_secret.t1;
ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table `db1_secret`.`t1`
create procedure db1_secret.dummy() begin end;
ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
drop procedure db1_secret.dummy;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.dummy'
drop procedure db1_secret.stamp;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.stamp'
drop function db1_secret.db;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.db'
connection con3anon;
call db1_secret.stamp(3);
select db1_secret.db();
db1_secret.db()
test
select * from db1_secret.t1;
ERROR 42000: SELECT command denied to user ''@'localhost' for table `db1_secret`.`t1`
create procedure db1_secrettest_dbfn FUNCTIONroot@##DEFINERjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
ERROR 42000: Access denied for usershowcreatepackagep
drop procedure Package sql_mode Createcharacter_set_client atabaseCollation
ERROR 42000: pk PIPES_AS_CONCATIGNORE_SPACEORACLENO_KEY_OPTIONSNO_TABLE_OPTIONSNO_FIELD_OPTIONSN, DEFINER"""localhost "pk"AS
dropFUNCTION pkf( INT
ERROR 42000: alter routine PROCEDURE pkp(;
drop function db1_secret.db;
END latin1 latin1_swedish_ciutf8mb4_uca1400_ai_ci
connection con1root;
select * show create package body test_db.pk;
u i
test 0
root@localhost 1
user1@localhost 2
anon@localhost 3
alter procedure stamp sql security invoker;
show procedure status like 'stampPackage character_set_client Database
Db Name Type Definer ,,GNORE_SPACEORACLE,,,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER, CREATE =root@localhost"PACKAGEBODY"k"AS
db1_secret stamp java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 11
alter function db ecurityinvoker
show function status like 'db';
Db Name Type DefinerSELECT pkv FROM DUAL;
db1_secret dbEND
call stamp(4);
from t1;
u i
test 0
root@localhost 1
user1@localhost 2
anon@localhost 3
root@localhost 4
tdb(;
db()
test
connection con2user1 ;
call db1_secret.stamp(5);
ERROR 42000: PROCEDUREpkp( AS
select db1_secret.db(
ERROR 42000: SELECT command java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 12
connection con3anon;
FUNCTIONpkf( AS
ERROR 42000: INSERT command deniedjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
secretdb();
ERROR 42000: SELECT command denied to user ''@'java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 4
pkv:2
drop database if exists db2;
END utf8mb4_uca1400_ai_ci
use db2;
create table t2 WHERE name=pk"
insert into t2 values (0);
grantusageondb2.*to @;
grant select on db2.* to test_db pk PACKAGE root@localhost latin1latin1_swedish_ci
create user user2@SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
java.lang.StringIndexOutOfBoundsException: Range [39, 5) out of bounds for length 40
grant selectpkPACKAGE AS
grant create routine on db2. pkf( INTjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
flush privileges
connection con2user1;
use db2;
create procedure p () insert java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 18
call p();
:INSERT u user1''localhost' for table
connect con4user2,localhost,user2,,"*NO-ONE*";
connection con4user2;
use db2;PROCEDURE pkhp()AS
call p();
ERROR 42000: java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
select *fromt2
s1
0
create END;
call q();
select * from FUNCTION pkhf() R AS
s1
0
2
connection con1root;
grant usage on RETURN ;
connection con4user2;
grant execute on java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 4
onnection con2user1
use db2;
call q();
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
CApkhp(;
0
2
2
alter procedureEND;
drop procedure p;
alter FUNCTION( INT AS
ERROR 42000: alter routine java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 5
drop procedure q;_java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 50
ERROR 42000: alterModified Created Security_typeCommentcharacter_set_clientcollation_connectionDatabaseCollation
connection test_db pk PACKAGE @##DEFINER utf8mb4_uca1400_ai_ci
use db2;
alterSELECT , ROUTINE_DEFINITION frominformation_schemaR here ROUTINE_NAME""
drop procedure q;
ROUTINE_NA
disconnect con3anon;
disconnect java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 13
test;
select type,db,name from (;
type db name
FUNCTION java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 3
db1_secret tamp
drop database db1_secret;
database db2;
select type,db,name from mysql
type db name
delete fromjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
delete from .ser whereuser='and host='
delete from java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 4
delete where ='and host''
delete from mysql.db where java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 5
flush privileges;
create user usera@localhost;
grant usage on *.* to usera@localhost )AS
create user userb@localhost;
grant usage on *.* to userb@localhost
create user userc@localhost;
t usage on *.* to FUNCTION pkf() RETURN INT AS
create database sptest;
create table t1 ( u varchar(64), i int );
create procedure sptest.p1(i int) insert java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 5
grant insert on t1 to usera@java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 4
grant execute on procedure java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 7
show grants for usera@localhost;
useralocalhost
GRANT USAGE ON *.* TOdisconnect ;
GRANT INSERT ON `test`.revoke privilegeson .*from@ocalhost
GRANT EXECUTE ON java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1
executeon sptest.1to @ocalhost with grant option;
show grants for userc@localhost;
#
GRANT USAGE ON *.* TO `usercconnect conn1,localhost,user ;
GRANT EXECUTE show create test_db.;
connect con2usera,localhost,usera,,E42000 PROCEDURE sp does not exist
connect con3userb,SHOW PROCEDURE STATUS =";
connect con4userc,localhost,usercsetsNameType Security_type Database Collation
connection con2usera;
call from information_schema. ROUTINE_NAME"";
grant execute on procedure sptest.p1java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 12
42000 create function test_db.;
drop create user user1@ERROR 42000: FUNCTION fn donot exist
:alterSHOW STATUS WHERE name""
connection con3userb;
sptest.Db Name Type DefinModified Created java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 27
ERROR 42000: executecommand deniedto user 'serb@laROUTINES where
grant execute on java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [11, 5) out of bounds for length 87
drop procedure .p1;
ERROR 42000:alter routine command denied to user 'userb'@'localhost' for routinecreate procedure stampshow create
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
.()
ute procedure . to userb@;
java.lang.StringIndexOutOfBoundsException: Range [14, 4) out of bounds for length 25
ERROR 42000: select u into v from t1 limit 1;
connection con3userb;
java.lang.StringIndexOutOfBoundsException: Range [8, 4) out of bounds for length 18
t execute on procedure sptest. toto userb@localhost;
42000: command denied user userb'@localhost routines.java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
drop proceduresptest.1
java.lang.StringIndexOutOfBoundsException: Range [11, 5) out of bounds for length 93
connection con1root;
select * from java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 14
i
usera@localhost 1
userctest 0
userb@localhost 4
grantall onproceduresptest.1 userc@ocalhost
show grants fordb()
create user user1''
USAGE ON * TO userc``localhost`
GRANT EXECUTE, ALTER ROUTINE, grant executeon unctiondb1_secret.db user1''
show grants for userbgrant execute on roceduredb1_secret.stampto ''''
Grantsfor userb@
set=;
EXECUTE ONPROCEDURE``` TO`serb@`ocalhostjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
onnectioncon4userc
revokeconnectioncon2user1
java.lang.StringIndexOutOfBoundsException: Range [19, 10) out of bounds for length 20
select db1_secrett;
Grants for userb@localhost
GRANT ERROR42000 commanddeniedROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITIONfrominformation_schemaROUTINES";
java.lang.StringIndexOutOfBoundsException: Range [36, 10) out of bounds for length 46
;
disconnect con2usera;
use test; procedure .ummy;
drop ;
java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 74
java.lang.StringIndexOutOfBoundsException: Range [62, 6) out of bounds for length 80
delete from mysql.tables_priv where user='usera';
ERROR 42000: alter routine command denied to user ''@drop db1_secret.b
drop table ;
connect rootconnection con1root;
ion root;
drop function if exists bug_9503;
test 0
create database mysqltest//
se /java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 26
create DbName D Created Security_typeComment haracter_set_client Database Collation
grant select on t1 to @localhost 0000-00-0 00: -- ::00INVOKER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
grant select on test.* to user1@localhost//
alter db security invoker;
) into v t1; return v; end//
connect ,,,test;
user1
use ;
select ()
test java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
;
execute on function to user1@ocalhost;
connection ;
do 1;
use connectio ;
disconnect user1;
connection root;
REVOKE ALL ERROR 42000: INSERT denied to user1'''fortable`.t1
dropfunctionbug_9503
use test;
database;
connectiondefault
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16
con1root
use select db1_secretd)
selectcurrent_user)
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 14
localhost
selectuser)
user)
rootl
procedurebug7291_0( sqlsecurity java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 68
re (sql securitydefinercallbug7291_0)
createconnectioncon2user1
grantexecuteonprocedurebug7291_0 to user1@localhost;
grantexecute procedurebug7291_1touser1@ocalhost
grant java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
drop p
java.lang.StringIndexOutOfBoundsException: Range [16, 10) out of bounds for length 17
call bug7291_2()
procedure;
user1@ user1l
bug7291_1)
current_user)user)
rootluser1@ocalhost
drop procedureq
procedurebug7291_1
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 25
drop select type,db,name from mysql.proc where db like 'db%';
FUNCTION db1_secret db
REVOKE ALL PROCEDURE db1_secret stamp
drop user user1@drop database db1_secret
drop databaseifmysqltest_1;
ltest_1
proceduremysqltest_1p)
begin
select 1 from dual;
createuser @;
grantusage on**tomysqltest_1.rocs_privwhereuser='a host=%';
,,,information_schema$,$MASTER_MYSOCK
connection;
call mysqltest_1.1)
ERROR executecommand user mysqltest_1@localhost routine 'ysqltest_1p'
disconnect java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 28
connectn2localhost,mysqltest_1,NO-,M,MASTER_MYSOCK
n2;
callmysqltest_1p(;
ERROR42000 commanddeniedtouser '''' forroutinemysqltest_1p1java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
disconnect n2;
connection default;
drop procedure mysqltest_1 inserton t1 to usera@;
drop database mysqltest_1;
revoke usage on *.java.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
dropfn
drop function if exists bug12812|
create function bug12812() ## Execute provilege PACKAGE+ PACKAGE+java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 44
begin
return 'okS =java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
end;
|
create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
grant select,create view on test.* to user_bug12812@localhost|
sql_mode=;
SELECT test.bug12812()|
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 39
CREATE bug12812)|
ERROR 42000: execute command@
connection default;
disconnect test_user_12812;
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 34
drop ROUTINE_NAME=;
create database db_bug14834;
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 54
grant NULL
create user user2_bug14834@java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 19
grant all java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 65
create user user3_bug14834@localhostjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 64
grant all on #
connect user1_bug14834,localhost,user1_bug14834,,db_bug14834;
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 60
call p_bug14834();
user() current_user()
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 49
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 60
call p_bug14834();
user() current_user()
user2_bug14834@localhost user1_bug14834@localhost
connect user3_bug14834,localhost,user3_bug14834,,db_bug14834;
call p_bug14834();
user() current_user()
@localhost
connection default;
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 26
disconnect user2_bug14834;
disconnect user3_bug14834;
drop user user1_bug14834@pkjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 195
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35
drop sql_modejava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
create database db_bug14533;
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
create table t1 (id int);
create user user_bug14533@localhost identified by '';
create procedure bug14533_1()
sql security definer
desc db_bug14533.t1;
create procedure bug14533_2()
sql security definer
select * from db_bug14533.t1;
grant execute on procedure db_bug14533.bug14533_1 to user_bug14533@localhost;
grant execute on procedure grant alter routine on package body test_db.pk to user@localhost;
grant select on test.* to user_bug14533sql_mode@;
connect user_bug14533,localhost,user_bug14533,,connectconn1,localhost,user, ;
call db_bug14533.bug14533_1(screate test_db.pk;
Field Type Null Key Default ERROR 42000: PACKAGE pk does not exist
id int(11) YES NULL
call show create packagebody test_db.pk;
id
desc db_bug14533.t1;
ERROR 42000: SELECT command Package body sql_mode Create Package character_set_client collation_connection Database
select *select * java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 195
ERROR 42000: SELECT command denied to ""
connection default;
ect;
drop user user_bug14533@localhost;
drop java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 26
connection con1root;
DROP DATABASE IF EXISTS mysqltest;
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
CREATE USER mysqltest_1@localhost;
GES mysqltest.* ljava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 61
CREATE USER mysqltest_2@ocalhost;
GRANT SET USER ON *.* TO revoke alter routine on package . userlocalhost
GRANT ALL sql_mode=@save_sql_mode
connect mysqltest_2_con,localhost,mysqltest_2,,mysqltest;
connect mysqltest_1_con,localhost,mysqltest_1,,# java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 31
connection mysqltest_2_con;
USE mysqltest;
CREATE FUNCTION wl2897_f1() java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 27
USE f user@
CREATE DEFINER=root@localhost java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 25
42000 d
CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURNA ``* @java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection mysqltest_2_con;
use ;
CREATE DEFINER='a @ b @ c'@localhost PROCEDURE wl2897_p3() SELECT 3;
Warnings:
1446The as definer(a @@' java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 82
CREATEjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 38
Warnings:
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 82
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 20
USE mysqltest;
SHOW CREATE sp java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 95
Procedure sql_mode Create Procedure SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 164
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 55
SHOW CREATE PROCEDURE wl2897_p3;
Procedure sql_mode Create Procedure java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 162
SELECT 3 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW CREATE FUNCTION wl2897_f1;
ection
wl2897_f1 STRICT_TRANS_TABLESjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
RETURN 1 atin1_swedish_ciutf8mb4_uca1400_ai_cijava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 94
CREATEFUNCTIONSELECT ROUTINE_NAME, ROUTINE_DE information_schemaROUTINES ROUTINE_NAME"fn"
sql_modejava.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 94
fnjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 11
RETURNci utf8mb4_uca1400_ai_ci
disconnectmysqltest_1_con;
;
DROP USER mysqltest_1@localhost; java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 193
java.lang.StringIndexOutOfBoundsException: Range [21, 4) out of bounds for length 32
DROPDATABASE FUNCTION pkf() RETURN INT;
connection execute onjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 16
IFjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 34
ERROR java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 198
USER mysqltest_2@localhost;
java.lang.StringIndexOutOfBoundsException: Range [17, 5) out of bounds for length 61
connect java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Range [17, 7) out of bounds for length 58
connection java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 21
FUNCTION pkhf() RETURN INT A
SELECT1;
GRANT ON**TO`serc@ljava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 11
RETURN
PROCEDURE(java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 32
1
1
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 12
bug13198_f1)
1
connection mysqltest_2_con;
;
CALL bug13198_p1();
1
1
connection con1root;
bug13198_f1()
1
connection Grants for userb@:2
disconnect GRANT USAGE ONjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 50
DROP USER mysqltest_1@java.lang.StringIndexOutOfBoundsException: Range [2, 29) out of bounds for length 21
connection mysqltest_2_con;
USE
CALL bug13198_p1();
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 44
)
ERROR HY000ON)java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 26
connection con1root;
connect r,,,test;
DROP drop func ifexists java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
DROP DATABASEmysqltest;
GRANT USAGE ON *.* TO user19857java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 26
ELECT ,UPDATE Spkvjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
SELECT Host,User
Host luginjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 11
localhostuser19857 java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 18
connect connect user1,localhost,user1,,test;
connection connectionuser1
USE test;
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 40
EGIN
INT
SET a=1;
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 9
END //
SHOW CREATE connection root;
Procedure sql_mode Create java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 7
sp19857STRICT_TRANS_TABLESjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 3
DETERMINISTICdatabase;
BEGIN
DECLARE a INT;
SET=
SELECT a;
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 9
disconnect java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
connect mysqltest_2_conlocalhostjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 57
connection java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 14
bug7291_2;
connection current_user() user(java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 97
java.lang.StringIndexOutOfBoundsException: Range [26, 10) out of bounds for length 27
SELECTshowjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 38
SHOW FUNC java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [19, 10) out of bounds for length 20
connection default
use test;
DROP TABLEjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [9, 4) out of bounds for length 23
:
DROP PROCEDURE grant usage on *.java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 36
IFjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 31
DELETE FROM mysql.user WHERE user LIKE 'Name Type Definer Modified Created Security_typejava.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 22
d java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 52
n2,ocalhost,java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 44
DELETE FROM mysql.columns_priv WHERE user LIKE java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 17
CREATE TABLE t1 (i INT);
FUNCTIONi java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 72
PROCEDURE java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
mysqltest_u1@localhost;
GRANT EXECUTE ON test.*revoke usageo . java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 31
DEFINER=@ocalhost FUNCTION )RETURNS
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 42
BEGIN
)
SET@b: S conn1, localhostjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 39
END|
java.lang.StringIndexOutOfBoundsException: Range [19, 6) out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Range [14, 7) out of bounds for length 42
SELECT COUNT(*) FROM t1;
ERROR SELECT .(|
f_evil(;
42000:SELECT command denied ''''forSHOW STATUSW =p;
@a,@b;
@a @b
mysqltest_u1@disconnect test_user_12812;
SELECT f_suid(f_evil());
command to mysqltest_u1''' ``t1
SELECT @a, @b;java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 97
mysqltest_u1@localhost1
p_suid(f_eviljava.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 32
ERROR42000:SELECTcommanddeniedtouser''@'localhost' for table `.t1`
SELECT@,@;
@a @b
ELECT*FROMv1fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS int(11)
java.lang.StringIndexOutOfBoundsException: Range [42, 5) out of bounds for length 91
SELECT @a, @b;
@java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 60
mysqltest_u1@ocalhost NULL
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 17
4834java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 49
DROP VIEW v1;
DROP call p_bug14834(;
ljava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [14, 4) out of bounds for length 22
packagetest_dbpkjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
TABLEt1
#
# Bug #48872 : java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 19
is
#
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 26
;
TABLE latin1 latin1_swedish_ci
`TestTab (1)(2)
FUNCTION`_Test`)RETURNSjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 102
CREATEFUNCTION java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 198
CREATE USER 'tester';
CREATE USER 'ester'
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 44
GRANTEXECUTE ONFUNCTION` ';
GRANT EXECUTE desc db_bug14533.t1;
SELECT f_Test();
f_Test()
123
select *
id
1
2grantexecute onprocedure java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 5
CONNECTlocalhosttester
,# BODYjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
connection SET sql_mode=@;
SELECT *
sh pk;
2
show create package body test_db.pk;
`f_Test`()
123
`F_TEST`()
p ,,O_KEY_OPTIONS,NO_TABLE_OPTIONSjava.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Range [16, 13) out of bounds for length 16
_(java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
123
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 16
F_TEST()
123
0user''java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 91
*;
`_(;
FUNCTION (
SELECT f_Test();
)
est_denied(;
`java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
123
SELECT `F_TEST_DENIEDjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 19
`pkv:2;
123
;
disconnect con_tester;
disconnect con_tester_deniedPACKAGE java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 21
#case
DROP FUNCTIONCREATE DATABASE ROUTINE_TYPE,ROUTINE_DEFINITIONfrom java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 11
SE ;
DROP USER 'tester';
DROP USER 'Tester';
pk Pjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
# End of 5.0 tests.
#
#
GRANT FUNCTIONjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
#java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 17
#
drop pkhfjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 8
create database mysqltest_db;
# java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 2
create user bug57061_user@CONNECT con_tester,localhost,tester
create function mysqltest_db.f1 ,,ester,B
e java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [42, 40) out of bounds for length 53
# Attempt
# should result in the same `Tjava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 24
drop function if exists mysqltest_db.f_does_not_exist;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
drop procedure if
ERROR 42000: alter java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 16
drop function if exists mysqltest_db.f1;
ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.f1'
drop procedure if exists mysqltest_db.p1;
ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhostSELECT ();
connection default;
disconnect conn1;
drop1_serlocalhost
mysqltest_db;
#
# Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE
# DEFINITION OF ANY ROUTINE.
#
DROP DATABASE IF EXISTS db1;
CREATE DATABASE db1;
CREATE PROCEDURE db1.p1() SELECT 1;
CREATE USER user2@localhost IDENTIFIED BY '';
GRANT SELECT(db) ON mysql.proc TO user2@localhost;
connect con2, localhost, user2,,"*NO-ONE*";
# The statement below before disclosed info from body_utf8 column.
SHOW CREATE PROCEDURE db1.p1;
ERROR 42000: PROCEDURE p1 does not exist
#workson
connection default;
GRANT SELECT ON mysql.proc TO user2@localhost;
connection con2;
# This should work
SHOW CREATE PROCEDURE db1.p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 55
connection default;
disconnect con2;
DROP USER user2
DROP DATABASE db1;
create user foo@local_ost;
revokejava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 74
grant select, sql_mode=@save_sql_mode
create database foodb;
grant create routine on foodb.* to foo@local_ost;
ljava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 27
select user(), current_user();
user()) ()
foo@DROP FUNCTIONf_Test;
grants
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 24
ON* `java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 4
GRANT SELECT, java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 1
GRANTCREATE ON`.* f@java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 54
create dropjava.lang.StringIndexOutOfBoundsException: Range [16, 13) out of bounds for length 37
Grants for foo@local_ost
USAGEON
java.lang.StringIndexOutOfBoundsException: Range [20, 5) out of bounds for length 61
GRANT CREATE ROUTINE ON `foodb`.* TO `foo`@`local_ost`
GRANTEXECUTE
disconnect java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 4
connection default;
drop user foo@local_ost;
foo`_;
drop procedure java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 24
drop database foodb;
java.lang.StringIndexOutOfBoundsException: Range [41, 1) out of bounds for length 1
# Test for42000 java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 121
# its specific_schemajava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 137
# "call specific_schemasjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 62
#
drop database if existsjava.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 16
create database mysqltest_db;
create function mysqltest_db.f1() returns int return 0;
create procedure mysqltest_db.p1() begin end;
# Create user with no privileges on mysqltest_db database.
create user bug12602983_user@localhost;
grant create view on test.* to bug12602983_user@localhost;
connect conn1, localhost, bug12602983_user,,;
# Attempt to execute routine on which user doesn't have privileges
# should result in the same 'access denied' error whether
# routine exists or not.
select mysqltest_db.f_does_not_exist();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.f_does_not_exist'
call mysqltest_db.p_does_not_exist();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.p_does_not_exist'
select mysqltest_db.f1();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.f1'
call mysqltest_db.p1();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.p1'
create view bug12602983_v1 as select mysqltest_db.f_does_not_exist();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.f_does_not_exist'
create view bug12602983_v1 as select mysqltest_db.f1();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.f1'
connection default;
disconnect conn1;
drop user bug12602983_user@localhost;
drop database mysqltest_db;
create user u1@localhost;
grant all privileges on *.* to u1@localhost with grant option;
connect u1, localhost, u1;
set password=password('foobar');
create procedure sp1() select 1;
show grants;
Grants for u1@localhost
GRANT ALL PRIVILEGES ON *.* TO `u1`@`localhost` IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
grant execute on procedure sp1 to current_user() identified by 'barfoo';
show grants;
Grants for u1@localhost
GRANT ALL PRIVILEGES ON *.* TO `u1`@`localhost` IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO `u1`@`localhost`
drop procedure sp1;
disconnect u1;
connection default;
drop user u1@localhost;
#
# MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE
#
CREATE DATABASE u1;
CREATE PROCEDURE u1.p1() BEGIN SELECT 1; END; $$
CREATE FUNCTION u1.f1() RETURNS INT BEGIN RETURN 1; END; $$
CREATE USER u1@localhost;
GRANT CREATE ROUTINE ON u1.* TO u1@localhost;
GRANT ALTER ROUTINE ON FUNCTION u1.f1 TO u1@localhost;
GRANT ALTER ROUTINE ON PROCEDURE u1.p1 TO u1@localhost;
connect u1, localhost, u1,,u1;
CREATE OR REPLACE FUNCTION f1() RETURNS INT BEGIN RETURN 2; END; $$
CREATE OR REPLACE PROCEDURE p1() BEGIN SELECT 1; END; $$
disconnect u1;
connection default;
DROP DATABASE u1;
DROP USER u1@localhost;
set @@global.character_set_server=@save_character_set_server;
#
# End of 10.2 tests
#
#
# MDEV-20366 Server crashes in get_current_user upon SET PASSWORD via SP
#
CREATE PROCEDURE p1() SET PASSWORD FOR foo@localhost=PASSWORD('x');
CALL p1();
t
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 18
CREATE USER foo@localhost;
CREATE
CALL p1();
DROP PROCEDURE p1;
DROP USER foo( AS
java.lang.NullPointerException
tests
java.lang.NullPointerException
java.lang.NullPointerException
# MDEV-29852 SIGSEGV in mysql_create_routine or is_acl_user
java.lang.NullPointerException
set @cmd:="create definer=u function f(i int) returns char binary reads sql data return concat (1,i)";
prepare s from @cmd;
execute s;
Warnings:
Note 1446pkPIPES_AS_CONCATANSI_QUOTES,IGNORE_SPACEORACLE,O_KEY_OPTIONSNO_TABLE_OPTIONS,O_FIELD_OPTIONSNO_AUTO_CREATE_USERSIMULTANEOUS_ASSIGNMENTCREATEDEFINER"""localhost PACKAGE BODY pk AS
execute s;
ERROR PROCEDURE pkhp() java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
drop function f;
#
# End of 10.6 tests
#
#
# MDEV-29167: new db-level SHOW CREATE ROUTINE privilege
#
###
### SHOW-Like commad test
##
SET END;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
### Prepare ### Prepare functions
#
java.lang.StringIndexOutOfBoundsException: Range [15, 6) out of bounds for length 24
use test_dbDb Type Created Security_typeComment character_set_client collation_connectionDatabase Collation
create procedure test_db.()select ;
show create procedure SELECT ROUTINE_NAME,ROUTINE_TYPE,ROUTINE_DEFINITION information_schemaROUTINES ROUTINE_NAME=pk;
Proceduresql_mode Create Procedure character_set_clientcollation_connection Database Collation
java.lang.StringIndexOutOfBoundsException: Range [13, 2) out of bounds for length 143
select latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW PROCEDURE STATUSFUNCTION pkf()RETURN ;
Definer Created Security_type character_set_clientcollation_connection Database
test_db sp PROCEDURE rootpk ACKAGE BODY AS
,ROUTINE_DEFINITION .where =sp"
ROUTINE_NAMEPROCEDUREpkhp)
sp select 1
CREATE FUNCTION test_db.fn() RETURNS INT RETURN 1;
showcreatefunction .;
Function sql_modeCreate character_set_client collation_connection Database Collation
STRICT_TRANS_TABLESERROR_FOR_DIVISION_BY_ZERO,,NO_ENGINE_SUBSTITUTION DEFINER=root@localhost FUNCTION `fn`() RETURNS int11)
RETURN 1 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW FUNCTION java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 11
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
ROUTINE_NAME ROUTINE_DEFINITION
fn RETURN 1
SET sql_mode=ORACLE;
CREATE PACKAGE test_db.pk AS
FUNCTION pkf() RETURN INT;
PROCEDURE pkp();
END;
$$
CREATE PACKAGE BODY test_db.pk AS
=1;
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGIN
RETURN pkv;
END;
p)AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf();
END;
BEGIN
pkv:=2;
END;
$$
SET sql_mode=@save_sql_mode;
show create package test_db.pk;
Package sql_mode pkv:2
pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 9
FUNCTION pkf() RETURN INT;
PROCEDURE pkp();
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
show create package body test_db.java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 1
Package body sql_mode Createjava.lang.NullPointerException
AT,NSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,O_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pk" AS
pkv INT=;
grant privilegeson .touserlocalhost;
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGINshow create procedure test_db.p;
RETURN pkv;
ENDjava.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
PROCEDURE pkp( AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf();
END;
BEGIN
pkv:=2;
END latin1test_db PROCEDURE root@localhost##DEFINER latin1 latin1_swedish_ciutf8mb4_uca1400_ai_ci
SHOWPACKAGE STATUS WHERE name="pk";
Db Name Type Definer Modified java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
test_db PACKAGE root@ocalhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
Function sql_mode CreateFunction character_set_client ollation_connection Database Collation
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
pkPACKAGE AS
FUNCTION pkf() RETURN INT;
PROCEDURE pkp(;
END
pk PACKAGE BODY AS
pkv INTDbNameTypeDefiner Modified Created Security_type Comment character_set_client collation_connection Database Collation
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGIN
RETURN pkv;
END;
PROCEDURE pkp() AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf();
END;
BEGIN
pkv:=2;
END
use test;
##java.lang.NullPointerException
### Pre-"SHOW-CREATE-ROUTINE" behaviour tests
##java.lang.NullPointerException
java.lang.NullPointerException
### Rights on mysql.proc
java.lang.NullPointerException
create user user@localhost;
grant all privileges on mysql.* to user@localhost;
grant all privileges on test.* to user@localhost;
connect conn1, localhost, user, , test;
show create procedure test_db.sp;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
sp,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
select 1 latin1 latin1_swedish_ciROUTINE_NAME="n";
SHOW PROCEDURE STATUS WHERE name="sp";
Db Name Type Definer java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 11
test_db PROCEDURE@ ##DEFINER latin1 latin1_swedish_ciutf8mb4_uca1400_ai_ci
PIPES_AS_CONCATANSI_QUOTES,GNORE_SPACE,RACLE,,O_TABLE_OPTIONSNO_FIELD_OPTIONSNO_AUTO_CREATE_USER,IMULTANEOUS_ASSIGNMENTCREATE DEFINER=root"localhost"PACKAGE""AS
ROUTINE_NAME
sp
show create functiontest_db.n
Functionsql_mode Create Functioncharacter_set_client collation_connectionDatabase
fn STRICT_TRANS_TABLES latin1latin1_swedish_ci utf8mb4_uca1400_ai_ci
1latin1 latin1_swedish_ciutf8mb4_uca1400_ai_ci
STATUS name=fn"
Db Definer Created Comment character_set_client collation_connectionDatabase Collation
test_db @ # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 18
ROUTINE_NAME ;
fnRETURN java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
show create package test_db.pk;
Package sql_mode PROCEDUREpkp() AS
,,,NO_KEY_OPTIONS,,,,SIMULTANEOUS_ASSIGNMENT DEFINER=root@localhost" PACKAGE "pk" AS
FUNCTION pkf() RETURN INT;
PROCEDURE pkp();
END latin1 latin1_swedish_ciFUNCTION pkf()RETURNINTAS
show create package body test_db.pk;RETURN pkhf)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
pk PIPES_AS_CONCAT,SELECT ROUTINE_NAME from information_schema where ROUTINE_NAME="sp";
java.lang.StringIndexOutOfBoundsException: Range [7, 3) out of bounds for length 11
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGIN
RETURN pkv;
END;
PROCEDURE pkp() AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf);
show .;
BEGIN
pkv:=2;
END latin1_swedish_ciutf8mb4_uca1400_ai_ci
PACKAGE WHEREname"pk"
NameTypeDefiner ModifiedCreated Comment character_set_clientcollation_connection
test_dbpkPACKAGE @ #DEFINER latin1 latin1_swedish_ciutf8mb4_uca1400_ai_ci
SELECTROUTINE_NAME,ROUTINE_TYPE,ROUTINE_DEFINITIONfrom information_schemaROUTINES where ROUTINE_NAME""
ROUTINE_NAMEROUTINE_TYPE ROUTINE_DEFINITION
pk default
FUNCTION onn1;
java.lang.NullPointerException
END
pk PACKAGE BODY AS
pkv INT:=1;
PROCEDURE pkhp() AS
BEGIN
FROMDUAL;
;
FUNCTION pkhf() RETURN INT AS
BEGIN
RETURN pkv;
END;
PROCEDURE pkp() AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf();
END;
BEGIN
pkv:2;
END
connection default;
disconnect ROUTINE_NAME="fn;
revokeROUTINE_NAME ROUTINE_DEFINITION
java.lang.NullPointerException
## No
java.lang.NullPointerException
connect conn1, localhost, user, , test;
show create procedure test_db default;
ERROR 42000: PROCEDURE sp doesrevoke execute onprocedure. fromuser@ocalhost;
SHOW PROCEDURE STATUS WHERE name="sp";
er ModifiedCreatedSecurity_type Comment character_set_client collation_connectionDatabaseCollation
SELECT ROUTINE_NAME information_schema.ROUTINES where ROUTINE_NAME=sp;
ROUTINE_NAME
showcreate function test_db.;
ERROR 42000: FUNCTION fn does not exist
SHOW FUNCTION java.lang.NullPointerException
SETsql_mode=ORACLE;
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
ROUTINE_NAME="fn";
ROUTINE_NAME ROUTINE_DEFINITION
show create package test_db.k
ERROR 42000connect conn1,localhost, user, , test;
show create package body test_db.pk;
ERROR 42000: PACKAGE BODY pk does not exist Create character_set_client Database
java.lang.StringIndexOutOfBoundsException: Range [12, 4) out of bounds for length 36
Db Name Type Definer Modified Created Security_typeSHOW PACKAGE STATUSWHERE name="pk"java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
SELECT ROUTINE_NAME ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
connection defaultjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
disconnect onn1
java.lang.NullPointerException
### Execute provilege PROCEDURE/FUNCTION
java.lang.NullPointerException
grantexecute on procedure test_db.sp to user@localhost;
grant execute on function test_db.fn to user@ERROR 42000: execute command denied to user 'user''for 'test_db.pk'
connect conn1, localhost, user, , testselect test_db.pk.pkf();
show create procedure test_db.sp;
sql_mode Procedure character_set_client collation_connection Database Collation
sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,connection default;
SHOW PROCEDURE STATUS WHERE name="sp";
Db Name Type Definer java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 20
test_db #
### Executeprovilege PACKAGE-PACKAGE BODY+
ROUTINE_NAME
sp
call test_db.sp();
1
1
show create function test_db.fn;
Function sql_mode Create Function character_set_client collation_connection Database Collation
fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 28
SHOW FUNCTION STATUS WHERE name="fn";
Db Name test_db.;
test_db ERROR 42000: PACKAGE pk does not exist
SELECT ROUTINE_NAME, ROUTINE_DEFINITION fromshow create .;
ROUTINE_NAME="fn";
ROUTINE_DEFINITION
fn pkPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
select test_db.fn();
st_db.n)
1
connection default;
disconnect conn1;
revoke on procedure test_db.sp from user@localhost;
revoke execute on function test_db.pk PACKAGE BODY NULL
#
### Execute provilege PACKAGE+ java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 3
#
SET sql_mode=ORACLE;
grant execute on package test_db.pk to user@localhost;
SET sql_mode=@save_sql_mode;
connect conn1, localhost, user, , test;
show create package test_dbdisconnect conn1;
Package sql_mode Create Package character_set_client collation_connection Database Collation
pkrevoke execute package test_db. from user@ocalhost;
create package body test_db.pk;
ERROR 42000: PACKAGE BODY pk does not
SHOW PACKAGE WHERE =";
Db Name Type Definer java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
test_db pk PACKAGE root@localhost # # grant alter routine on function test_db.fn to user@localhost;
SELECTconnect conn1,localhost, user,,test;
ROUTINE_NAME show create procedure test_db.sp;
pk PACKAGE NULL
call test_db.pk.pkp(;
sp STRICT_TRANS_TABLES,RROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
java.lang.StringIndexOutOfBoundsException: Range [21, 6) out of bounds for length 24
ERROR deniedto user user@localhost' for routine 'test_db.pk'
connection default;
disconnect conn1;
SET sql_mode=ORACLE;
revoke execute on package test_db.pk from user@localhost;
SET sql_mode=@save_sql_mode;
#
### Execute provilege PACKAGE- PACKAGE BODY+
#
SET sql_mode=ORACLE;
grant execute on package body test_db.pk to user@localhost;
SET sql_mode=@save_sql_mode;
connect conn1, localhost, user, , test;
show create package test_db.pk;
ERROR 42000: PACKAGE pk does not exist
show create package body test_db.pk;
Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
test_db PROCEDUREroot@ocalhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW PACKAGE STATUS WHERE name="pk";
Db Name Type Definer ModifiedSELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
SELECT ROUTINE_NAME, ROUTINE_TYPE, sp
show createfunction test_db.fn;
pk PACKAGE BODY NULL
call test_db.pk.pkp(;
pkv
2
select test_db.pk.pkf();
SHOW FUNCTION STATUS WHERE name="n";
2
connection default;
disconnect conn1;
SET sql_mode=ORACLE;
revoke execute on package body test_db.pk from user@localhost;
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
#
### Alter routine provilege PROCEDURE/FUNCTION
#
grant alter routine on procedure test_db.sp to user@localhost;
grant connection default;
connect conn1, localhost, user, , test;
show create procedure test_db.sp;
Procedure sql_modeCreate Procedure character_set_client collation_connection Database Collation
sp revoke alter onfunction test_db.fn from user@localhost;
SHOW PROCEDURE STATUS WHERE name="sp";
Db Name Type## Alter routine provilege PACKAGE+ PACKAGE BODY-
test_db sp java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
ROUTINE_NAME
sp
show createfunction test_db.fn;
Function sql_mode Create Function character_set_client collation_connection Database Collation
fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,connect conn1, localhost, user, , test;
SHOW FUNCTION STATUS show create package test_db.pk;
Db Name Type Definer Modified Package sql_mode Create Package character_set_client collation_connection Database Collation
PIPES_AS_CONCATANSI_QUOTES,ORACLE,,,S NULL latin1_swedish_ci
SELECT ROUTINE_NAME, show package body .java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
ROUTINE_NAMES PACKAGE STATUS WHERE name=pk"java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
ROUTINE_NAME ROUTINE_DEFINITION
fn NULL
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 19
disconnect conn1;
revoke alter routine on procedure test_db.sp from user@localhost;
revoke alter routine on function test_db.fn from java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 15
#
### Alter routine provilege PACKAGE+ PACKAGE BODY-
#
SET sql_mode=ORACLE;
grant alter routine on package test_db.pk to user@localhost;
SET sql_mode=@save_sql_mode;
connect conn1, localhost, user, , test;
show create package test_db.pk;
Package sql_mode Create Package character_set_client collation_connection Database Collation
pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
show create package body test_db.pk;
ERROR 42000: PACKAGE BODY pk does not exist
SHOW PACKAGE STATUS WHERE name="pk";
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, OUTINE_TYPE ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
pk PACKAGE NULL
connection default;
disconnect conn1;
SET sql_mode=ORACLE;
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 63
SET =save_sql_mode;
#
### Alter routine provilege PACKAGE+ PACKAGE BODY-
#
SET sql_mode=ORACLE;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
SET sql_mode=@save_sql_mode;
conn1, , java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
show create package test_db.pk;
ERROR 42000: PACKAGE pk does not exist
show create package body test_db.pk;
Package body sql_mode Create Package Body character_set_clientconnect conn1, localhost,user,,test;
pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW PACKAGE STATUS WHERE name="pk";
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
pk PACKAGE BODY NULL
connection default;
disconnect conn1;
SET sql_mode=ORACLE;
revoke alter routine on package body test_db.pk from user@localhost;
SET sql_mode=@save_sql_mode;
###
### SHOW CREATE PROCEDURE tests
###
#
### Global "show create routine" test
#
grant show create routine on *.* to user@localhost;
show grants for user@localhost;
Grants for user@localhost
showcreatepackage body test_db.pk;
GRANT ALL PRIVILEGES ON `test`.* TO `user`@`localhost`
connect conn1, localhost, user, , test;
show create procedure test_db.sp;
Procedure sql_mode Create Procedure character_set_client collation_connectionPackagebody sql_mode Create Package Body character_set_client collation_connection Database Collation
sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
1 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW PROCEDURE STATUS WHERE name="sp";
Db Name Type Definer ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 44
ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
ROUTINE_NAME disconnect conn1;
sp select 1
showSET sql_mode=ORACLE;
Function sql_mode Create Function character_set_client collation_connection Database Collation
fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS int(11)
RETURN 1 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW FUNCTION STATUS WHERE name="fn";
DbNameType Modified Created Security_type Comment character_set_client collation_connection Database Collation
test_db fnde=save_sql_mode;
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where##
ROUTINE_NAME ROUTINE_DEFINITION
fn RETURN 1
show create package test_db.pk;
Package sql_mode Create Package character_set_client collation_connection## Global "show create routine" test
pk PIPES_AS_CONCAT
FUNCTIONFUNCTION w create routine on **touser@;
show grants for user@localhost;
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
show create package body test_db.pk;
Package body sql_mode Create Package Body java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 54
pk PIPES_AS_CONCAT,ANSI_QUOTESGRANT ALL PRIVILEGES test. TO `ser@localhost`
pkv INT:=1;
PROCEDURE pkhp() AS
BEGIN
showcreate procedure test_db.sp;
END;
FUNCTIONe sql_mode Create Procedure character_set_client collation_connection Database Collation
BEGIN
RETURN pkv;
END;
pkp(
BEGIN
CALL pkhp();
END;
FUNCTION pkf() test_db sp PROCEDURE rootlocalhost #DEFINER latin1utf8mb4_uca1400_ai_ci
BEGIN
RETURN pkhf();
END;
BEGIN
pkv:=2;
END java.lang.StringIndexOutOfBoundsException: Range [28, 10) out of bounds for length 50
SHOW PACKAGEcreatefunction test_db.fn;
Db Name Type Function sql_mode Create Function character_set_client collation_connection Database Collation
PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_TYPE,ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
ROUTINE_TYPE
pk PACKAGE AS
FUNCTION pkfDbName Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
PROCEDURE pkp();
END
pk PACKAGE BODY AS
pkv INT:=1;
PROCEDURE ROUTINE_NAME ROUTINE_DEFINITION
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGIN
RETURN pkv;
ENDfn 1
PROCEDURE pkp() AS
BEGIN
CALL pkhp()java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf(;
END;
BEGIN
pkv:2;
END
connection default;
disconnect conn1;
revoke Package sql_mode PackageB
#
ine but other
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
grant java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
show grants for user@localhost;
Grants for user@localhost
GRANT USAGE ON *.* TO `user`@`localhost`
GRANT RETURN pkv
GRANTEND;
connect conn1, localhost, user, , test;
showPROCEDURE pkp() AS
ERROR 42000: PROCEDURE sp does not exist
SHOW PROCEDURE STATUS WHERE name="sp";
Db Name Type Definer Modified Created END;
ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
NE_NAMEROUTINE_DEFINITION
show RETURN pkhf();
ERROR 42000: FUNCTION fn does not exist
SHOW java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
Db Name Type DefinerModified Created Security_type Comment character_set_client collation_connection Database Collation
SELECT ROUTINE_NAME, ROUTINE_DEFINITIONEND latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
ROUTINE_NAME ROUTINE_DEFINITION
show create package test_db.pk;
ERROR 42000:PACKAGE pk does not exist
show create package body test_db.pk;
ERROR 42000: PACKAGE BODY pk does not exist
SHOW PACKAGE STATUS WHERE name="pk";
Db Name Type Definer Modified Created ecurity_type Comment character_set_client collation_connection Database Collation
SELECTROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
ROUTINE_NAME ROUTINE_TYPE
connection java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 13
disconnect conn1;
revoke show create routine on db_test.* from user@localhost;
#
### DB-pk PACKAGEAS
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
grant show createpkv ;
show grants for user@localhost;
Grants for user@localhost
GRANT USAGE ON *.* TO `user`@`localhostRETURN pkv;
T ALL PRIVILEGES ON `test`. TO `ser@`ocalhost`
GRANT SHOW CREATE ROUTINE ON `test_db`.* TO `user`@`localhost`
connect conn1, localhost, user, , test;
show create procedure test_db.sp;
Procedure sql_mode Create Procedure character_set_client collation_connection Database CollationBEGIN
sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONEND;
select 1 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW PROCEDURE STATUS WHERE name="sp";
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_DEFINITION java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 4
OUTINE_NAME ROUTINE_DEFINITION
sp select 1
show create function test_db.fn;
Function sql_mode Create Functiondisconnect conn1;
fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
RETURN 1 latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
N STATUS WHERE name="n;
Db#
test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from show grants for user@localhost;
ROUTINE_NAME ROUTINE_DEFINITION
fn RETURN 1
show create package test_db.pk;
Package sql_mode Create Package character_set_clientGRANT ALL PRIVILEGES ``. `ser``localhost`
pkPIPES_AS_CONCAT,ANSI_QUOTES,GNORE_SPACE,,,,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER, =root""localhost"PACKAGE ""AS
FUNCTION pkf() connect conn1, localhost, user, , test;
PROCEDURE pkps create procedure test_db.p;
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
k;
Package body SHOW PROCEDURE STATUS WHERE name="sp";
DbName Definer Created Security_type Comment character_set_client collation_connection Database Collation
pkv INT:=1SELECT ,ROUTINE_DEFINITION information_schemaROUTINES where ROUTINE_NAME="sp";
PROCEDURE pkhp() AS
BEGIN
SELECTpkv ;
END;
java.lang.StringIndexOutOfBoundsException: Range [13, 8) out of bounds for length 29
BEGIN
RETURN pkv;
END;
PROCEDURE pkp(
BEGIN
CALL pkhp();
FUNCTION pkf() RETURN INT show create package body test_db.pk;
BEGIN
RETURN pkhf();
END;
BEGIN
:=2;
END latin1_swedish_ciutf8mb4_uca1400_ai_ci
SHOW ROUTINE_NAMEROUTINE_TYPEROUTINE_DEFINITION
connection default;
kPACKAGE @localhost DEFINER latin1 latin1_swedish_ciutf8mb4_uca1400_ai_ci
java.lang.StringIndexOutOfBoundsException: Range [19, 6) out of bounds for length 111
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION# level" routine"test
pk PACKAGE AS
FUNCTION pkf()RETURN INT
PROCEDURE pkp();
END
pk PACKAGEB
pkv INT:1
PROCEDURE pkhp() ``*TO `ser``localhost`
BEGIN
SELECT pkv FROM DUAL;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
pkhf( INT
BEGIN
RETURN pkv;
END;
AS
BEGIN
CALL(java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
END;
FUNCTIONpkf(RETURN INT AS
BEGIN
RETURN pkhf();
END;
pkv:=2;
END
connection default;
disconnect conn1;
revoke show create routine on test_db.* from userf STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,O_ENGINE_SUBSTITUTION CREATE ````FUNCTION f`)RETURNS
#
##Routine- show create routine PROCEDURE and
#
grant show create routine on procedure test_db.sp to user@localhost;
grant routine on function test_db.fn to user@ocalhost;
connect conn1, localhost, user, , test;
create test_db.p;
CreateProcedure collation_connectionjava.lang.StringIndexOutOfBoundsException: Range [87, 86) out of bounds for length 96
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
select 1 latin1 latin1_swedish_ci pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACEORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pk" AS
SHOW PROCEDURE STATUS WHERE name="sp";
Type Modified CreatedSecurity_typeCcharacter_set_client Collation
test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
ROUTINE_NAME ROUTINE_DEFINITION
sp select 1
call test_db.sp();
ERROR 42000: execute command denied to user 'user' body ;
show create function test_db.fn;
pkjava.lang.StringIndexOutOfBoundsException: Range [31, 18) out of bounds for length 198
fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS java.lang.StringIndexOutOfBoundsException: Index 154 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ATUS WHERE name=fn"java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
Db Name Type Definer Modified Created Security_type java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 29
db fn root@localhost ##DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
ROUTINE_NAME="fn";
ROUTINE_NAME ROUTINE_DEFINITION
fn RETURN 1
select test_db.fn();
ERROR 42000: execute command deniedEND;
connection default;
disconnect conn1FUNCTION pkf() RETURN INT AS
revoke show create routine on procedure java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 5
revoke show create routine on END;
#
### Routine-level "show create routine" PACKAGE+ PACKAGE BODY-
#
SET sql_mode=ORACLE;
grant show create routine on package test_db.pk to user@localhost;
SET sql_mode=@save_sql_mode;
connect conn1, localhost, user, , test;
show create package test_db.pk;
Package sql_mode Create Package character_set_client collation_connection Database Collation
pk PIPES_AS_CONCAT,pkv:=;
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
PROCEDURE pkp();
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
show create package body test_db.pk;
ERROR 42000: PACKAGE BODY pk does not exist
SHOW PACKAGE STATUSWHERE name=pk";
Db Name Type Db Name Type DefinerModified Created Security_type Comment character_set_client collation_connection Database Collation
test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
pk PACKAGE AS
java.lang.StringIndexOutOfBoundsException: Range [25, 8) out of bounds for length 26
PROCEDURE pkp();
END
call test_db.pk.pkp();
ERROR 42000: execute commandPROCEDURE
select test_db.pk.pkf();
ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
connection default;
disconnect conn1;
SET sql_mode=ORACLE;
revoke show create routine on package test_db.pk from user@localhost;
SET sql_mode=@save_sql_mode;
#
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
#
SET sql_mode=ORACLE;
routine on package body test_db.pk to user@localhost;
SET sql_mode=@save_sql_mode;
connect conn1, java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 12
show create package test_db.pk;
ERROR 42000: PACKAGE pk does not exist
how create package body test_db.pk;
Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
pk PIPES_AS_CONCAT,java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 19
pkv INT:=1;
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
pkhf() RETURNINT
BEGIN
grant show create routine on procedure test_db.sp to user@ocalhost;
END;
PROCEDURE pkp() AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 14
END
BEGIN
pkv:=2;
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW PROCEDURE STATUS WHERE name="sp";
Db Name Type Definer Modified Created Security_type Comment Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
java.lang.StringIndexOutOfBoundsException: Range [19, 6) out of bounds for length 111
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
pk PACKAGE BODY AS
pkv INT:=1;
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGIN
pkv;
END;
PROCEDURE pkp() AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf();
END;
BEGIN
pkv:=2;
END
call test_db.pk.pkp();
ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
select test_db.pk.pkf();
ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
connection default;
disconnect conn1;
SET sql_mode=ORACLE;
revoke show create routine on package body test_db.pk java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 32
SET sql_mode=@save_sql_mode;
drop user user@localhost;
op database test_db;
#
### Check owner only rights
#
create user user@localhost;
create database test_db;
use test_db;
create definer=user@localhost procedure test_db.sp() select 1;
CREATE definer=user@localhost FUNCTION test_db.fn() RETURNS INT RETURN 1;
SET sql_mode=ORACLE;
CREATE definer=user@localhost PACKAGE test_db.pk AS
FUNCTION pkf() RETURN INT;
PROCEDURE pkp();
END;
$$
CREATE definer=user@localhost PACKAGE BODY test_db.pk AS
pkv INT:=1;
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGIN
RETURN pkv;
END;
PROCEDURE pkp() AS
BEGIN
pkhp(;
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf();
END;
BEGIN
pkv:;
END;
$$
SET sql_mode=@save_sql_mode;
use test;
connect conn1, localhost, user, , "*NO-ONE*";
show create procedure test_db.sp;
Procedure sql_mode Create java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 17
sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`java.lang.StringIndexOutOfBoundsException: Index 112 out of bounds for length 70
select java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
SHOW PROCEDURE STATUS WHERE name=sp;
Db Name Type Definer Modified Created Security_type Comment java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 20
test_db sp PROCEDURE user@ocalhost# #DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
ROUTINE_NAME
sp
show create function test_db.fn;
Function sql_mode Create Function character_set_client collation_connection Database Collation
fn Package sql_mode Package character_set_client collation_connection Database Collation
RETURN 1 pk PIPES_AS_CONCATANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pkFUNCTION pkf() RETURN INT;
SHOW STATUS name="fn";
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
test_db fn FUNCTION user@localhost # # show create package body test_db.k
SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
ROUTINE_NAMESHOW STATUS WHERE name=pk"java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
ROUTINE_NAME ROUTINE_DEFINITION
fn RETURN 1
show create package test_db.pk;
Package sql_mode Create Package character_set_client collation_connection Database SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER"user""localhost" PACKAGE "pk" AS
FUNCTION pkf() RETURN INT;
PROCEDURE pkp()java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
show create package body test_db.pkEND
Package sql_mode Create Package Body character_set_client collation_connection Database Collation
pk ERROR 42000:execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
pkv INT:=1;
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf( RETURN INT AS
BEGIN
RETURN pkv;
END;
PROCEDURE pkp() AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
END;
BEGIN
pkv:=2;
END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SHOW name="k;
Db Name ERROR 42000:PACKAGE pk does not exist
test_db pk PACKAGE user@localhost # # DEFINER latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
pk PACKAGE AS
FUNCTION pkf() RETURN INT;
PROCEDURE pkp();
END
pk PACKAGE BODY AS
pkv INT:=1;
PROCEDURE pkhp() AS
BEGIN
SELECT pkv FROM DUAL;
END;
FUNCTION pkhf() RETURN INT AS
BEGIN
RETURN pkv;
END;
PROCEDURE pkp() AS
BEGIN
CALL pkhp();
END;
FUNCTION pkf() RETURN INT AS
BEGIN
RETURN pkhf();
END;
BEGIN
END
default;
disconnect END;
drop user user@localhost;
drop database test_db;
# End of END latin1 latin1_swedish_ci utf8mb4_uca1400_ai_ci
#
# MDEV-39288 SHOW CREATE ROUTINE does not apply to roles
#
create user u@localhost;
create role r;
create procedure p1() select 10 as ten;
grant execute on procedureROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
grant pk PACKAGE BODY AS
grant r u@java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
connect u, localhost, u;
call p1();
ten
10
show create procedure p1;
Procedure p1
sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Create Procedure NULL
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation utf8mb4_uca1400_ai_ci
set role r;
Show create procedure p1;
Procedure p1
sql_mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Create Procedure NULL
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation utf8mb4_uca1400_ai_ci
disconnect u;
connection default;
drop role r;
drop user u@localhost;
drop procedure p1;
# End of 11.4 tests
#
# MDEV-37054: Implement INFORMATION_SCHEMA.PARAMETERS.PARAMETER_DEFAULT column
#
CREATE PROCEDURE proc(a INT DEFAULT 1, b INT DEFAULT (a+1), c INT DEFAULT POW(2,b))
BEGIN
SELECT a, b, c FROM DUAL;
END;
//
CREATE FUNCTION func(a INT DEFAULT 8, b INT DEFAULT LOG2(a)) RETURNS INT
BEGIN
RETURN b;
END;
//
CREATE USER user@localhost;
GRANT EXECUTE ON PROCEDURE test.proc TO user@localhost;
GRANT EXECUTE ON FUNCTION test.func TO user@localhost;
CONNECT conn1, localhost, user, , test;
SELECT specific_schema, specific_name, parameter_name, parameter_default FROM information_schema.PARAMETERS WHERE SPECIFIC_NAME = 'proc';
specific_schema specific_name parameter_name parameter_default
test proc a NULL
test proc b NULL
test proc c NULL
SELECT specific_schema, specific_name, parameter_name, parameter_default FROM information_schema.PARAMETERS WHERE SPECIFIC_NAME = 'func';
specific_schema specific_name parameter_name parameter_default
test func NULL NULL
test func a NULL
test func b NULL
connection default;
disconnect conn1;
GRANT SHOW CREATE ROUTINE ON PROCEDURE test.proc TO user@localhost;
GRANT SHOW CREATE ROUTINE ON FUNCTION test.func TO user@localhost;
CONNECT conn1, localhost, user, , test;
SELECT specific_schema, specific_name, parameter_name, parameter_default FROM information_schema.PARAMETERS WHERE SPECIFIC_NAME = 'proc';
specific_schema specific_name parameter_name parameter_default
test proc a 1
test proc b (`a` + 1)
test proc c pow(2,`b`)
SELECT specific_schema, specific_name, parameter_name, parameter_default FROM information_schema.PARAMETERS WHERE SPECIFIC_NAME = 'func';
specific_schema specific_name parameter_name parameter_default
test func NULL NULL
test func a 8
test func b log2(`a`)
connection default;
disconnect conn1;
DROP USER user@localhost;
DROP PROCEDURE proc;
DROP FUNCTION func;
# End of 12.2 tests
set @@global.collation_server=@save_collation_server;
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.56Angebot
¤
*Bot Zugriff
|
|
2026-11-24
|
|
|
|
|