[MDEV-7112] Split HA_CREATE_INFO Created: 2014-11-14  Updated: 2014-12-09  Resolved: 2014-12-08

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: 10.1.3

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-5359 CREATE OR REPLACE, CREATE IF NOT EXIS... Closed

 Description   

This is a pre-requisite task for:
MDEV-5359 CREATE OR REPLACE, CREATE IF NOT EXISTS, DROP IF EXISTS

HA_CREATE_INFO contains:

  • DDL options like IF EXISTS and IF NOT EXISTS that are processed before passing information to the handler (for table creation) and are not needed for the handler itself.
  • Schema specifications (e.g. default character set). This part is needed as a standalone structure, because it is passed to mysql_create_db and mysql_rm_db who don't need the rest of HA_CREATE_INFO. Currently the entire HA_CREATE_INFO is initialized before passing to the schema DDL routines. Also, this part is enough for mysqld_show_create_db. Currently the entire HA_CREATE_INFO is passed again.

So these two parts should be moved out of HA_CREATE_INFO.

Proposed new structure hierarchy:
1. DDL_options_st, to store IF EXISTS, IF NOT EXISTS
This will be shared between all DDL routines (e.g. CREATE TABLE, DROP SCHEMA, etc).
2. Schema_specification_st
This will be passed to mysql_create_db, mysql_drop_db, mysqld_show_create_db
3. Table_contents_source_st, contains everything the old HA_CREATE_INFO had but without DDL options and without Schema_specification_st
4. HA_CREATE_INFO= Table_contents_source_st + Schema_specification_st
This will be passed to handlers
5. Table_specification_st= HA_CREATE_INFO + DDL_options_st
This will be passed to mysql_create_table.

Also, API for some functions has to be changed:

  • SCHEMA routines: mysql_create_db, mysql_drop_db
  • TABLE routines: mysql_create_table, mysql_drop_table
    and some others. The new structures will now be passed instead of HA_CREATE_INFO

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