Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
Description
The purpose of this task is to ensure that CREATE VIEW is atomic
When a view is created, the definition is first written to a view_name.frm~ and then renamed to
view_name.frm
The logic should be
- Log CREATE view to DDL log, with a marker if old view existsted
- If old view exists (in case of CREATE or REPLACE view) make a copy of old view
- Create view
- Delete view copy if it was created.
Crash recovery:
- Delete view_name.frm~ file.
- If query was logged to binary log
- delete copy of view if it exists
-else
rename the copy of the view over the .frm file (restoring old definition)
One benefit of the new code is that create or replace view is no totally atomic even if there existed an old view: Either the view will be replaced or the old one will be untouched.
Attachments
Issue Links
- is part of
-
MDEV-17567 Atomic DDL
- Closed