Skip to content

Commit

Permalink
Remove an unnecessary global declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Mar 29, 2018
1 parent d177a0e commit 60ef478
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 38 deletions.
52 changes: 23 additions & 29 deletions storage/innobase/dict/dict0mem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ static const char* innobase_system_databases[] = {
NullS
};

/** Determine if a table belongs to innobase_system_databases[]
@param[in] name database_name/table_name
@return whether the database_name is in innobase_system_databases[] */
static bool dict_mem_table_is_system(const char *name)
{
/* table has the following format: database/table
and some system table are of the form SYS_* */
if (!strchr(name, '/')) {
return true;
}
size_t table_len = strlen(name);
const char *system_db;
int i = 0;
while ((system_db = innobase_system_databases[i++])
&& (system_db != NullS)) {
size_t len = strlen(system_db);
if (table_len > len && !strncmp(name, system_db, len)) {
return true;
}
}
return false;
}

/** The start of the table basename suffix for partitioned tables */
const char table_name_t::part_suffix[4]
#ifdef _WIN32
Expand Down Expand Up @@ -1167,35 +1190,6 @@ operator<< (std::ostream& out, const dict_foreign_set& fk_set)
return(out);
}

/****************************************************************//**
Determines if a table belongs to a system database
@return */
bool
dict_mem_table_is_system(
/*================*/
char *name) /*!< in: table name */
{
ut_ad(name);

/* table has the following format: database/table
and some system table are of the form SYS_* */
if (strchr(name, '/')) {
size_t table_len = strlen(name);
const char *system_db;
int i = 0;
while ((system_db = innobase_system_databases[i++])
&& (system_db != NullS)) {
size_t len = strlen(system_db);
if (table_len > len && !strncmp(name, system_db, len)) {
return true;
}
}
return false;
} else {
return true;
}
}

/** Adjust clustered index metadata for instant ADD COLUMN.
@param[in] clustered index definition after instant ADD COLUMN */
inline void dict_index_t::instant_add_field(const dict_index_t& instant)
Expand Down
9 changes: 0 additions & 9 deletions storage/innobase/include/dict0mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Created 1/8/1996 Heikki Tuuri
#include "os0once.h"
#include "ut0new.h"
#include "fil0fil.h"
#include <my_crypt.h>
#include "fil0crypt.h"
#include <set>
#include <algorithm>
Expand Down Expand Up @@ -315,14 +314,6 @@ dict_mem_table_create(
ulint n_v_cols, /*!< in: number of virtual columns */
ulint flags, /*!< in: table flags */
ulint flags2); /*!< in: table flags2 */
/**********************************************************************//**
Determines if a table belongs to a system database
@return */
UNIV_INTERN
bool
dict_mem_table_is_system(
/*==================*/
char *name); /*!< in: table name */
/****************************************************************//**
Free a table memory object. */
void
Expand Down

0 comments on commit 60ef478

Please sign in to comment.