Hi Sergei, On Mon, Jun 15, 2015 at 04:01:55PM +0200, Sergei Golubchik wrote:
Hi, Sergey!
On Jun 15, svoj@mariadb.org wrote:
revision-id: 8456b231e9079be26c77da2a294ea1dac64d9d76 parent(s): aad8667f8a4e2a26652494b29ee6c12824865ac8 committer: Sergey Vojtovich branch nick: mariadb timestamp: 2015-06-15 15:49:00 +0400 message:
MDEV-5309 - RENAME TABLE does not check for existence of the table's engine
When RENAME TABLE is executed, it apparently does not check whether the engine is available (unlike ALTER TABLE .. RENAME, which does). It means that if the engine in question was not loaded on some reason, the table might become unusable, since the engine won't know about the change.
With this patch RENAME TABLE fails if storage engine is not available.
Ok to push.
I'm not completely happy with the "table does not exist" error in this case, but I suspect that doing something reasonable might be not very easy. And it's a corner case anyway. I'm not happy about it either. A proper error is probably "Plugin '<name>' is not loaded". This '<name>' is known in ha_table_exists()/dd_frm_type(). Passing it back to mysql_rename_table() doesn't look cosher indeed.
Regards, Sergey