← Back to team overview

enterprise-support team mailing list archive

[Bug 1316042] [NEW] CSV engine does not properly process "" (in quotes)

 

Public bug reported:

MySQL's CSV engine does NOT interpret "", inside quotes properly. It
requires sequence like \", to be there instead, without clear reason (I
see nothing like this explained here,
http://dev.mysql.com/doc/refman/5.6/en/csv-storage-engine.html).

How to repeat (taken from upstream bug description):

On any MySQL server version execute the following:

mysql> CREATE TABLE `emp` (
    -> `col1` text NOT NULL,
    -> `col2` text NOT NULL
    -> ) ENGINE=CSV DEFAULT CHARSET=utf8
    -> ;
Query OK, 0 rows affected (0.11 sec)

mysql> insert into emp values ("alan", "newyork"), ("jim", "CA\",boston");
Query OK, 2 rows affected (0.06 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> select * from emp;
+------+------------+
| col1 | col2       |
+------+------------+
| alan | newyork    |
| jim  | CA",boston |
+------+------------+
2 rows in set (0.00 sec)

mysql> flush tables;
Query OK, 0 rows affected (0.05 sec)

Now, check what is in emp.CSV file in the database directory. You'll
see:

"alan","newyork"
"jim","CA\",boston"

I do not see this documented on Wiki as acceptable way of quoting. Now,
change file to conform to "standard":

"alan","newyork"
"jim","CA"",boston"

Then check how it is interpreted/loaded:

mysql> flush tables;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from emp;
+------+---------+
| col1 | col2    |
+------+---------+
| alan | newyork |
| jim  | CA"     |
+------+---------+
2 rows in set (0.02 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.5.33    |
+-----------+
1 row in set (0.01 sec)

** Affects: mysql-server
     Importance: Unknown
         Status: Unknown

** Affects: percona-server
     Importance: Undecided
         Status: New


** Tags: i37547 upstream

** Bug watch added: MySQL Bug System #71091
   http://bugs.mysql.com/bug.php?id=71091

** Also affects: mysql-server via
   http://bugs.mysql.com/bug.php?id=71091
   Importance: Unknown
       Status: Unknown

** Tags added: upstream

-- 
You received this bug notification because you are a member of Ubuntu
Server/Client Support Team, which is subscribed to MySQL.
Matching subscriptions: Ubuntu Server/Client Support Team
https://bugs.launchpad.net/bugs/1316042

Title:
  CSV engine does not properly process "" (in quotes)

To manage notifications about this bug go to:
https://bugs.launchpad.net/mysql-server/+bug/1316042/+subscriptions


Follow ups

References