Bug #4799 | When use to print CHAR(0) FROM OUTFILE its WRITE "\0" AND I NEED NULL chr(0) | ||
---|---|---|---|
Submitted: | 29 Jul 2004 1:56 | Modified: | 2 Aug 2004 19:16 |
Reporter: | Guilherme Santos | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.0.0 | OS: | Linux (LINUX) |
Assigned to: | CPU Architecture: | Any |
[29 Jul 2004 1:56]
Guilherme Santos
[2 Aug 2004 19:16]
Hartmut Holzgraefe
See manual section "14.1.5 LOAD DATA INFILE" http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html (it is also mentioned in the "SELECT Syntax" section ...) FIELDS ESCAPED BY controls how to write or read special characters. If the FIELDS ESCAPED BY character is not empty, it is used to prefix the following characters on output: * The FIELDS ESCAPED BY character * The FIELDS [OPTIONALLY] ENCLOSED BY character * The first character of the FIELDS TERMINATED BY and LINES TERMINATED BY values * ASCII 0 (what is actually written following the escape character is ASCII '0', not a zero-valued byte) If the FIELDS ESCAPED BY character is empty, no characters are escaped and NULL is output as NULL, not \N. It is probably not a good idea to specify an empty escape character, particularly if field values in your data contain any of the characters in the list just given.
[5 Aug 2004 21:30]
Guilherme Santos
but i need with char 0 in file LIKE THIS: SELECT TRIM(art),REPEAT(CHAR(0),IF(ISNULL(art),12,12-LENGTH(TRIM(art))) FROM TAB I can´t complete cols with char 0 and write to file from mysql ?!?!?