Rename database appears to be implemented as copy/delete, which is very time consuming. I think a warning in the interface about this would be appropriate.
I'd also prefer "RENAME DATABASE" if no sideefects are predictable.
Maybe the user should have the choice (like on the import page CSV/CSV using LOAD DATA)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't see why a user on MySQL 5.1.7+ would not want a RENAME DATABASE. Of course, we'll still manage the pmadb stuff in this case.
I was thinking, instead of adding a message, just display an idea of the statements that are about to be executed. For MySQL 5.1.6- it would be:
Rename database to:
[ ] [Go] (INSERT INTO ... SELECT)
For MySQL 5.1.7+:
Rename database to:
[ ] [Go] (RENAME DATABASE)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am implementing the RENAME DATABASE for PMA 2.11. With MySQL 6.0.0 when the db contains a Falcon table, the rename works but results in a unusable database!
With 6.0.0 and a db containing a VIEW, RENAME DATABASE is refused. I will try with 5.1.20.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=210714
Originator: NO
Yes we should add a warning.
In MySQL 5.1.7, there is a RENAME DATABASE statement:
http://dev.mysql.com/doc/refman/5.1/en/rename-database.html
do you think we should use it whenever possible, given its limitations?
Also, there is a bug with the way we do the rename, when there is a VIEW in this db.
Logged In: YES
user_id=30264
Originator: YES
> do you think we should use it whenever possible,
Yes.
> given its limitations?
Doesn't your copy/delete code share those limitations?
Logged In: YES
user_id=210714
Originator: NO
It shares some limitations but not all (for example, RENAME DATABASE needs ALTER). But this should not be a problem.
Logged In: YES
user_id=1383652
Originator: NO
I'd also prefer "RENAME DATABASE" if no sideefects are predictable.
Maybe the user should have the choice (like on the import page CSV/CSV using LOAD DATA)
Logged In: YES
user_id=210714
Originator: NO
I don't see why a user on MySQL 5.1.7+ would not want a RENAME DATABASE. Of course, we'll still manage the pmadb stuff in this case.
I was thinking, instead of adding a message, just display an idea of the statements that are about to be executed. For MySQL 5.1.6- it would be:
Rename database to:
[ ] [Go] (INSERT INTO ... SELECT)
For MySQL 5.1.7+:
Rename database to:
[ ] [Go] (RENAME DATABASE)
Logged In: YES
user_id=1383652
Originator: NO
Mark,
i missunderstood your first comment (thought there were bugs in mysql)
your last suggestion seams reasonable (to me ;)
Logged In: YES
user_id=210714
Originator: NO
I am implementing the RENAME DATABASE for PMA 2.11. With MySQL 6.0.0 when the db contains a Falcon table, the rename works but results in a unusable database!
With 6.0.0 and a db containing a VIEW, RENAME DATABASE is refused. I will try with 5.1.20.
Logged In: YES
user_id=210714
Originator: NO
Still problem renaming a db containing a VIEW, with 5.1.20.
Confirmed by http://bugs.mysql.com/bug.php?id=21741
So I'll let the warning about INSERT ... SELECT INTO but deactivate the RENAME DATABASE code for now.