Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
The current flashback code has the following logic embedded into print_row_event
print_row_event(ev)
|
if flashback_enabled
|
Store each event in a global events array.
|
|
if ev_type == event_stmt_end and flashback_enabled
|
print_all_stored_events in reverse.
|
delete all events from the events array except the last one.
|
The caller of print_row_event(ev) has the following logic:
if (flashback_on and event != event_stmt_end)
|
do_not_perform_cleanup
|
else
|
cleanup_current_event normally
|
This logic introduces side effects in print_row_event and also makes the flashback logic highly coupled to the printing logic. A better approach would be:
- If flashback is enabled, instead of printing events, store them in an array.
- When event_stmt_end is encountered, print out the contents of the array in reverse using print_row_event.
- Finally clean up all events.