[MDEV-18465] Logging of DDL statements during backup Created: 2019-02-04  Updated: 2023-11-27  Due: 2019-02-05  Resolved: 2019-03-04

Status: Closed
Project: MariaDB Server
Component/s: Backup
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-17312 BACKUP: track and report DDLs Closed
Relates
relates to MDEV-5336 Implement BACKUP STAGE for safe exter... Closed

 Description   

Implement logging of DDL statements that happened between BACKUP STAGE start and BACKUP STAGE end.

The log will be written in data_dir/ddl.log. This file will be dropped (if exists) and created for each BACKUP START command.

The log file is a tab separated file with new line between commands.

The log format is:
datetime <tab> query <tab> original_storage_engine <tab> original_database <tab> original_table_name <tab> table_version <tab> new_storage_engine <tab> new_database <tab> new_table_name <tab> new_version_id <nl>

  • The fields named new_... are only filled in case of rename or alter table rename
  • table_version may be empty in case of very old .frm files (before MariaDB 10.0)
  • original_storage_engine may be 'DATABASE' in case of CREATE/DROP database, 'VIEW' in case of CREATE/DROP VIEW or 'TRIGGER' in case of CREATE/DROP TRIGGER.
  • original_table_name is empty in case of CREATE/DROP DATABASE.
  • All table and database name are written in file name format (to ensure that there are no tabs in the names). This means that a table of name 't 1' is logged as 't@00201'. One can use the
    filename_to_tablename() and tablename_to_filename() functions to convert between table and file names.

The possible values for query are:

  • ALTER
  • BULK_INSERT
  • CHANGE_INDEX
  • CREATE ; The storage engine field contains either storage engine name, DATABASE, VIEW or TRIGGER
  • DROP ; The storage engine field contains either storage engine name, DATABASE, VIEW or TRIGGER
  • DROP_AFTER_CREATE
  • RENAME
  • TRUNCATE
  • optimize
  • repair

Generated at Thu Feb 08 08:44:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.