Regression: ROLE does not passed in ES/EDS (specifying it in the statement is
ignored)
--------------------------------------------------------------------------------------
Key: CORE-5985
URL: http://tracker.firebirdsql.org/browse/CORE-5985
Project: Firebird Core
Issue Type: Bug
Components: Engine
Affects Versions: 3.0.4, 4.0 Alpha 1
Reporter: Pavel Zotov
Consider following script (correct here name of alias - i used 'employee'):
===
connect 'localhost:employee' user 'SYSDBA' password 'masterkey';
create user foo password '123';
create user bar password '456';
commit;
create role worker;
create role manager;
commit;
grant worker to foo;
grant manager to bar;
commit;
--connect 'localhost:employee' user 'BAR' password '456';
connect 'localhost:employee' user 'BAR' password '456' role manager;
set list on;
select rdb$get_context('SYSTEM', 'DB_NAME') as where_i_am, mon$user
who_am_i, mon$role whats_my_rtole
from mon$attachments
where mon$attachment_id = current_connection;
set term ^;
execute block returns(where_i_am varchar(255), who_am_i varchar(31),
whats_my_role varchar(31)) as
declare v_sttm varchar(2048);
declare v_user varchar(31) = 'foo';
declare v_pswd varchar(31) = '123';
declare v_role varchar(31) = 'WORKER';
declare v_extd varchar(255);
begin
v_extd = 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME');
v_sttm = 'select rdb$get_context(''SYSTEM'', ''DB_NAME''), mon$user,
mon$role from mon$attachments where mon$attachment_id = current_connection';
execute statement
v_sttm
on external v_extd
as user v_user password v_pswd role v_role
into
where_i_am, who_am_i, whats_my_role;
suspend;
end
^
set term ;^
commit;
connect 'localhost:employee' user 'SYSDBA' password 'masterkey';
drop user foo;
drop user bar;
commit;
revoke all on all from foo;
revoke all on all from bar;
drop role worker;
drop role manager;
commit;
show version;
===
On 2.5.9.27126 out will be as expected:
WHERE_I_AM
C:\MIX\FIREBIRD\FB25\EXAMPLES\EMPBUILD\EMPLOYEE.FDB
WHO_AM_I BAR
WHATS_MY_RTOLE MANAGER
WHERE_I_AM
C:\MIX\FIREBIRD\FB25\EXAMPLES\EMPBUILD\EMPLOYEE.FDB
WHO_AM_I FOO
WHATS_MY_ROLE WORKER
On 3.0.5.33086 and 4.0.0.1378:
WHERE_I_AM
C:\MIX\firebird\fb40\examples\empbuild\employee.fdb
WHO_AM_I BAR
WHATS_MY_RTOLE MANAGER
WHERE_I_AM
C:\MIX\FIREBIRD\FB40\EXAMPLES\EMPBUILD\EMPLOYEE.FDB
WHO_AM_I FOO
WHATS_MY_ROLE NONE
<<<<<<<<<<<<<<<<<<<<<<<<<<< [ Why ? ] <<<<<
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel