diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-07-13 16:54:47 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-07-19 11:35:38 +0200 |
commit | bd5cf02bbe7bce029b0275be1b15d2108806d5e9 (patch) | |
tree | c6b6cc0188a12995faa32d1b8cdb644c6fbadca2 /sql/sql_table.cc | |
parent | 0b3e28a4cd3f8000eedb8ba190c0ea461544651a (diff) | |
download | mariadb-git-bd5cf02bbe7bce029b0275be1b15d2108806d5e9.tar.gz |
MDEV-11741 handler::ha_reset(): Assertion `bitmap_is_set_all(&table->s->all_set)' failed or server crash in mi_reset or buffer overrun or unexpected ER_CANT_REMOVE_ALL_FIELDS
MEMORY table could be renamed into a non-extistent database.
rename() is documented to return ENOENT when the source file does not
exist OR when the target directory not exist. Nonexistent source .frm
file is ok (table can still exist in the engine), nonexistent target
directory is not.
Make my_rename to use ENOTDIR for the latter case. Make RENAME TABLE
issue an appropriate error ("unknown database" instead of "unknown table")
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ee02b5fc7aa..9a2b4901d4e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5257,6 +5257,8 @@ mysql_rename_table(handlerton *base, const char *old_db, delete file; if (error == HA_ERR_WRONG_COMMAND) my_error(ER_NOT_SUPPORTED_YET, MYF(0), "ALTER TABLE"); + else if (error == ENOTDIR) + my_error(ER_BAD_DB_ERROR, MYF(0), new_db); else if (error) my_error(ER_ERROR_ON_RENAME, MYF(0), from, to, error); else if (!(flags & FN_IS_TMP)) |