From: Date: June 21 2007 11:42am Subject: Re: CREATE INDEX is not committed? List-Archive: http://lists.mysql.com/internals/34764 Message-Id: <20070621094217.GB3549@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Monty, On Thu, Jun 21, 2007 at 12:53:51AM +0300, Michael Widenius wrote: > Marko> Another thing: mysql_alter_table() is trying to drop a temporary table > Marko> it did not create: > > Marko> err1: > Marko> if (new_table) > Marko> { > Marko> /* close_temporary_table() frees the new_table pointer. */ > Marko> close_temporary_table(thd, new_table, 1, 1); > Marko> } > Marko> else > Marko> VOID(quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP)); > > Marko> I believe that the else branch should be removed altogether, because > Marko> new_table==NULL should mean that handler::add_index() was called and > Marko> no temporary table was created. > > The above branch is also taken if we created a temporary table but was > not able to open it. In this case we have to remove it. Okay, I didn't analyze this thoroughly, but our modified InnoDB (which implements ha_innobase::add_index()) is complaining that MySQL is deleting a non-existing table. I didn't check if MySQL asked InnoDB to create that table, but I strongly doubt it. I will look at this after my vacation, sometime in August. Marko