| 4639 | */ |
| 4640 | |
| 4641 | static |
| 4642 | int create_table_impl(THD *thd, |
| 4643 | DDL_LOG_STATE *ddl_log_state_create, |
| 4644 | DDL_LOG_STATE *ddl_log_state_rm, |
| 4645 | const Lex_ident_db &orig_db, |
| 4646 | const Lex_ident_table &orig_table_name, |
| 4647 | const LEX_CSTRING &db, const LEX_CSTRING &table_name, |
| 4648 | const LEX_CSTRING &path, const DDL_options_st options, |
| 4649 | HA_CREATE_INFO *create_info, Alter_info *alter_info, |
| 4650 | int create_table_mode, bool *is_trans, KEY **key_info, |
| 4651 | uint *key_count, LEX_CUSTRING *frm) |
| 4652 | { |
| 4653 | LEX_CSTRING *alias; |
| 4654 | handler *file= 0; |
| 4655 | int error= 1; |
| 4656 | bool frm_only= create_table_mode == C_ALTER_TABLE_FRM_ONLY; |
| 4657 | bool internal_tmp_table= create_table_mode == C_ALTER_TABLE || frm_only; |
| 4658 | DBUG_ENTER("create_table_impl"); |
| 4659 | DBUG_PRINT("enter", ("db: '%s' table: '%s' tmp: %d path: %s", |
| 4660 | db.str, table_name.str, internal_tmp_table, path.str)); |
| 4661 | |
| 4662 | DBUG_ASSERT(create_info->default_table_charset); |
| 4663 | |
| 4664 | /* Easy check for ddl logging if we are creating a temporary table */ |
| 4665 | if (create_info->tmp_table()) |
| 4666 | { |
| 4667 | ddl_log_state_create= 0; |
| 4668 | ddl_log_state_rm= 0; |
| 4669 | } |
| 4670 | |
| 4671 | if (fix_constraints_names(thd, &alter_info->check_constraint_list, |
| 4672 | create_info)) |
| 4673 | DBUG_RETURN(1); |
| 4674 | |
| 4675 | if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) |
| 4676 | { |
| 4677 | if (create_info->data_file_name) |
| 4678 | push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, |
| 4679 | WARN_OPTION_IGNORED, |
| 4680 | ER_THD(thd, WARN_OPTION_IGNORED), |
| 4681 | "DATA DIRECTORY"); |
| 4682 | if (create_info->index_file_name) |
| 4683 | push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, |
| 4684 | WARN_OPTION_IGNORED, |
| 4685 | ER_THD(thd, WARN_OPTION_IGNORED), |
| 4686 | "INDEX DIRECTORY"); |
| 4687 | create_info->data_file_name= create_info->index_file_name= 0; |
| 4688 | } |
| 4689 | else |
| 4690 | { |
| 4691 | if (unlikely(error_if_data_home_dir(create_info->data_file_name, |
| 4692 | "DATA DIRECTORY")) || |
| 4693 | unlikely(error_if_data_home_dir(create_info->index_file_name, |
| 4694 | "INDEX DIRECTORY")) || |
| 4695 | unlikely(check_partition_dirs(thd->lex->part_info))) |
| 4696 | goto err; |
| 4697 | } |
| 4698 |
no test coverage detected