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
I can also add that the exported file works without any trouble in phpMyAdmin version 4.2.13.1.
Hi,
Is it possible that you send us your dump please? Or at least a small failing dump without confidential data?
Thanks.
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
Diff:
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.
Marc,
It seems that the error wasn't ignored, but that the comments was just removed.
I'm currently working on this.
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…
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.
Seems like b4645_qa43 works with every import/export combination I can think of (both mysqldump and from within phpmyadmin)!
Hughes,
with this branch of yours, I no longer have the problem.
Thanks for your feedback.
I sent a PR for this: https://github.com/phpmyadmin/phpmyadmin/pull/1437
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
Hugues,
yes the proper action to do is to revert the fix and reopen the current ticket.
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.
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.
The PR for #4682 is also for this ticket: https://github.com/phpmyadmin/phpmyadmin/pull/1446
Pull request merged, thanks.