Skip to content

Commit

Permalink
reflected review
Browse files Browse the repository at this point in the history
  • Loading branch information
swi0110 committed Dec 9, 2024
1 parent b994646 commit 9362c84
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ Stored procedure execute error:

===================================================

ERROR: An object with the supplied attribute value doesnt exist


===================================================
Error:-711
An object with the supplied attribute value doesn't exist.

===================================================

change procedure owner (dba -> public)


Expand All @@ -70,6 +79,16 @@ Error:-1360
In line 2, column 13
Stored procedure compile error: Syntax: Unknown class "dba.tbl". select col1, col2 from [dba.tbl]

===================================================

ERROR: Syntax error


===================================================
Error:-493
Syntax: In line 1, column 41 before ' TO dba ; '
Syntax error: unexpected 'OWNER', expecting ';'

===================================================
sp_name lang owner comment
test_tbl PLCSQL PUBLIC null
Expand Down Expand Up @@ -109,6 +128,88 @@ sp_name lang owner comment
test_tbl PLCSQL DBA 2: COMMENT


===================================================

check to _db_class on procedure


===================================================

create to dba.test_db_class


===================================================
0

===================================================

null


_db_class result: dba.tbl
===================================================

create to public.test_db_class2, ERROR: Semantic: SELECT is not authorized on _db_class


===================================================
Error:-1360
In line 2, column 13
Stored procedure compile error: Semantic: SELECT is not authorized on _db_class. select [_db_class].unique_name from [_db_class] [_db_class] ...

===================================================

alter owner dba.test_db_class to public, ERROR: Semantic: SELECT is not authorized on _db_class


===================================================
Error:-1360
In line 2, column 13
Stored procedure compile error: Semantic: SELECT is not authorized on _db_class. select [_db_class].unique_name from [_db_class] [_db_class] ...

===================================================

grant select on _db_class to public & ALTER procedure dba.test_db_class OWNER TO public


===================================================
0

===================================================
0

===================================================

connect to public & call public.test_db_class()


===================================================

null


===================================================

null


_db_class result: dba.tbl
===================================================

connect to dba & Test done


===================================================

null


===================================================
0

===================================================
0

===================================================
0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ end;

call test_tbl();


evaluate 'change table owner (dba -> public)';
ALTER TABLE tbl OWNER TO public;
evaluate 'ERROR: Stored procedure execute error';
call test_tbl();

evaluate 'ERROR: An object with the supplied attribute value doesnt exist';
ALTER procedure test_tbl OWNER TO no_user;

evaluate 'change procedure owner (dba -> public)';
ALTER procedure test_tbl OWNER TO public;
Expand All @@ -32,6 +33,9 @@ call public.test_tbl();
evaluate 'ERROR: Stored procedure compile error';
ALTER procedure public.test_tbl OWNER TO dba COMMENT '1: OWNER TO COMMENT';

evaluate 'ERROR: Syntax error';
ALTER procedure public.test_tbl COMMENT '1: OWNER TO COMMENT' OWNER TO dba ;

select sp_name, lang, owner, comment from db_stored_procedure where sp_name='test_tbl';


Expand All @@ -48,7 +52,48 @@ ALTER procedure test_tbl COMMENT '2: COMMENT';
select sp_name, lang, owner, comment from db_stored_procedure where sp_name='test_tbl';



evaluate 'check to _db_class on procedure';
evaluate 'create to dba.test_db_class';
create or replace procedure test_db_class as
cursor c is select unique_name from _db_class where unique_name='dba.tbl';
begin
FOR r IN c LOOP
DBMS_OUTPUT.put_line('_db_class result: ' || r.unique_name);
END LOOP;
end;

call test_db_class();


evaluate 'create to public.test_db_class2, ERROR: Semantic: SELECT is not authorized on _db_class';
create or replace procedure public.test_db_class2 as
cursor c is select unique_name from _db_class where unique_name='dba.tbl';
begin
FOR r IN c LOOP
DBMS_OUTPUT.put_line('_db_class result: ' || r.unique_name);
END LOOP;
end;


evaluate 'alter owner dba.test_db_class to public, ERROR: Semantic: SELECT is not authorized on _db_class';
ALTER procedure dba.test_db_class OWNER TO public;


evaluate 'grant select on _db_class to public & ALTER procedure dba.test_db_class OWNER TO public';
grant select on _db_class to public;
ALTER procedure dba.test_db_class OWNER TO public;


evaluate 'connect to public & call public.test_db_class()';
call login('public','') on class db_user;
call public.test_db_class();


evaluate 'connect to dba & Test done';
call login('dba','') on class db_user;
revoke select on _db_class from public;
drop TABLE tbl;
drop procedure test_tbl;

drop procedure public.test_db_class;
--+ server-message off

0 comments on commit 9362c84

Please sign in to comment.