List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 26 1999 10:39pm
Subject:Re: replacing a table by another one
View as plain text  
>>>>> "James" == James Manning <jmm@stripped> writes:

James> [ Sunday, September 26, 1999 ] Michael Widenius wrote:
>> In the above cases there will be a short instant when the client may
>> get an error message that the table Object is missing.
>> 
>> On the other hand, the above is MUCH faster than your original code.

James> So is there any method, either via LOCK's or some other server mechanism,
James> to block incoming queries before assignment to specific tables (if
James> that ever happens) so the switch-over could happen and avoid the "gap
James> of death" that straight renaming induces?

James> I guess doing the rename's in a transaction (when that support comes
James> down the pipe) is the "obvious solution", right?

Note that transaction systems normally doesn't support CREATE TABLE,
DROP TABLE or RENAME,

I have thought about introducing a atomic command like the following:

RENAME TABLE table1 as tmp, table2 as table1, ....

The problem is that the above is very simple to do in Unix, but a pain 
to get it to work reliably on Windows :(

We will however look at this in the relatively near future.

Regards,
Monty
Thread
replacing a table by another onePierre Moret26 Sep
  • Re: replacing a table by another onePaul DuBois26 Sep
    • Re: replacing a table by another onePierre Moret26 Sep
      • Re: replacing a table by another oneMichael Widenius26 Sep
        • Re: replacing a table by another oneJames Manning26 Sep
          • Re: replacing a table by another oneMichael Widenius27 Sep
    • Re: replacing a table by another onePierre Moret26 Sep
  • Re: replacing a table by another oneRalph Graulich26 Sep