Menu

#2474 (ok 2.11) Warn about rename database being copy/delete

fixed
None
1
2013-06-11
2007-07-17
No

Hi,

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.

Discussion

  • Marc Delisle

    Marc Delisle - 2007-07-17

    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.

     
  • Marc Delisle

    Marc Delisle - 2007-07-17
    • assigned_to: nobody --> lem9
     
  • Olaf van der Spek

    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?

     
  • Marc Delisle

    Marc Delisle - 2007-07-17

    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.

     
  • Jürgen Wind

    Jürgen Wind - 2007-07-17

    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)

     
  • Marc Delisle

    Marc Delisle - 2007-07-17

    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)

     
  • Jürgen Wind

    Jürgen Wind - 2007-07-18

    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 ;)

     
  • Marc Delisle

    Marc Delisle - 2007-07-18

    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.

     
  • Marc Delisle

    Marc Delisle - 2007-07-18

    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.

     
  • Marc Delisle

    Marc Delisle - 2007-07-19
    • priority: 5 --> 1
    • summary: Warn about rename database actually being copy/delete --> (ok 2.11) Warn about rename database being copy/delete
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-08-21
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed