firebird icon indicating copy to clipboard operation
firebird copied to clipboard

The newly created users are not visible to execute statement in Classic / SuperClassic on Linux

Open dmitry-starodubov opened this issue 3 years ago • 1 comments

The script below works in 3.0 (all architectures) and in 4+ (Supersever only). But 4+ Classic and Superclassic on Linux fail with the error "Your user name and password are not defined. Ask your database administrator to set up a Firebird login.". Although it will work fine if we wait 10 seconds before execute block.

create user test password 'test';
commit;

set term ^;
create or alter procedure sp_main(a_usr varchar(31), a_pwd varchar(31))
  returns(x int) as
begin
  for
          execute statement
          'select 1 from rdb$database'
          as user a_usr password a_pwd into x
  do
          suspend;
end
^
set term ;^
commit;

grant execute on procedure sp_main to test;
commit;

-- wait 10 seconds and it will work

set term ^;
execute block returns(x int) as
begin
  for execute statement ('select * from sp_main(:u, :p)') ( u := 'test', p := 'test' )
  into x
  do suspend;
end
^
set term ;^
commit;

drop user test;
commit;

dmitry-starodubov avatar Aug 11 '22 12:08 dmitry-starodubov

Confirmed an issue

AlexPeshkoff avatar Aug 12 '22 11:08 AlexPeshkoff

Renamed issue because actual error has much wider scope

AlexPeshkoff avatar Aug 19 '22 16:08 AlexPeshkoff

QA issue: see notes in the test.

pavel-zotov avatar May 14 '24 08:05 pavel-zotov