diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-01-10 14:30:11 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-01-10 14:30:11 +0200 |
commit | 5044dae239d094582879792de7a762d3428223ce (patch) | |
tree | de7baaf095317ab19949f4e7fa205cf9dce44ab8 /sql/sql_table.cc | |
parent | 4b05d60e62ef6e21d5329a9667813df890034ff0 (diff) | |
parent | 78e6fafcaa93bdd2cf793a82a812137eb7a779a7 (diff) | |
download | mariadb-git-5044dae239d094582879792de7a762d3428223ce.tar.gz |
Merge 10.0 into 10.1
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index aaf423b7290..836e2bda70c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2473,7 +2473,19 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, int frm_delete_error, trigger_drop_error= 0; /* Delete the table definition file */ strmov(end,reg_ext); - frm_delete_error= mysql_file_delete(key_file_frm, path, MYF(MY_WME)); + if (table_type && table_type != view_pseudo_hton && + table_type->discover_table) + { + /* + Table type is using discovery and may not need a .frm file. + Delete it silently if it exists + */ + (void) mysql_file_delete(key_file_frm, path, MYF(0)); + frm_delete_error= 0; + } + else + frm_delete_error= mysql_file_delete(key_file_frm, path, + MYF(MY_WME)); if (frm_delete_error) frm_delete_error= my_errno; else @@ -2489,7 +2501,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, else if (frm_delete_error && if_exists) thd->clear_error(); } - non_tmp_error= error ? TRUE : non_tmp_error; + non_tmp_error|= MY_TEST(error); } if (error) { @@ -5932,7 +5944,7 @@ drop_create_field: while ((f_key= fk_key_it++)) { if (my_strcasecmp(system_charset_info, f_key->foreign_id->str, - key->name.str) == 0) + keyname) == 0) goto remove_key; } } |