Issue Details (XML | Word | Printable)

Key: CORE-5898
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Emil Totev
Votes: 0
Watchers: 3
Operations

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

ROLE not passed in EXECUTE STATEMENT ... ON EXTERNAL

Created: 22/Aug/18 12:08 PM   Updated: 31/Aug/18 05:45 AM
Component/s: Engine
Affects Version/s: 3.0.0, 3.0.1, 3.0.2, 3.0.3
Fix Version/s: 3.0.4, 4.0 Beta 1

QA Status: Done successfully
Test Details: See also test for CORE-4054.


 Description  « Hide
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 http://tracker.firebirdsql.org/browse/CORE-4054 ), but the fix is not ported forward to version 3.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 27/Aug/18 06:52 AM
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;

Vlad Khorsun added a comment - 27/Aug/18 02:24 PM
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 ;^

Emil Totev added a comment - 30/Aug/18 08:03 AM
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!