Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
txn: undo commit/rollback triggers when reverting to savepoint
When reverting to a savepoint inside a DDL transaction, apart from undoing changes done by the DDL statements to the system spaces, we also have to - Run rollback triggers installed after the savepoint was set, because otherwise changes done to the schema by DDL won't be undone. - Remove commit triggers installed after the savepoint, because they are not relevant anymore, apparently. To achieve that, let's remember not only the last transaction statement at the time when a savepoint is created, but also the state of commit and rollback triggers. Since in contrast to txn statements, commit and rollback triggers can actually be deleted from the list, we create dummy triggers per each savepoint and use them as markers in the trigger lists. We don't however create dummy triggers if no commit/rollback triggers is installed, because in that case we would simply need to clear the trigger lists. While we are at it, let's also make sure that a rollback trigger doesn't access an already freed tuple. To do that, we release statement tuples after running rollback triggers, not before as we used to. Closes #4364 Closes #4365
- Loading branch information
Showing
6 changed files
with
252 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters