Savepoints are not released on commit
-------------------------------------

                 Key: CORE-4382
                 URL: http://tracker.firebirdsql.org/browse/CORE-4382
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0 Alpha 2, 2.5.1
            Reporter: Dimitry Sibiryakov
         Attachments: tra.diff

Following script leaves in index several orphan nodes.

create database "g_test";
create table g_test (f integer);
create index g_ind on g_test (f);
insert into g_test values (1);
commit;
update g_test set f=2;
savepoint a;
update g_test set f=3;
savepoint b;
update g_test set f=4;
savepoint c;
update g_test set f=5;
savepoint d;
update g_test set f=6;
savepoint e;
update g_test set f=7;
commit;
select * from g_test;

Proposed patch:

Index: tra.cpp
===================================================================
--- tra.cpp     (revision 59342)
+++ tra.cpp     (working copy)
@@ -381,7 +381,15 @@
        // Flush pages if transaction logically modified data
 
        if (transaction->tra_flags & TRA_write)
+       {
+               // Get rid of all savepoints except transaction one
+               // to let all intermediate garbage after update_in_place in 
indices and BLOBs to be cleaned up
+               while (transaction->tra_save_point && 
!(transaction->tra_save_point->sav_flags & SAV_trans_level))
+               {
+                       VIO_verb_cleanup(tdbb, transaction);
+               }
                transaction_flush(tdbb, FLUSH_TRAN, transaction->tra_number);
+       }
        else if ((transaction->tra_flags & (TRA_prepare2 | TRA_reconnected)) ||
                (sysTran->tra_flags & TRA_write))
        {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to