On Wed, Nov 25, 2009 at 17:42, Jay Pipes <[email protected]> wrote:
> Brian Aker wrote:
>>
>> Hi!
>>
>> I was just about to guy RENAME TABLE and then realized that it has one
>> difference with ALTER TABLE... it doesn't do TEMPORARY TABLES.
>> So if I change it, it now does temporary tables... which makes me
>> wonder...
>>
>> Can this just go away? If someone really wants this they can write an
>> alias in the client for it.
>
> As a number of folks have already mentioned, the perceived[1] ability to do
> atomic renames *of multiple tables in a single statement* is the main
> benefit of RENAME TABLE, and this is a nice feature.
>
> So, I would say, keep it.
>
> Cheers,
>
> Jay
>
> [1] I'm still questioning whether this behaviour (of renaming multiple
> tables) is actually atomic after looking through the code.  What the code
> ensures is that if one of the tables is not renamed properly, all the tables
> will have their original names restored.  However, because there is no
> transactional state to this SQL statement, if the power cuts out halfway
> through the operation to rename a list of tables, I see nothing in the code
> which would recover the original table names on a restart of the server. So,
> it's kind of a "phony" atomicity since it is not guaranteed to be consistent
> or durable.

Yeah, you're right. This is probably because if a solution for actual
transactional-table-renaming existed, it'd likely just be used for all
other DDL statements, since it'd involve something like the
write-ahead log. Transactional DDL statements exist in a number of
other relational RDBMS (e.x., Postgre, SQL Server, Oracle, Sybase).

The implicit commits in MySQL are very ugly, so if we're addressing
the RENAME TABLE issue, I think this deserves discussion.

-- 
Darius Jahandarie

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to