Navigation Menu

Skip to content

Commit

Permalink
Remove needless temporary table detection
Browse files Browse the repository at this point in the history
Temporary table detection doesn't work in embedded mode.
  • Loading branch information
kou committed Aug 7, 2017
1 parent 43fd471 commit 37c2597
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
8 changes: 1 addition & 7 deletions ha_mroonga.cpp
Expand Up @@ -5031,7 +5031,7 @@ int ha_mroonga::delete_table(const char *name)
}

if (!wrap_handlerton) {
bool open_table_to_get_wrap_handlerton = !mapper.is_temporary_table_name();
bool open_table_to_get_wrap_handlerton = true;
if (mapper.is_internal_table_name()) {
open_table_to_get_wrap_handlerton = false;
}
Expand Down Expand Up @@ -5084,12 +5084,6 @@ int ha_mroonga::delete_table(const char *name)
error = operations_->clear(name, strlen(name));
}

if (!error &&
mapper.is_temporary_table_name() &&
!mapper.is_internal_table_name()) {
mrn_db_manager->drop(name);
}

DBUG_RETURN(error);
}

Expand Down
28 changes: 0 additions & 28 deletions lib/mrn_path_mapper.cpp
Expand Up @@ -226,32 +226,4 @@ namespace mrn {
bool PathMapper::is_internal_table_name() {
return mysql_table_name()[0] == '#';
}

bool PathMapper::is_temporary_table_name() {
if (!mysql_data_home_path_) {
return original_mysql_path_[0] != FN_CURLIB;
}

if (original_mysql_path_[0] == FN_CURLIB) {
return false;
}

size_t original_mysql_path_len = strlen(original_mysql_path_);
size_t mysql_data_home_path_len = strlen(mysql_data_home_path_);
if (original_mysql_path_len < mysql_data_home_path_len) {
return true;
}

if (strncmp(original_mysql_path_,
mysql_data_home_path_,
mysql_data_home_path_len) != 0) {
return true;
}

if (strchr(&original_mysql_path_[mysql_data_home_path_len], FN_LIBCHAR)) {
return true;
}

return false;
}
}

0 comments on commit 37c2597

Please sign in to comment.