List:Internals« Previous MessageNext Message »
From:Paul Cadach Date:July 31 2001 5:04pm
Subject:Re: mysqldump inserting into temporary tables
View as plain text  
Hi,

One big problem - ALTER TABLE ... RENAME AS ... works for single table (i.e.
its usage can bring database to unusable state by renaming part of tables
only and halt with some of error).

RENAME TABLE ... TO ... works with many tables, but can't work with
temporary tables... :(

For your situation better to use single RENAME TABLE <table1> TO
<table1>-old, <table1>-new TO <table1>, <table2>... and next drop
<table1>-old, <table2>-old, ... At least this will be safe for database
consistency.


WBR,
Paul.


----- Original Message -----
From: <mysql@stripped>
To: <internals@stripped>
Cc: <andersg@stripped>
Sent: Tuesday, July 31, 2001 4:04 AM
Subject: mysqldump inserting into temporary tables


> Hi,
>
> here is a small patch to mysqldump, i hope this is the right list to
> post it to. I'm not subscribed so please cc me.
>
> --
>
> file://anders/g
>
>
[skip]
> +      if(opt_temp_tables){
> + dynstr_append(&post_commands,"\nDROP TABLE IF EXISTS ");
> + dynstr_append(&post_commands,table_name);
> + dynstr_append(&post_commands,";\nALTER TABLE ");
> + dynstr_append(&post_commands,table_name);
> + dynstr_append(&post_commands,"_new RENAME AS ");
> + dynstr_append(&post_commands,table_name);
> + dynstr_append(&post_commands,";\n\n");
[skip]

Thread
mysqldump inserting into temporary tablesmysql30 Jul
  • Re: mysqldump inserting into temporary tablesSinisa Milivojevic31 Jul
  • Re: mysqldump inserting into temporary tablesPaul Cadach31 Jul