Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4418 (ok 4.2.2) When copying databases, primary key attributes get lost

4.2.1
fixed
Marc Delisle
None
1
2014-05-20
2014-05-16
No

When copying a database using Operations > Copy database to: the primary key info on the target tables gets lost. In other words, no primary key exists in the new tables anymore and the auto increment property is not set anymore. The previously primary key column now just contains the values from the source table.

Discussion

  • Michael
    Michael
    2014-05-18

    Priority should be 1+. This bug was the reason to downgrade phpMyAdmin on my system for the first time.

    The question at this point is also: don't you have test cases for new phpMyAdmin versions for critical DB operations?

     
  • Marc Delisle
    Marc Delisle
    2014-05-18

    • assigned_to: Marc Delisle
     
  • Marc Delisle
    Marc Delisle
    2014-05-18

    • summary: When copying databases, primary key attributes get lost --> (ok 4.2.2) When copying databases, primary key attributes get lost
    • Priority: 3 --> 1
     
  • Marc Delisle
    Marc Delisle
    2014-05-18

    @Michael: we need more tests cases (and testers). In particular, we need more testers for alpha, beta and release candidates.

     
  • Marc Delisle
    Marc Delisle
    2014-05-18

    @Patrick and @Michael: please confirm this fix before the 4.2.2 release.

     
  • Michael
    Michael
    2014-05-19

    I just tested with 4.3.0-dev. It is still buggy, but now with SQL errors. My testcase was a database with several tables that have auto-increments.

    When I tried to copy that database, it crashed when creating the second table. The two tables were mixed in one statement. At the end, the first table was correct and the second table was created without auto_increment.

    ALTER TABLE database_new.table_2_with_auto_increment.table_1_with_auto_increment MODIFY id1 tinyint( 3 ) unsigned NOT NULL AUTO_INCREMENT , AUTO_INCREMENT=18;
    ALTER TABLE table_2_with_auto_increment MODIFY id2 int( 10 ) unsigned NOT NULL AUTO_INCREMENT ;

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.table_1_with_auto_increment MODIFY id1 tinyint( 3 ) unsigned NOT NULL AUTO_INC' at line 1

     
  • Marc Delisle
    Marc Delisle
    2014-05-19

    • summary: (ok 4.2.2) When copying databases, primary key attributes get lost --> When copying databases, primary key attributes get lost
    • Priority: 1 --> 5
     
  • Marc Delisle
    Marc Delisle
    2014-05-19

    Thanks Michael for testing, I'll continue my debugging.

     
  • Michael
    Michael
    2014-05-20

    Hi Marc,

    I did test again with different tables and key combinations incl. auto-increments. I can confirm that everything works fine now and the copied databases are cloned correctly. Thanks for your Patch.

    Best wishes
    Michael

     
  • Marc Delisle
    Marc Delisle
    2014-05-20

    • summary: When copying databases, primary key attributes get lost --> (ok 4.2.2) When copying databases, primary key attributes get lost
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Marc Delisle
    Marc Delisle
    2014-05-20

    • status: resolved --> fixed