Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROLE not passed in EXECUTE STATEMENT ... ON EXTERNAL [CORE5898] #6156

Closed
firebird-issue-importer opened this issue Aug 22, 2018 · 9 comments
Closed

Comments

@firebird-issue-importer

Submitted by: Emil Totev (emilt)

The current role is not passed to the external data source when using 'execute statement ... on external' without AS USER, PASSWORD and ROLE additions.
This has been acknowledged as a bug and fixed for 2.5.3 (see CORE4054 ), but the fix is not ported forward to version 3.

Commits: 79d16e6 b0ab147

====== Test Details ======

See also test for CORE4054.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 23, 2018

Modified by: Emil Totev (emilt)

description: The current role is not passed to the external data source when using 'execute statement ... on external' without AS USER, PASSWORD and ROLE additions.
This has been acknowledged as a bug and fixed for 2.5.3 (see CORE4054), but the fix is not ported forward to version 3.

=>

The current role is not passed to the external data source when using 'execute statement ... on external' without AS USER, PASSWORD and ROLE additions.
This has been acknowledged as a bug and fixed for 2.5.3 (see CORE4054 ), but the fix is not ported forward to version 3.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 27, 2018

Commented by: @hvlad

Could you show reproducible example ?

I just check following (with current build of 3.0.4):

firebird>isql inet://s:\Temp\eds\MASTER.FDB -user VLAD -pass vlad -role ROLE1
Database: inet://s:\Temp\eds\MASTER.FDB, User: VLAD, Role: ROLE1
SQL> select current_connection, current_user, current_role from rdb$database;

CURRENT_CONNECTION USER ROLE
===================== =============================== ===============================
63 VLAD ROLE1

SQL> exit;

firebird>isql inet://s:\Temp\eds\RDB0.FDB -user VLAD -pass vlad -role ROLE1
Database: inet://s:\Temp\eds\RDB0.FDB, User: VLAD, Role: ROLE1
SQL> select current_connection, current_user, current_role from rdb$database;

CURRENT_CONNECTION USER ROLE
===================== =============================== ===============================
13 VLAD ROLE1

SQL>
SQL> set term ^;
SQL> execute block
CON> returns (db varchar(64), usr varchar(32), rl varchar(32))
CON> as
CON> begin
CON> select current_user, current_role from rdb$database
CON> into :usr, :rl;
CON> db = 'inet://s:\Temp\eds\RDB0.FDB'; -- local
CON> suspend;
CON>
CON> db = 'inet://s:\Temp\eds\MASTER.FDB'; -- remote
CON> execute statement 'select current_user, current_role from rdb$database'
CON> into :usr, :rl;
CON> suspend;
CON> end
CON> ^

DB USR RL
================================================================ ================================ ================================
inet://s:\Temp\eds\RDB0.FDB VLAD ROLE1
inet://s:\Temp\eds\MASTER.FDB VLAD ROLE1

SQL> set term ;^
SQL> exit;

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 27, 2018

Commented by: @hvlad

My bad, the sample it not correct. Below is correct one and it reproduces the issue:

set term ^;

execute block
returns (db varchar(64), usr varchar(32), rl varchar(32))
as
begin
db = 's:\Temp\eds\RDB0.FDB'; -- local
select current_user, current_role from rdb$database
into :usr, :rl;
suspend;

db = 's:\Temp\eds\MASTER.FDB'; -- remote
execute statement 'select current_user, current_role from rdb$database'
on external :db
into :usr, :rl;
suspend;
end
^

set term ;^

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 27, 2018

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 30, 2018

Commented by: Emil Totev (emilt)

Build 3.0.4.33036 is working OK for me, both for the test case and in my actual usage scenario.
Thank you very much for the quick reaction!

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 30, 2018

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

Fix Version: 3.0.4 [ 10863 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 31, 2018

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 31, 2018

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 31, 2018

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

Test Details: See also test for CORE4054.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment