Issue Details (XML | Word | Printable)

Key: CORE-3058
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Adriano dos Santos Fernandes
Votes: 0
Watchers: 0

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

New generators are created with wrong value when more than 32K generators was previously created

Created: 21/Jun/10 12:17 PM   Updated: 29/May/15 05:45 PM
Component/s: Engine
Affects Version/s: 2.5 Alpha 1, 2.5 Beta 1, 2.5 Beta 2, 3.0 Initial, 2.5 RC1, 2.5 RC2
Fix Version/s: 2.5.1, 3.0 Alpha 1

Issue Links:

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.
Start of discussion with dimitr: 06-mar-2015 23:44.

 Description  « Hide
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
  declare n integer = 0;
  declare x integer;
  while (n < 33000)
    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;

-- OK: No sequences.
show sequence!

create sequence s1!

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

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.