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

Error in autonomous transaction with empty exception handler: can insert duplicate values into PK/UK column (leads to unrestorable backup) [CORE3340] #3706

Closed
firebird-automations opened this issue Feb 9, 2011 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Relate to CORE3341
Is related to QA455

Let the file 'AAA' contains the following script:

recreate table tmp(id int not null primary key using index tmp_id_pk);
commit;
set transaction no wait isolation level read committed;
set term ^;
execute block as
begin
insert into tmp values(1);
insert into tmp values(2);
in autonomous transaction do begin
insert into tmp values(1);
when any do begin
--exception; -- <<<<<<<<<<<<<< ATTENTION: **NO** handle exception here
end
end
end^
set term ;^
commit;
select id from tmp;
select count(*) from tmp;
commit;

Create NEW EMPTY database, connect to it via ISQL -n and then:

SQL> IN AAA;

Result:

      ID

============
1
2
1

   COUNT

============
3

So, we have duplicate in PK. The same result will be if PK replaced by UK.
--------------------------------------
Moreover,
1) GFIX -V -FULL will *NOT* alert that table TMP has some problem in it's PK;
2) gbak -b will create UNRECOERABLE .fbk.
If then we'll try gbak -c test.fbk test_new.fdb then following messages will fills the screen:
...
...
gbak: The unique index has duplicate values or NULLs.
gbak: Delete or Update duplicate values or NULLs, and activate index with
gbak: ALTER INDEX "TMP_ID_PK" ACTIVE;
gbak:Index "TMP_ID_PK" failed to activate because:
gbak: The unique index has duplicate values or NULLs.
gbak: Delete or Update duplicate values or NULLs, and activate index with
gbak: ALTER INDEX "TMP_ID_PK" ACTIVE;
gbak:Index "TMP_ID_PK" failed to activate because:
gbak: The unique index has duplicate values or NULLs.
gbak: Delete or Update duplicate values or NULLs, and activate index with
gbak: ALTER INDEX "TMP_ID_PK" ACTIVE;

... etc ... (these messages repeats infinitely)

Commits: 8f517dc 0017fbc 305b989 5eec5f5 1933d37 FirebirdSQL/fbt-repository@b26094e

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

summary: Error in autonom. transaction WITHOUT exception handling: can insert duplicate values in table with PK (UK) ==> unrecoverable backup. => Error in autonomous transaction with empty exception handler: can insert duplicate values into PK/UK column (leads to unrestorable backup)

@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

Version: 3.0 Initial [ 10301 ]

security: Developers [ 10012 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue relate to CORE3341 [ CORE3341 ]

@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 QA455 [ QA455 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

Fix Version: 3.0 Alpha 1 [ 10331 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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

No branches or pull requests

2 participants