List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 26 1999 8:32pm
Subject:Re: replacing a table by another one
View as plain text  
>>>>> "Pierre" == Pierre Moret <pierre@stripped> writes:

Pierre> Paul DuBois wrote:
>> 
>> [...]
>> Or drop the original table, then use ALTER TABLE to rename the new
>> one to the original name.

Pierre> That was an option too, but in this case, I guess I can't properly lock
Pierre> the table, right?

Pierre> What happens to the locks when I do that?
Pierre>  LOCK TABLES Object WRITE, Object_in WRITE;
Pierre>  DROP TABLE Object;
Pierre>  ALTER TABLE Object_in RENAME Object;
Pierre>  UNLOCK TABLES;

Pierre> What will happen to the clients that are waiting for the locks to be
Pierre> released? Will they then get access to the new table, or could this
Pierre> cause some problem?

Hi!

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.

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