summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-07 17:08:49 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-07 17:08:49 +0200
commit58e62d701e9d1c0a5ebb88f8a8779011c59ee735 (patch)
tree33aac572b65ffe713b1cf09bae10903eb1e4f5ab
parent09ece94fac5fc160e11e6bd46208e6c0be86e7e6 (diff)
downloadmariadb-git-58e62d701e9d1c0a5ebb88f8a8779011c59ee735.tar.gz
* move bas_ext from the handler to the handlerton
* provide a default bas_ext value of the empty list
-rw-r--r--sql/ha_partition.cc27
-rw-r--r--sql/ha_partition.h4
-rw-r--r--sql/handler.cc30
-rw-r--r--sql/handler.h6
-rw-r--r--sql/table.cc14
-rw-r--r--storage/archive/ha_archive.cc23
-rw-r--r--storage/archive/ha_archive.h1
-rw-r--r--storage/blackhole/ha_blackhole.cc9
-rw-r--r--storage/blackhole/ha_blackhole.h1
-rw-r--r--storage/cassandra/ha_cassandra.cc10
-rw-r--r--storage/cassandra/ha_cassandra.h5
-rw-r--r--storage/csv/ha_tina.cc43
-rw-r--r--storage/csv/ha_tina.h1
-rw-r--r--storage/example/ha_example.cc49
-rw-r--r--storage/example/ha_example.h5
-rw-r--r--storage/federated/ha_federated.cc15
-rw-r--r--storage/federated/ha_federated.h1
-rw-r--r--storage/federatedx/ha_federatedx.cc16
-rw-r--r--storage/federatedx/ha_federatedx.h1
-rw-r--r--storage/heap/ha_heap.cc10
-rw-r--r--storage/heap/ha_heap.h1
-rw-r--r--storage/maria/ha_maria.cc7
-rw-r--r--storage/maria/ha_maria.h1
-rw-r--r--storage/myisam/ha_myisam.cc7
-rw-r--r--storage/myisam/ha_myisam.h1
-rw-r--r--storage/myisammrg/ha_myisammrg.cc7
-rw-r--r--storage/myisammrg/ha_myisammrg.h1
-rw-r--r--storage/perfschema/ha_perfschema.cc9
-rw-r--r--storage/perfschema/ha_perfschema.h2
-rw-r--r--storage/sphinx/ha_sphinx.cc13
-rw-r--r--storage/sphinx/ha_sphinx.h1
-rw-r--r--storage/xtradb/handler/ha_innodb.cc26
-rw-r--r--storage/xtradb/handler/ha_innodb.h1
33 files changed, 86 insertions, 262 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 5f67a89cb9c..5f7851b8e25 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -78,6 +78,17 @@ static handler *partition_create_handler(handlerton *hton,
static uint partition_flags();
static uint alter_table_flags(uint flags);
+/*
+ If frm_error() is called then we will use this to to find out what file
+ extensions exist for the storage engine. This is also used by the default
+ rename_table and delete_table method in handler.cc.
+*/
+
+static const char *ha_partition_ext[]=
+{
+ ha_par_ext, NullS
+};
+
static int partition_initialize(void *p)
{
@@ -93,6 +104,7 @@ static int partition_initialize(void *p)
partition_hton->flags= HTON_NOT_USER_SELECTABLE |
HTON_HIDDEN |
HTON_TEMPORARY_NOT_SUPPORTED;
+ partition_hton->tablefile_extensions= ha_partition_ext;
return 0;
}
@@ -7311,21 +7323,6 @@ int ha_partition::final_drop_index(TABLE *table_arg)
}
-/*
- If frm_error() is called then we will use this to to find out what file
- extensions exist for the storage engine. This is also used by the default
- rename_table and delete_table method in handler.cc.
-*/
-
-static const char *ha_partition_ext[]=
-{
- ha_par_ext, NullS
-};
-
-const char **ha_partition::bas_ext() const
-{ return ha_partition_ext; }
-
-
uint ha_partition::min_of_the_max_uint(
uint (handler::*operator_func)(void) const) const
{
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 53f0c4f2484..9e1c5b0bf5f 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -883,10 +883,6 @@ public:
*/
virtual uint alter_table_flags(uint flags);
/*
- extensions of table handler files
- */
- virtual const char **bas_ext() const;
- /*
unireg.cc will call the following to make sure that the storage engine
can handle the data it is about to send.
diff --git a/sql/handler.cc b/sql/handler.cc
index 4214e7f9108..56e9ec35ad8 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -443,11 +443,13 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
int ha_initialize_handlerton(st_plugin_int *plugin)
{
handlerton *hton;
+ static const char *no_exts[]= { 0 };
DBUG_ENTER("ha_initialize_handlerton");
DBUG_PRINT("plugin", ("initialize plugin: '%s'", plugin->name.str));
hton= (handlerton *)my_malloc(sizeof(handlerton),
MYF(MY_WME | MY_ZEROFILL));
+ hton->tablefile_extensions= no_exts;
if (hton == NULL)
{
@@ -4719,26 +4721,20 @@ static my_bool exts_handlerton(THD *unused, plugin_ref plugin,
{
List<char> *found_exts= (List<char> *) arg;
handlerton *hton= plugin_data(plugin, handlerton *);
- handler *file;
- if (hton->state == SHOW_OPTION_YES && hton->create &&
- (file= hton->create(hton, (TABLE_SHARE*) 0, current_thd->mem_root)))
- {
- List_iterator_fast<char> it(*found_exts);
- const char **ext, *old_ext;
+ List_iterator_fast<char> it(*found_exts);
+ const char **ext, *old_ext;
- for (ext= file->bas_ext(); *ext; ext++)
+ for (ext= hton->tablefile_extensions; *ext; ext++)
+ {
+ while ((old_ext= it++))
{
- while ((old_ext= it++))
- {
- if (!strcmp(old_ext, *ext))
- break;
- }
- if (!old_ext)
- found_exts->push_back((char *) *ext);
-
- it.rewind();
+ if (!strcmp(old_ext, *ext))
+ break;
}
- delete file;
+ if (!old_ext)
+ found_exts->push_back((char *) *ext);
+
+ it.rewind();
}
return FALSE;
}
diff --git a/sql/handler.h b/sql/handler.h
index f6a10a84646..43c5246c156 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1086,6 +1086,7 @@ struct handlerton
ha_create_table_option *field_options; // these are specified per field
ha_create_table_option *index_options; // these are specified per index
+ const char **tablefile_extensions;
};
@@ -2416,7 +2417,10 @@ public:
element - data file extention. This order is assumed by
prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.
*/
- virtual const char **bas_ext() const =0;
+ const char **bas_ext() const
+ {
+ return ht->tablefile_extensions;
+ }
virtual int get_default_no_partitions(HA_CREATE_INFO *create_info)
{ return 1;}
diff --git a/sql/table.cc b/sql/table.cc
index 8bc0f7b6b12..cdee7405c7e 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2987,23 +2987,15 @@ void open_table_error(TABLE_SHARE *share, int error, int db_errno, int errarg)
break;
case 2:
{
- handler *file= 0;
const char *datext= "";
- if (share->db_type() != NULL)
- {
- if ((file= get_new_handler(share, current_thd->mem_root,
- share->db_type())))
- {
- if (!(datext= *file->bas_ext()))
- datext= "";
- }
- }
+ if (share->db_type() && share->db_type()->tablefile_extensions[0])
+ datext= share->db_type()->tablefile_extensions[0];
+
err_no= (db_errno == ENOENT) ? ER_FILE_NOT_FOUND : (db_errno == EAGAIN) ?
ER_FILE_USED : ER_CANT_OPEN_FILE;
strxmov(buff, share->normalized_path.str, datext, NullS);
my_error(err_no,errortype, buff, db_errno);
- delete file;
break;
}
case 5:
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 5ee7841d9b3..02813ff8dc7 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -199,6 +199,14 @@ static void init_archive_psi_keys(void)
TRUE Error
*/
+/*
+ We just implement one additional file extension.
+*/
+static const char *ha_archive_exts[] = {
+ ARZ,
+ NullS
+};
+
int archive_db_init(void *p)
{
DBUG_ENTER("archive_db_init");
@@ -214,6 +222,7 @@ int archive_db_init(void *p)
archive_hton->create= archive_create_handler;
archive_hton->flags= HTON_NO_FLAGS;
archive_hton->discover= archive_discover;
+ archive_hton->tablefile_extensions= ha_archive_exts;
if (mysql_mutex_init(az_key_mutex_archive_mutex,
&archive_mutex, MY_MUTEX_INIT_FAST))
@@ -530,20 +539,6 @@ int ha_archive::init_archive_reader()
}
-/*
- We just implement one additional file extension.
-*/
-static const char *ha_archive_exts[] = {
- ARZ,
- NullS
-};
-
-const char **ha_archive::bas_ext() const
-{
- return ha_archive_exts;
-}
-
-
/*
When opening a file we:
Create/get our shared structure.
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h
index 627267c7306..25e520f56dd 100644
--- a/storage/archive/ha_archive.h
+++ b/storage/archive/ha_archive.h
@@ -83,7 +83,6 @@ public:
{
}
const char *index_type(uint inx) { return "NONE"; }
- const char **bas_ext() const;
ulonglong table_flags() const
{
return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_CAN_BIT_FIELD |
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 812623314bf..91a2c70cb9f 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -52,15 +52,6 @@ ha_blackhole::ha_blackhole(handlerton *hton,
{}
-static const char *ha_blackhole_exts[] = {
- NullS
-};
-
-const char **ha_blackhole::bas_ext() const
-{
- return ha_blackhole_exts;
-}
-
int ha_blackhole::open(const char *name, int mode, uint test_if_locked)
{
DBUG_ENTER("ha_blackhole::open");
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index 51857f3bb2a..b70320848d7 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -51,7 +51,6 @@ public:
don't implement this method unless you really have indexes
*/
const char *index_type(uint key_number);
- const char **bas_ext() const;
ulonglong table_flags() const
{
return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc
index 3934f288085..968d23c94b5 100644
--- a/storage/cassandra/ha_cassandra.cc
+++ b/storage/cassandra/ha_cassandra.cc
@@ -369,16 +369,6 @@ ha_cassandra::ha_cassandra(handlerton *hton, TABLE_SHARE *table_arg)
{}
-static const char *ha_cassandra_exts[] = {
- NullS
-};
-
-const char **ha_cassandra::bas_ext() const
-{
- return ha_cassandra_exts;
-}
-
-
int ha_cassandra::connect_and_check_options(TABLE *table_arg)
{
ha_table_option_struct *options= table_arg->s->option_struct;
diff --git a/storage/cassandra/ha_cassandra.h b/storage/cassandra/ha_cassandra.h
index a57a754979c..3fd9d542885 100644
--- a/storage/cassandra/ha_cassandra.h
+++ b/storage/cassandra/ha_cassandra.h
@@ -132,11 +132,6 @@ public:
const char *index_type(uint inx) { return "HASH"; }
/** @brief
- The file extensions.
- */
- const char **bas_ext() const;
-
- /** @brief
This is a list of flags that indicate what functionality the storage engine
implements. The current table flags are documented in handler.h
*/
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 50e639881c5..ab2e2c118f8 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -144,6 +144,16 @@ static void init_tina_psi_keys(void)
}
#endif /* HAVE_PSI_INTERFACE */
+/*
+ If frm_error() is called in table.cc this is called to find out what file
+ extensions exist for this handler.
+*/
+static const char *ha_tina_exts[] = {
+ CSV_EXT,
+ CSM_EXT,
+ NullS
+};
+
static int tina_init_func(void *p)
{
handlerton *tina_hton;
@@ -161,6 +171,7 @@ static int tina_init_func(void *p)
tina_hton->create= tina_create_handler;
tina_hton->flags= (HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES |
HTON_NO_PARTITION);
+ tina_hton->tablefile_extensions= ha_tina_exts;
return 0;
}
@@ -833,21 +844,6 @@ err:
}
/*
- If frm_error() is called in table.cc this is called to find out what file
- extensions exist for this handler.
-*/
-static const char *ha_tina_exts[] = {
- CSV_EXT,
- CSM_EXT,
- NullS
-};
-
-const char **ha_tina::bas_ext() const
-{
- return ha_tina_exts;
-}
-
-/*
Three functions below are needed to enable concurrent insert functionality
for CSV engine. For more details see mysys/thr_lock.c
*/
@@ -1771,23 +1767,6 @@ bool ha_tina::check_if_incompatible_data(HA_CREATE_INFO *info,
struct st_mysql_storage_engine csv_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
-mysql_declare_plugin(csv)
-{
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &csv_storage_engine,
- "CSV",
- "Brian Aker, MySQL AB",
- "CSV storage engine",
- PLUGIN_LICENSE_GPL,
- tina_init_func, /* Plugin Init */
- tina_done_func, /* Plugin Deinit */
- 0x0100 /* 1.0 */,
- NULL, /* status variables */
- NULL, /* system variables */
- NULL, /* config options */
- 0, /* flags */
-}
-mysql_declare_plugin_end;
maria_declare_plugin(csv)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index 26404b3a9e7..ebf62fbed65 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -103,7 +103,6 @@ public:
free_root(&blobroot, MYF(0));
}
const char *index_type(uint inx) { return "NONE"; }
- const char **bas_ext() const;
ulonglong table_flags() const
{
return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT |
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 81f6cbe707f..dac1ff81c10 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -229,6 +229,27 @@ static void init_example_psi_keys()
#endif
+/**
+ @brief
+ If frm_error() is called then we will use this to determine
+ the file extensions that exist for the storage engine. This is also
+ used by the default rename_table and delete_table method in
+ handler.cc and by the default discover_many method.
+
+ For engines that have two file name extentions (separate meta/index file
+ and data file), the order of elements is relevant. First element of engine
+ file name extentions array should be meta/index file extention. Second
+ element - data file extention. This order is assumed by
+ prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.
+
+ @see
+ rename_table method in handler.cc and
+ delete_table method in handler.cc
+*/
+
+static const char *ha_example_exts[] = {
+ NullS
+};
static int example_init_func(void *p)
{
DBUG_ENTER("example_init_func");
@@ -247,6 +268,7 @@ static int example_init_func(void *p)
example_hton->flags= HTON_CAN_RECREATE;
example_hton->table_options= example_table_option_list;
example_hton->field_options= example_field_option_list;
+ example_hton->tablefile_extensions= ha_example_exts;
DBUG_RETURN(0);
}
@@ -355,33 +377,6 @@ ha_example::ha_example(handlerton *hton, TABLE_SHARE *table_arg)
/**
@brief
- If frm_error() is called then we will use this to determine
- the file extensions that exist for the storage engine. This is also
- used by the default rename_table and delete_table method in
- handler.cc.
-
- For engines that have two file name extentions (separate meta/index file
- and data file), the order of elements is relevant. First element of engine
- file name extentions array should be meta/index file extention. Second
- element - data file extention. This order is assumed by
- prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.
-
- @see
- rename_table method in handler.cc and
- delete_table method in handler.cc
-*/
-
-static const char *ha_example_exts[] = {
- NullS
-};
-
-const char **ha_example::bas_ext() const
-{
- return ha_example_exts;
-}
-
-/**
- @brief
Used for opening tables. The name will be the name of the file.
@details
diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h
index 9be370edfe3..d3d31893781 100644
--- a/storage/example/ha_example.h
+++ b/storage/example/ha_example.h
@@ -73,11 +73,6 @@ public:
const char *index_type(uint inx) { return "HASH"; }
/** @brief
- The file extensions.
- */
- const char **bas_ext() const;
-
- /** @brief
This is a list of flags that indicate what functionality the storage engine
implements. The current table flags are documented in handler.h
*/
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index b554c344f62..872eecff9cd 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1615,21 +1615,6 @@ ha_rows ha_federated::records_in_range(uint inx, key_range *start_key,
DBUG_ENTER("ha_federated::records_in_range");
DBUG_RETURN(FEDERATED_RECORDS_IN_RANGE);
}
-/*
- If frm_error() is called then we will use this to to find out
- what file extentions exist for the storage engine. This is
- also used by the default rename_table and delete_table method
- in handler.cc.
-*/
-
-const char **ha_federated::bas_ext() const
-{
- static const char *ext[]=
- {
- NullS
- };
- return ext;
-}
/*
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index fc2c4740cc0..31f33f5f789 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -134,7 +134,6 @@ public:
*/
// perhaps get index type
const char *index_type(uint inx) { return "REMOTE"; }
- const char **bas_ext() const;
/*
This is a list of flags that says what the storage engine
implements. The current table flags are documented in
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index e1c2a38964a..1d298cf283d 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -1719,22 +1719,6 @@ ha_rows ha_federatedx::records_in_range(uint inx, key_range *start_key,
DBUG_ENTER("ha_federatedx::records_in_range");
DBUG_RETURN(FEDERATEDX_RECORDS_IN_RANGE);
}
-/*
- If frm_error() is called then we will use this to to find out
- what file extentions exist for the storage engine. This is
- also used by the default rename_table and delete_table method
- in handler.cc.
-*/
-
-const char **ha_federatedx::bas_ext() const
-{
- static const char *ext[]=
- {
- NullS
- };
- return ext;
-}
-
federatedx_txn *ha_federatedx::get_txn(THD *thd, bool no_create)
{
diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h
index dcbbe534262..66eb4061ec3 100644
--- a/storage/federatedx/ha_federatedx.h
+++ b/storage/federatedx/ha_federatedx.h
@@ -317,7 +317,6 @@ public:
*/
// perhaps get index type
const char *index_type(uint inx) { return "REMOTE"; }
- const char **bas_ext() const;
/*
This is a list of flags that says what the storage engine
implements. The current table flags are documented in
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 8e63799680b..916abaa60ea 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -75,16 +75,6 @@ ha_heap::ha_heap(handlerton *hton, TABLE_SHARE *table_arg)
internal_table(0)
{}
-
-static const char *ha_heap_exts[] = {
- NullS
-};
-
-const char **ha_heap::bas_ext() const
-{
- return ha_heap_exts;
-}
-
/*
Hash index statistics is updated (copied from HP_KEYDEF::hash_buckets to
rec_per_key) after 1/HEAP_STATS_UPDATE_THRESHOLD fraction of table records
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index 30ad06e2c06..74824b66c42 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -45,7 +45,6 @@ public:
}
/* Rows also use a fixed-size format */
enum row_type get_row_type() const { return ROW_TYPE_FIXED; }
- const char **bas_ext() const;
ulonglong table_flags() const
{
return (HA_FAST_KEY_READ | HA_NO_BLOBS | HA_NULL_IN_KEY |
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 6264a342d7a..6ea1dccc40b 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -996,12 +996,6 @@ static const char *ha_maria_exts[]=
};
-const char **ha_maria::bas_ext() const
-{
- return ha_maria_exts;
-}
-
-
const char *ha_maria::index_type(uint key_number)
{
return ((table->key_info[key_number].flags & HA_FULLTEXT) ?
@@ -3487,6 +3481,7 @@ static int ha_maria_init(void *p)
maria_hton->db_type= DB_TYPE_UNKNOWN;
maria_hton->create= maria_create_handler;
maria_hton->panic= maria_hton_panic;
+ maria_hton->tablefile_extensions= ha_maria_exts;
maria_hton->commit= maria_commit;
maria_hton->rollback= maria_rollback;
maria_hton->checkpoint_state= maria_checkpoint_state;
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index 6240895ee97..9dcac73158b 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -59,7 +59,6 @@ public:
~ha_maria() {}
handler *clone(const char *name, MEM_ROOT *mem_root);
const char *index_type(uint key_number);
- const char **bas_ext() const;
ulonglong table_flags() const
{ return int_table_flags; }
ulong index_flags(uint inx, uint part, bool all_parts) const;
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index c0221989891..e5fed8731dd 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -677,12 +677,6 @@ static const char *ha_myisam_exts[] = {
NullS
};
-const char **ha_myisam::bas_ext() const
-{
- return ha_myisam_exts;
-}
-
-
const char *ha_myisam::index_type(uint key_number)
{
return ((table->key_info[key_number].flags & HA_FULLTEXT) ?
@@ -2209,6 +2203,7 @@ static int myisam_init(void *p)
myisam_hton->create= myisam_create_handler;
myisam_hton->panic= myisam_panic;
myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;
+ myisam_hton->tablefile_extensions= ha_myisam_exts;
mi_killed= mi_killed_in_mariadb;
return 0;
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 11871479342..5589bd3e1e1 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -54,7 +54,6 @@ class ha_myisam: public handler
~ha_myisam() {}
handler *clone(const char *name, MEM_ROOT *mem_root);
const char *index_type(uint key_number);
- const char **bas_ext() const;
ulonglong table_flags() const { return int_table_flags; }
int index_init(uint idx, bool sorted);
int index_end();
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 8cb74c5df44..5d9b5b5808b 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -171,12 +171,6 @@ extern "C" void myrg_print_wrong_table(const char *table_name)
}
-const char **ha_myisammrg::bas_ext() const
-{
- return ha_myisammrg_exts;
-}
-
-
const char *ha_myisammrg::index_type(uint key_number)
{
return ((table->key_info[key_number].flags & HA_FULLTEXT) ?
@@ -1724,6 +1718,7 @@ static int myisammrg_init(void *p)
myisammrg_hton->create= myisammrg_create_handler;
myisammrg_hton->panic= myisammrg_panic;
myisammrg_hton->flags= HTON_NO_PARTITION;
+ myisammrg_hton->tablefile_extensions= ha_myisammrg_exts;
return 0;
}
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index 8007e7d04e8..455819c5526 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -82,7 +82,6 @@ public:
ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg);
~ha_myisammrg();
- const char **bas_ext() const;
const char *index_type(uint key_number);
ulonglong table_flags() const
{
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 0fb86cfe5cd..4bb90bcf652 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -196,15 +196,6 @@ ha_perfschema::ha_perfschema(handlerton *hton, TABLE_SHARE *share)
ha_perfschema::~ha_perfschema()
{}
-static const char *ha_pfs_exts[]= {
- NullS
-};
-
-const char **ha_perfschema::bas_ext() const
-{
- return ha_pfs_exts;
-}
-
int ha_perfschema::open(const char *name, int mode, uint test_if_locked)
{
DBUG_ENTER("ha_perfschema::open");
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index 35670339599..a21a3d13a16 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -44,8 +44,6 @@ public:
const char *index_type(uint) { return ""; }
- const char **bas_ext(void) const;
-
/** Capabilities of the performance schema tables. */
ulonglong table_flags(void) const
{
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 3305875c124..afb6cea0a40 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -2005,9 +2005,6 @@ int CSphSEQuery::BuildRequest ( char ** ppBuffer )
// SPHINX HANDLER
//////////////////////////////////////////////////////////////////////////////
-static const char * ha_sphinx_exts[] = { NullS };
-
-
#if MYSQL_VERSION_ID<50100
ha_sphinx::ha_sphinx ( TABLE_ARG * table )
: handler ( &sphinx_hton, table )
@@ -2047,16 +2044,6 @@ ha_sphinx::~ha_sphinx()
}
}
-
-// If frm_error() is called then we will use this to to find out what file extentions
-// exist for the storage engine. This is also used by the default rename_table and
-// delete_table method in handler.cc.
-const char ** ha_sphinx::bas_ext() const
-{
- return ha_sphinx_exts;
-}
-
-
// Used for opening tables. The name will be the name of the file.
// A table is opened when it needs to be opened. For instance
// when a request comes in for a select on the table (tables are not
diff --git a/storage/sphinx/ha_sphinx.h b/storage/sphinx/ha_sphinx.h
index f2aa726791b..f650e1641da 100644
--- a/storage/sphinx/ha_sphinx.h
+++ b/storage/sphinx/ha_sphinx.h
@@ -57,7 +57,6 @@ public:
const char * table_type () const { return "SPHINX"; } ///< SE name for display purposes
const char * index_type ( uint ) { return "HASH"; } ///< index type name for display purposes
- const char ** bas_ext () const; ///< my file extensions
#if MYSQL_VERSION_ID>50100
ulonglong table_flags () const { return HA_CAN_INDEX_BLOBS |
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index dde5b8fd965..5ba58fe439b 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -2560,6 +2560,13 @@ skip_overwrite:
}
+/****************************************************************//**
+Gives the file extension of an InnoDB single-table tablespace. */
+static const char* ha_innobase_exts[] = {
+ ".ibd",
+ NullS
+};
+
/*********************************************************************//**
Opens an InnoDB database.
@return 0 on success, error code on failure */
@@ -2608,6 +2615,7 @@ innobase_init(
innobase_hton->release_temporary_latches=innobase_release_temporary_latches;
innobase_hton->alter_table_flags = innobase_alter_table_flags;
innobase_hton->kill_query = innobase_kill_query;
+ innobase_hton->tablefile_extensions = ha_innobase_exts;
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
@@ -4033,13 +4041,6 @@ ha_innobase::table_flags() const
}
/****************************************************************//**
-Gives the file extension of an InnoDB single-table tablespace. */
-static const char* ha_innobase_exts[] = {
- ".ibd",
- NullS
-};
-
-/****************************************************************//**
Returns the index type. */
UNIV_INTERN
const char*
@@ -4052,17 +4053,6 @@ ha_innobase::index_type(
}
/****************************************************************//**
-Returns the table file name extension.
-@return file extension string */
-UNIV_INTERN
-const char**
-ha_innobase::bas_ext() const
-/*========================*/
-{
- return(ha_innobase_exts);
-}
-
-/****************************************************************//**
Returns the operations supported for indexes.
@return flags of supported operations */
UNIV_INTERN
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index 607f9ecfb36..439be10fddb 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -125,7 +125,6 @@ class ha_innobase: public handler
enum row_type get_row_type() const;
const char* index_type(uint key_number);
- const char** bas_ext() const;
Table_flags table_flags() const;
ulong index_flags(uint idx, uint part, bool all_parts) const;
uint max_supported_keys() const;