Bug #70077 specifying utf32 charset for CSV engine is effectively BLACKHOLE
Submitted: 18 Aug 2013 19:06 Modified: 19 Aug 2013 5:20
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Charsets Severity:S2 (Serious)
Version:5.6+ OS:Windows
Assigned to: CPU Architecture:Any

[18 Aug 2013 19:06] Peter Laursen
Description:
Related to http://bugs.mysql.com/bug.php?id=70076 -- but this one is plain funny!

How to repeat:
CREATE TABLE `bla`.`win2`( `txt` VARCHAR(10) NOT NULL ) ENGINE=CSV CHARSET=utf32; -- no error or warning
INSERT INTO `bla`.`win` (`txt`) VALUES ('abc'); -- no error or warning
INSERT INTO `bla`.`win` (`txt`) VALUES ('xyz'); -- no error or warning
INSERT INTO `bla`.`win` (`txt`) VALUES ('æøå'); -- no error or warning
SELECT * FROM `bla`.`win` -- empty set

Suggested fix:
Windows is probably the msot capable OS as regards the ability to handle files with different encodings (ANSI, utf8, utf16_le, and utf16_be), but files with utf32 it does not handle! 

This should raise an error that CSV engine does not support this charset of the platform.
[18 Aug 2013 19:58] Peter Laursen
I am assuming that CSV+UTF16LE, CSV+UTF16 as well as CSV+UTF32 also is == BLACKHOLE on Linux.  I don't know much about 'big endian systems' (Mac, Solaris), but probably there are similar issues here.

Either the CHARSET specification in CREATE/ALTER TABLE should be restricted on each platfrom to what the platform can handle. Or CHARSET specification should not be allowed for CSV tables at all (the 'poorer' solution).

This is just an example of how easy it sometimes is to 'predict' bugs in MySQL. When I started this, I was confident that I would find one or more bugs with combinations of CSV engine and various charsets - and it was easy. Actually I think 50% of my bug reports started the same way. Just think "what could they have overlooked?".  And indeed they did (again and again and again)!
[19 Aug 2013 5:20] MySQL Verification Team
you're inserting into the wrong table!
[19 Aug 2013 5:21] MySQL Verification Team
mysql> drop table if exists `win`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE TABLE `win`( `txt` VARCHAR(10) NOT NULL ) ENGINE=CSV CHARSET=utf32; -- no error or warning
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO `win` (`txt`) VALUES ('abc'); -- no error or warning
Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO `win` (`txt`) VALUES ('xyz'); -- no error or warning
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO `win` (`txt`) VALUES ('æøå'); -- no error or warning
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM `win` -- empty set
    -> ;
+--------+
| txt    |
+--------+
| abc    |
| xyz    |
| æøå    |
+--------+
3 rows in set (0.00 sec)
mysql> select version();
+------------------+
| version()        |
+------------------+
| 5.6.14-debug-log |
+------------------+
1 row in set (0.00 sec)