Hi!

>>>>> "Cal" == Cal Evans <[EMAIL PROTECTED]> writes:

Cal> Gotta ask. Is this a problem or just a really bad idea?  Part of me can see
Cal> why this is barfing. ON the same line you rename a table twice.  If it's
Cal> threading these requests then one thread might not be finished with the
Cal> table formally known as table1 before you try and move it again.

Cal> If you absolutely MUST move tables around like this, try 3 different
Cal> statements.

The idea of RENAME is to be able to swap files on the fly, just like
this.  RENAME will create locks on all tables and will not do the
rename until all tables are locked, so this should be quite safe.
(At least with MyISAM tables).

Regards,
Monty

<cut>

mysql> rename tables test1 to test3, test2 to test1, test3 to test2;
Cal> ERROR 1192: Can't execute the given command because you have active locked
Cal> tables or an active transaction

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to