Skip to content

Fix CORE-5174#10

Merged
dyemanov merged 1 commit intoFirebirdSQL:masterfrom
aafemt:CORE-5174
Mar 28, 2016
Merged

Fix CORE-5174#10
dyemanov merged 1 commit intoFirebirdSQL:masterfrom
aafemt:CORE-5174

Conversation

@aafemt
Copy link
Copy Markdown
Contributor

@aafemt aafemt commented Mar 27, 2016

Take into account possible reverse of savepoint number sequence in short chains.
Example:
For savepoints sequence "12 -> 14 -> 7 -> 1" request to rollback savepoints up to 12, must result in "14 -> 7 -> 1", not "7 -> 1" as it might happen before this fix.

@dyemanov
Copy link
Copy Markdown
Member

How could savepoint 7 be started after savepoint 14? Does savepoint 7 re-appear after saving/restoring stack on suspend?

@aafemt
Copy link
Copy Markdown
Contributor Author

aafemt commented Mar 27, 2016

Stack is shown from new savepoints to old one. Savepoint 1 is transaction savepoint, savepoint 7 is statement savepoint.
If you had on mind "12", not "7", then yes, it is result of suspend trick.

Comment thread src/jrd/tra.cpp
tra_save_point->sav_next->sav_number >= number)
while(tra_save_point && tra_save_point->sav_number > number &&
tra_save_point->sav_next && tra_save_point->sav_next->sav_number >= number)
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. AFAIU, you assume here that only one savepoint in the stack may have its number out of order, supposedly this is the looper-generated one. Couldn't there be more? E.g. started by BlockNode or SavePointNode?
  2. Shouldn't the same check be applied to other places like BlockNode::execute()? I see there the kissing cousin of the loop you've fixed in tra.cpp.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I assume that there cannot be savepoints with smaller number before the given one in stack. BlockNode and SavePointNode AFAIU cannot swap execution order of nested PSQL calls and WHEN handlers are allowed in PSQL only.
  2. Agree. I'll commit the change into CORE-5173 branch a little later.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants