summaryrefslogtreecommitdiff
path: root/sql/handler.cc
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 /sql/handler.cc
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
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc30
1 files changed, 13 insertions, 17 deletions
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;
}