Description:
This is MySQL and Drizzle... but MySQL just warns and gives you crap (that you can't import).
produces un-readable result file when there is a way (with the syntax specified) to have an un-ambiguous result.
also see https://bugs.launchpad.net/drizzle/+bug/308440
How to repeat:
mysql> create table t1 (a int, b int);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values (42, 42); Query OK, 1 row affected (0.00 sec)
mysql> select * into outfile '../tmp/bar' fields optionally enclosed by '"' terminated by '0' from t1;
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------------------------------------------------------------------+
| Warning | 1475 | First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY |
+---------+------+------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> Aborted
stewart@hurricane:~/mysql/6.0/mysql-test$ cat var/tmp/bar
42042
Suggested fix:
If enclosed by was used, this wouldn't be ambiguous. Only if enclosed by was something that could be displayed in a number would this be an issue.