Issue Details (XML | Word | Printable)

Key: CORE-5985
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Pavel Zotov
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Regression: ROLE does not passed in ES/EDS (specifying it in the statement is ignored)

Created: 15/Jan/19 09:44 AM   Updated: 16/Feb/19 08:43 AM
Component/s: Engine
Affects Version/s: 4.0 Alpha 1, 3.0.4
Fix Version/s: 4.0 Beta 1, 3.0.5

File Attachments: None
Image Attachments:

1. c5985-screen-for-LI-3-0-5-33085.png
(73 kB)

QA Status: Done successfully


 Description  « Hide
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 ? ] <<<<<




 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov made changes - 15/Jan/19 10:11 AM
Field Original Value New Value
Assignee Alexander Peshkov [ alexpeshkoff ]
Pavel Zotov made changes - 18/Jan/19 05:22 PM
Alexander Peshkov made changes - 22/Jan/19 03:18 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 4.0 Beta 1 [ 10750 ]
Fix Version/s 3.0.5 [ 10885 ]
Resolution Fixed [ 1 ]
Pavel Zotov made changes - 16/Feb/19 08:43 AM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status No test Done successfully
Pavel Zotov made changes - 16/Feb/19 08:43 AM
Status Resolved [ 5 ] Closed [ 6 ]