1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

remove dd_frm_type(), dd_frm_storage_engine(), dd_check_storage_engine_flag()

from everywhere - now RENAME, SHOW FULL TABLES, and TRUNCATE work with discovery.
improve error messages in truncate
This commit is contained in:
Sergei Golubchik
2013-04-09 15:50:30 +02:00
parent 15c936e4b3
commit cdc01e29d3
23 changed files with 213 additions and 243 deletions

View File

@ -33,7 +33,7 @@
#include "sp_head.h"
#include "sp.h"
#include "sp_cache.h"
#include "datadict.h" // dd_frm_type()
#include "datadict.h" // dd_frm_is_view()
#define MD5_BUFF_LENGTH 33
@ -1642,7 +1642,6 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
String non_existant_views;
char *wrong_object_db= NULL, *wrong_object_name= NULL;
bool error= FALSE;
enum legacy_db_type not_used;
bool some_views_deleted= FALSE;
bool something_wrong= FALSE;
DBUG_ENTER("mysql_drop_view");
@ -1665,12 +1664,11 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
for (view= views; view; view= view->next_local)
{
frm_type_enum type= FRMTYPE_ERROR;
bool not_exist;
build_table_filename(path, sizeof(path) - 1,
view->db, view->table_name, reg_ext, 0);
if (access(path, F_OK) ||
FRMTYPE_VIEW != (type= dd_frm_type(thd, path, &not_used)))
if ((not_exist= my_access(path, F_OK)) || !dd_frm_is_view(thd, path))
{
char name[FN_REFLEN];
my_snprintf(name, sizeof(name), "%s.%s", view->db, view->table_name);
@ -1681,7 +1679,13 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
name);
continue;
}
if (type == FRMTYPE_TABLE)
if (not_exist)
{
if (non_existant_views.length())
non_existant_views.append(',');
non_existant_views.append(String(view->table_name,system_charset_info));
}
else
{
if (!wrong_object_name)
{
@ -1689,12 +1693,6 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
wrong_object_name= view->table_name;
}
}
else
{
if (non_existant_views.length())
non_existant_views.append(',');
non_existant_views.append(String(view->table_name,system_charset_info));
}
continue;
}
if (mysql_file_delete(key_file_frm, path, MYF(MY_WME)))