summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index fb5d1699419..e07d656c986 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3385,6 +3385,8 @@ void handler::print_error(int error, myf errflag)
textno=ER_FILE_USED;
break;
case ENOENT:
+ case ENOTDIR:
+ case ELOOP:
textno=ER_FILE_NOT_FOUND;
break;
case ENOSPC:
@@ -3862,7 +3864,6 @@ int handler::delete_table(const char *name)
int saved_error= 0;
int error= 0;
int enoent_or_zero;
- char buff[FN_REFLEN];
if (ht->discover_table)
enoent_or_zero= 0; // the table may not exist in the engine, it's ok
@@ -3871,8 +3872,7 @@ int handler::delete_table(const char *name)
for (const char **ext=bas_ext(); *ext ; ext++)
{
- fn_format(buff, name, "", *ext, MY_UNPACK_FILENAME|MY_APPEND_EXT);
- if (mysql_file_delete_with_symlink(key_file_misc, buff, MYF(0)))
+ if (mysql_file_delete_with_symlink(key_file_misc, name, *ext, 0))
{
if (my_errno != ENOENT)
{
@@ -4229,7 +4229,7 @@ enum_alter_inplace_result
handler::check_if_supported_inplace_alter(TABLE *altered_table,
Alter_inplace_info *ha_alter_info)
{
- DBUG_ENTER("check_if_supported_alter");
+ DBUG_ENTER("handler::check_if_supported_inplace_alter");
HA_CREATE_INFO *create_info= ha_alter_info->create_info;
@@ -5056,14 +5056,16 @@ bool ha_table_exists(THD *thd, const char *db, const char *table_name,
bool exists= true;
if (hton)
{
- enum legacy_db_type db_type;
- if (dd_frm_type(thd, path, &db_type) != FRMTYPE_VIEW)
+ char engine_buf[NAME_CHAR_LEN + 1];
+ LEX_STRING engine= { engine_buf, 0 };
+
+ if (dd_frm_type(thd, path, &engine) != FRMTYPE_VIEW)
{
- handlerton *ht= ha_resolve_by_legacy_type(thd, db_type);
- if ((*hton= ht))
+ plugin_ref p= plugin_lock_by_name(thd, &engine, MYSQL_STORAGE_ENGINE_PLUGIN);
+ *hton= p ? plugin_hton(p) : NULL;
+ if (*hton)
// verify that the table really exists
- exists= discover_existence(thd,
- plugin_int_to_ref(hton2plugin[ht->slot]), &args);
+ exists= discover_existence(thd, p, &args);
}
else
*hton= view_pseudo_hton;