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

New generators are created with wrong value when more than 32K generators was previously created [CORE3058] #3438

Closed
firebird-automations opened this issue Jun 21, 2010 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

Is related to QA442

This got my attention after reading Norman Dunbar's Firebird Internals document.

When more than 32K generators are created (and deleted), the generator id is restarted. As soon that happens, new generators start getting old (of already deleted) current values.

Test case:

execute block
as
declare n integer = 0;
declare x integer;
begin
while (n < 33000)
do
begin
in autonomous transaction do
execute statement 'create sequence s' || n;
in autonomous transaction do
execute statement 'select gen_id(s' || n || ', 1000) from rdb$database' into x;
in autonomous transaction do
execute statement 'drop sequence s' || n;

n = n \+ 1;

end
end!

-- OK: No sequences.
show sequence!

create sequence s1!

-- Error: S1 is at 1000!
show sequence!

Commits: df893a7 2db78d0 7a405a4 b345034 FirebirdSQL/fbt-repository@bccd4a4

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

::: NB ::: As of Firebird 3.0 we need to make EVERY operation (creation, select gen_id, dropping)
in AUTONOMOUS transaction because physically appearance of generator in database will be on COMMIT only.
Start of discussion with dimitr: 06-mar-2015 23:44.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 2.5 RC2 [ 10372 ]

Version: 2.5 RC1 [ 10362 ]

Version: 3.0 Initial [ 10301 ]

Version: 2.5 Beta 2 [ 10300 ]

Version: 2.5 Beta 1 [ 10251 ]

Version: 2.5 Alpha 1 [ 10224 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: In Progress [ 3 ] => Open [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA442 [ QA442 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: ::: NB ::: As of Firebird 3.0 we need to make EVERY operation (creation, select gen_id, dropping)
in AUTONOMOUS transaction because physically appearance of generator in database will be on COMMIT only.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

Test Details: ::: NB ::: As of Firebird 3.0 we need to make EVERY operation (creation, select gen_id, dropping)
in AUTONOMOUS transaction because physically appearance of generator in database will be on COMMIT only.

=>

::: NB ::: As of Firebird 3.0 we need to make EVERY operation (creation, select gen_id, dropping)
in AUTONOMOUS transaction because physically appearance of generator in database will be on COMMIT only.
Start of discussion with dimitr: 06-mar-2015 23:44.

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