[MDEV-7289] Add classes to handle DDL statements Created: 2014-12-08  Updated: 2021-05-11

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

There are four very similar pieces of the code in sql_parse.cc performed for SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB_UPGRADE,SQLCOM_ALTER_DB.

It would be very nice to add classes that handle all sql_parse.cc events.

This will allow to share similar pieces of the code not only between commands of the same database object (like in case of SCHEMA commands), but also between different database objects (e.g. tables, views, triggers, SP, all the rest).

All SQL statements consist of these steps:

  • Check if statement can be executed (e.g. name in "CREATE SCHEMA name" is valid).
  • Check access
  • Apply filters for DDL statements (e.g. Rpl_filters on slave)
  • Perform WSREP_TO_ISOLATION
  • Execute the actual action
  • Do binary logging

All these steps can be put into virtual methods of a new class.

This task will wrap DDL related routines only (CREATE, DROP, ALTER).


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