3913 kevin.lewis@stripped 2012-05-30
A few changes to increase coverage and clean up code.
modified:
storage/innobase/dict/dict0dict.cc
storage/innobase/dict/dict0load.cc
storage/innobase/fil/fil0fil.cc
storage/innobase/include/fil0fil.h
storage/innobase/row/row0import.cc
3912 kevin.lewis@stripped 2012-05-29
Missed a file in last full patch.
added:
mysql-test/suite/innodb/t/portability_wl5980_linux.zip
=== modified file 'storage/innobase/dict/dict0dict.cc'
--- a/storage/innobase/dict/dict0dict.cc revid:kevin.lewis@stripped
+++ b/storage/innobase/dict/dict0dict.cc revid:kevin.lewis@stripped
@@ -1457,6 +1457,8 @@ dict_table_rename_in_cache(
success = fil_rename_tablespace(
old_name, table->space, new_name, new_path);
+ /* If the tablespace is remote, a new .isl file was created
+ If success, delete the old one. If not, delete the new one. */
if (new_path) {
mem_free(new_path);
if (success) {
=== modified file 'storage/innobase/dict/dict0load.cc'
--- a/storage/innobase/dict/dict0load.cc revid:kevin.lewis@stripped
+++ b/storage/innobase/dict/dict0load.cc revid:kevin.lewis@stripped
@@ -933,6 +933,7 @@ dict_insert_tablespace_and_filepath(
trx_t* trx;
ut_ad(mutex_own(&(dict_sys->mutex)));
+ ut_ad(filepath);
trx = trx_allocate_for_background();
trx_start_if_not_started(trx);
@@ -1111,7 +1112,7 @@ loop:
/* filepath can be NULL in this call. */
dberr_t err = fil_open_single_table_tablespace(
- FALSE, TRUE, space_id,
+ false, true, space_id,
dict_tf_to_fsp_flags(flags),
name, filepath);
@@ -2111,9 +2112,8 @@ dict_save_data_dir_path(
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_a(DICT_TF_HAS_DATA_DIR(table->flags));
- if (table->data_dir_path || filepath == NULL) {
- return;
- }
+ ut_a(!table->data_dir_path);
+ ut_a(filepath);
/* Be sure this filepath is not the default filepath. */
char* default_filepath = fil_make_ibd_name(table->name, false);
@@ -2258,7 +2258,7 @@ err_exit:
/* Try to open the tablespace */
err = fil_open_single_table_tablespace(
- TRUE, FALSE, table->space,
+ true, false, table->space,
dict_tf_to_fsp_flags(table->flags),
name, filepath);
=== modified file 'storage/innobase/fil/fil0fil.cc'
--- a/storage/innobase/fil/fil0fil.cc revid:kevin.lewis@stripped
+++ b/storage/innobase/fil/fil0fil.cc revid:kevin.lewis@stripped
@@ -1490,10 +1490,7 @@ fil_space_get_first_path(
char* path;
ut_ad(fil_system);
-
- if (!id) {
- return(NULL);
- }
+ ut_a(id);
fil_mutex_enter_and_prepare_for_io(id);
@@ -3139,8 +3136,6 @@ fil_read_link_file(
filepath[lastch--] = 0x00;
}
srv_normalize_path_for_win(filepath);
- } else {
- mem_free(filepath);
}
}
@@ -3155,7 +3150,6 @@ ibool
fil_open_linked_file(
/*===============*/
const char* tablename, /*!< in: database/tablename */
- char* filepath, /*!< in: filepath of tablename */
char** remote_filepath,/*!< out: remote filepath */
os_file_t* remote_file) /*!< out: remote file handle */
@@ -3167,14 +3161,6 @@ fil_open_linked_file(
return(FALSE);
}
- /* A link file existed, make sure it is not the file we are
- already using. */
- if (filepath && strcmp(filepath, *remote_filepath) == 0) {
- mem_free(*remote_filepath);
- *remote_filepath = NULL;
- return (FALSE);
- }
-
/* The filepath provided is different from what was
found in the link file. */
*remote_file = os_file_create_simple_no_error_handling(
@@ -3492,8 +3478,8 @@ UNIV_INTERN
dberr_t
fil_open_single_table_tablespace(
/*=============================*/
- ibool validate, /*!< in: Do we validate tablespace? */
- ibool fix_dict, /*!< in: Can we fix the dictionary? */
+ bool validate, /*!< in: Do we validate tablespace? */
+ bool fix_dict, /*!< in: Can we fix the dictionary? */
ulint id, /*!< in: space id */
ulint flags, /*!< in: tablespace flags */
const char* tablename, /*!< in: table name in the
@@ -3536,7 +3522,7 @@ fil_open_single_table_tablespace(
}
link_file_found = fil_open_linked_file(
- tablename, NULL, &remote.filepath, &remote.file);
+ tablename, &remote.filepath, &remote.file);
remote.success = link_file_found;
if (remote.success) {
validate = true; /* possibility of multiple files. */
@@ -3955,7 +3941,7 @@ fil_load_single_table_tablespace(
/* Check for a link file which locates a remote tablespace. */
remote.success = fil_open_linked_file(
- tablename, def.filepath, &remote.filepath, &remote.file);
+ tablename, &remote.filepath, &remote.file);
/* Read the first page of the remote tablespace */
if (remote.success) {
=== modified file 'storage/innobase/include/fil0fil.h'
--- a/storage/innobase/include/fil0fil.h revid:kevin.lewis@stripped
+++ b/storage/innobase/include/fil0fil.h revid:kevin.lewis@stripped
@@ -576,8 +576,8 @@ UNIV_INTERN
dberr_t
fil_open_single_table_tablespace(
/*=============================*/
- ibool validate, /*!< in: Do we validate tablespace? */
- ibool fix_dict, /*!< in: Can we fix the dictionary? */
+ bool validate, /*!< in: Do we validate tablespace? */
+ bool fix_dict, /*!< in: Can we fix the dictionary? */
ulint id, /*!< in: space id */
ulint flags, /*!< in: tablespace flags */
const char* tablename, /*!< in: table name in the
=== modified file 'storage/innobase/row/row0import.cc'
--- a/storage/innobase/row/row0import.cc revid:kevin.lewis@stripped
+++ b/storage/innobase/row/row0import.cc revid:kevin.lewis@stripped
@@ -3052,7 +3052,7 @@ row_import_for_mysql(
/* Open the tablespace so that we can access via the buffer pool. */
err = fil_open_single_table_tablespace(
- TRUE, TRUE, table->space,
+ true, true, table->space,
dict_tf_to_fsp_flags(table->flags),
table->name, filepath);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (kevin.lewis:3912 to 3913) | kevin.lewis | 31 May |