Menu

#4645 (ok 4.3.4) Import of export created with mysqldump

4.3.1
fixed
None
1
2015-01-04
2014-12-12
Fogelholk
No

Hi!

Whenever I try to import a file with phpMyAdmin 4.3.1 (and 4.3.0) that I have created with mysqldump (mysqldump --quote-names --opt --force --routines --triggers) I get the following error:

SQL query:
/*!40101 SET character_set_client = @saved_cs_client */;
MySQL said:
#1231 - Variable 'character_set_client' can't be set to the value of 'NULL'

When trying to import the same file with phpMyAdmin 4.2.6 and 4.2.7 it completes without any errors.

mysqldump-versions: MySQL dump 10.15 Distrib 10.0.14-MariaDB and MySQL dump 10.13 Distrib 5.5.29

Discussion

  • Fogelholk

    Fogelholk - 2014-12-12

    I can also add that the exported file works without any trouble in phpMyAdmin version 4.2.13.1.

     
  • Hugues Peccatte

    Hugues Peccatte - 2014-12-14

    Hi,
    Is it possible that you send us your dump please? Or at least a small failing dump without confidential data?
    Thanks.

     
  • Fogelholk

    Fogelholk - 2014-12-15

    Sure thing.
    Attached is two files.
    wordpress.sql is made with mysqldump 10.15 Distrib 10.0.15-MariaDB.
    sqlbackup-daily-2014-12-12.sql is made with 10.13 Distrib 5.5.29.

    Currently not able to import those files successfully into neither phpMyAdmin 4.3.1 nor 4.3.2, but works without any trouble in 4.2.13.1.

     

    Last edit: Fogelholk 2014-12-15
  • Hugues Peccatte

    Hugues Peccatte - 2014-12-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,7 +3,7 @@
     Whenever I try to import a file with phpMyAdmin 4.3.1 (and 4.3.0) that I have created with mysqldump (mysqldump --quote-names --opt --force --routines --triggers) I get the following error:
    
      SQL query:
    - /*!40101 SET character_set_client = @saved_cs_client */;
    + /\*!40101 SET character_set_client = @saved_cs_client \*/;
      MySQL said:
      #1231 - Variable 'character_set_client' can't be set to the value of 'NULL' 
    
     
  • Marc Delisle

    Marc Delisle - 2014-12-20

    Hugues,
    This is a serious problem.
    I am able to reproduce this problem, even when exporting from phpMyAdmin and trying to import back. I believe the problem is that version 4.2.x silently ignored this kind of comments when importing, while 4.3 is running the code inside comments.
    This kind of code inside comments, with a MySQL version number, is supposed to be run (at least from the normal mysql client) but I'm not sure how we can keep these MySQL variables initialized, the way we send queries to the server.

     
  • Hugues Peccatte

    Hugues Peccatte - 2014-12-21

    Marc,
    It seems that the error wasn't ignored, but that the comments was just removed.
    I'm currently working on this.

     
  • Hugues Peccatte

    Hugues Peccatte - 2014-12-21
    • assigned_to: Hugues Peccatte
     
  • Hugues Peccatte

    Hugues Peccatte - 2014-12-21

    Could you please give me a script that crashes import?
    I tried mine, I tried to export then import, but I can't crash my import…

     
  • Hugues Peccatte

    Hugues Peccatte - 2014-12-21

    I achieved to get an error with a mysqldump export on 4.3, but I got almost the same on 4.2.
    I tried a way to ignore the comments. Could you please try this branch? https://github.com/Tithugues/phpmyadmin/tree/b4645_qa43
    Thanks.

     
  • Fogelholk

    Fogelholk - 2014-12-22

    Seems like b4645_qa43 works with every import/export combination I can think of (both mysqldump and from within phpmyadmin)!

     
  • Marc Delisle

    Marc Delisle - 2014-12-22

    Hughes,
    with this branch of yours, I no longer have the problem.

     
  • Hugues Peccatte

    Hugues Peccatte - 2014-12-23

    Thanks for your feedback.
    I sent a PR for this: https://github.com/phpmyadmin/phpmyadmin/pull/1437

     
  • Marc Delisle

    Marc Delisle - 2014-12-24
    • summary: Import of export created with mysqldump --> (ok 4.3.4) Import of export created with mysqldump
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2014-12-29
    • Status: resolved --> fixed
     
  • Hugues Peccatte

    Hugues Peccatte - 2015-01-01

    Marc,
    To be sure about this issue, I tried somithing simple, I replaced line 23 by this line into the file sent by Fogelholk:
    /*!40101 SET @saved_cs_client = NULL */;
    This was failing on QA_4_3 but it also fails on QA_4_2. So for me, this is not due to the SQL import rewrite.

    My problem is that my fix leads to this issue: https://sourceforge.net/p/phpmyadmin/bugs/4682/
    I think that the MySQL was normal and that we shouldn't discard them.

    What do you think about it please? Should we revert the fix?

     

    Last edit: Hugues Peccatte 2015-01-01
  • Marc Delisle

    Marc Delisle - 2015-01-02

    Hugues,
    yes the proper action to do is to revert the fix and reopen the current ticket.

     
  • Hugues Peccatte

    Hugues Peccatte - 2015-01-02

    Marc,
    I agree about the fact to revert the commit. But should we really reopen the ticket please? I think this is a MySQL error, not a pMA error.

     
    • Marc Delisle

      Marc Delisle - 2015-01-02

      Hugues,
      with the mysql command-line client (5.4.40) I am able to import sqlbackup-daily-2014-12-12.sql. With phpMyAdmin 4.3.3 I get the error, I conclude that this is a phpMyAdmin bug that will come back once you revert the commit.

       
  • Hugues Peccatte

    Hugues Peccatte - 2015-01-03

    The PR for #4682 is also for this ticket: https://github.com/phpmyadmin/phpmyadmin/pull/1446

     
  • Marc Delisle

    Marc Delisle - 2015-01-04

    Pull request merged, thanks.