diff options
Diffstat (limited to 'storage/xtradb/handler/ha_innodb.cc')
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 988b10522a4..eb860ef4d62 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -4041,6 +4041,11 @@ innobase_init( srv_data_home = (innobase_data_home_dir ? innobase_data_home_dir : default_path); +#ifdef WITH_WSREP + /* If we use the wsrep API, then we need to tell the server + the path to the data files (for passing it to the SST scripts): */ + wsrep_set_data_home_dir(innobase_data_home_dir); +#endif /* WITH_WSREP */ /* Set default InnoDB data file size to 12 MB and let it be auto-extending. Thus users can use InnoDB in >= 4.0 without having @@ -15014,7 +15019,7 @@ get_foreign_key_info( /* Referenced (parent) table name */ ptr = dict_remove_db_name(foreign->referenced_table_name); - len = filename_to_tablename(ptr, name_buff, sizeof(name_buff)); + len = filename_to_tablename(ptr, name_buff, sizeof(name_buff), 1); f_key_info.referenced_table = thd_make_lex_string( thd, 0, name_buff, static_cast<unsigned int>(len), 1); @@ -15030,7 +15035,7 @@ get_foreign_key_info( /* Dependent (child) table name */ ptr = dict_remove_db_name(foreign->foreign_table_name); - len = filename_to_tablename(ptr, name_buff, sizeof(name_buff)); + len = filename_to_tablename(ptr, name_buff, sizeof(name_buff), 1); f_key_info.foreign_table = thd_make_lex_string( thd, 0, name_buff, static_cast<unsigned int>(len), 1); @@ -15046,41 +15051,25 @@ get_foreign_key_info( } while (++i < foreign->n_fields); if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE) { - len = 7; - ptr = "CASCADE"; + f_key_info.delete_method = FK_OPTION_CASCADE; } else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL) { - len = 8; - ptr = "SET NULL"; + f_key_info.delete_method = FK_OPTION_SET_NULL; } else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION) { - len = 9; - ptr = "NO ACTION"; + f_key_info.delete_method = FK_OPTION_NO_ACTION; } else { - len = 8; - ptr = "RESTRICT"; + f_key_info.delete_method = FK_OPTION_RESTRICT; } - f_key_info.delete_method = thd_make_lex_string( - thd, f_key_info.delete_method, ptr, - static_cast<unsigned int>(len), 1); - if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE) { - len = 7; - ptr = "CASCADE"; + f_key_info.update_method = FK_OPTION_CASCADE; } else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL) { - len = 8; - ptr = "SET NULL"; + f_key_info.update_method = FK_OPTION_SET_NULL; } else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION) { - len = 9; - ptr = "NO ACTION"; + f_key_info.update_method = FK_OPTION_NO_ACTION; } else { - len = 8; - ptr = "RESTRICT"; + f_key_info.update_method = FK_OPTION_RESTRICT; } - f_key_info.update_method = thd_make_lex_string( - thd, f_key_info.update_method, ptr, - static_cast<unsigned int>(len), 1); - if (foreign->referenced_index && foreign->referenced_index->name) { referenced_key_name = thd_make_lex_string(thd, f_key_info.referenced_key_name, |