Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
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
Attachments
Issue Links
- blocks
-
MDEV-5359 CREATE OR REPLACE, CREATE IF NOT EXISTS, DROP IF EXISTS
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
This is a pre-requisite task for: 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. These two parts should be moved out of HA_CREATE_INFO. Proposed 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 and mysql_drop_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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. It would be very nice to have these methods wrapped into classes, to share some pieces of the code easier between different commands of the same database object. Look at 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. {note} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {note} |
This is a pre-requisite task for: 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. These two parts should be moved out of HA_CREATE_INFO. Proposed 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 and mysql_drop_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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. It would be very nice to have these methods wrapped into classes, to share some pieces of the code easier between different commands of the same database object. Look at 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. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
Assignee | Alexander Barkov [ bar ] | Sergei Golubchik [ serg ] |
Description |
This is a pre-requisite task for: 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. These two parts should be moved out of HA_CREATE_INFO. Proposed 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 and mysql_drop_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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. It would be very nice to have these methods wrapped into classes, to share some pieces of the code easier between different commands of the same database object. Look at 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. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
Description |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as the easiest one. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
Description |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as the easiest one. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as the easiest one and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
Description |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as the easiest one and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as SCHEMA the easiest one to refactor, and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
Description |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as SCHEMA the easiest one to refactor, and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as SCHEMA is the easiest one to refactor, and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
Description |
This is a pre-requisite task for: 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: - mysql_create_db, mysql_drop_db - mysql_create_table, mysql_drop_table and some others. The new structures will now be passed instead of HA_CREATE_INFO It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as SCHEMA is the easiest one to refactor, and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
This is a pre-requisite task for: 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 It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as SCHEMA is the easiest one to refactor, and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
Fix Version/s | 10.1 [ 16100 ] | |
Fix Version/s | 10.1.2 [ 15801 ] |
Affects Version/s | 10.1.1 [ 16801 ] | |
Issue Type | Bug [ 1 ] | Task [ 3 ] |
Fix Version/s | 10.1.2 [ 15801 ] | |
Fix Version/s | 10.1 [ 16100 ] |
Status | Open [ 1 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Sergei Golubchik [ serg ] | Alexander Barkov [ bar ] |
Component/s | OTHER [ 10125 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Description |
This is a pre-requisite task for: 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 It would be very nice to have these functions wrapped into classes as methods, to share some pieces of the code easier between different commands of the same database object. Look at 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. This task will wrap SCHEMA related routines, as SCHEMA is the easiest one to refactor, and the one that has a lot of duplicate code. {panel} Note, with this approach in the future we can refactor more code, to share more pieces not only between commands of the same database object, but also between different database objects (e.g. tables, triggers, SP, all the rest). All SQL statements basically consist of these stepts: - 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 {panel} |
This is a pre-requisite task for: 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 |
Fix Version/s | 10.1.3 [ 18000 ] | |
Fix Version/s | 10.1.2 [ 15801 ] |
Workflow | MariaDB v2 [ 58457 ] | MariaDB v3 [ 64985 ] |
Workflow | MariaDB v3 [ 64985 ] | MariaDB v4 [ 132462 ] |