#3049 Export with file option creates invalid commands

3.5.5
open
nobody
5
2014-08-17
2010-06-22
Carlos Pérez
No

When using the export option with the Save as file, option enabled creates some commands that when doing the import of the very same generated file does not import the spanish characters correctly.
This in an example of an export file with the Save as file option enabled:
-- phpMyAdmin SQL Dump
-- version 3.3.4-rc1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 22, 2010 at 04:45 AM
-- Server version: 5.1.46
-- PHP Version: 5.3.2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES latin1 */;
--
-- Database: `carlos_photoalbums`
--
-- --------------------------------------------------------
--
-- Table structure for table `PhotoAlbums`
--

then the table and the data details and at the end:
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is the very same export but WITHOUT the Save as file option enabled
-- phpMyAdmin SQL Dump
-- version 3.3.4-rc1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 22, 2010 at 04:44 AM
-- Server version: 5.1.46
-- PHP Version: 5.3.2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `carlos_photoalbums`
--
-- --------------------------------------------------------
--
-- Table structure for table `PhotoAlbums`
--
then the table and the data details and at the end there is nothing else.
---------------------------------------------------------------------------------------------------------------------------------------------------------
This behavior is the same using PMA, 332, 333, and the recently released 334.rc1

I use Apache 2.2.11, Php 5.3.2 and MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 294543 $

If I delete those 6 lines (3 at beginning and the 3 at end) the impor works correctly and the spanish characters are saved fine.

Discussion

<< < 1 2 3 > >> (Page 2 of 3)
  • Carlos Pérez
    Carlos Pérez
    2010-07-02

    Correction, instep 7 should read:
    PmaImportOptionsWithFileNotSelected.png
    and NOT
    PmaExportOptionsWithFileNotSelected.png

     
  • Marc Delisle
    Marc Delisle
    2010-07-03

    About mysqlnd: I compile PHP myself with the options I want. Sometimes I use mysqlnd, sometimes not.

    About step 1: did you change the "Character set of the file" option to iso-8859-1 or is it there by default?

    As I told you in a previous comment, I see "utf-8" there and if I do not change it, your table exports and imports fine. Please try it with "utf-8" and selecting to export in a file. Then we'll find out why you are seeing "iso-8859-1", if it's the case.

     
  • Carlos Pérez
    Carlos Pérez
    2010-07-03

    I guess you didn't see any of the images,

    In all off them, the characters set of the file is set to ISO-8859-1 for all exports and imports.

    I have had a lot of problems with the characters set for import and export and found out that when using ISO-8859-1 the characters problem DID NOT OCCUR.
    This is why my config file has only the characters set ISO-8859-1 for these operations to avoid problems for me and some users the do work with me.

    This problem started as I said with PMA version 3.

    As of test with utf-8 I did try it and it worked fine.

    The problem I'm addressing remains.
    If the only charset available is ISO-8859-1?.
    Why is this behavoir occurring when using the export as save file and not when this option is not selected?.
    Why are these lines:
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES latin1 */;
    added when save to file is used and not as a response to the browser?.
    Notice that the last line is SET NAMES latin1 and NOT utf-8 as you stated.

     
  • Marc Delisle
    Marc Delisle
    2010-07-04

    I saw the images but by seeing an image it's not possible to deduce if iso-8859-1 was there by default or because you chose it. This is why I asked the question.

    These extra lines are generated to help in case a utility like the mysql client is used to execute this file.

    Please tell me which settings in your config file have only the character sets ISO-8859-1?

    P.S. in the lang directory you will notice that phpMyAdmin now has only UTF-8 language files, so please clarify your question "if the only charset available is iso-8859-1"? I don't understand your point of view.

     
<< < 1 2 3 > >> (Page 2 of 3)