Bug #29442 | SELECT INTO OUTFILE FIELDS ENCLOSED BY '0' corrupts numeric fields | ||
---|---|---|---|
Submitted: | 29 Jun 2007 10:37 | Modified: | 9 Jul 2007 1:10 |
Reporter: | Gleb Shchepa | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1, 5.0, 5.1 | OS: | Any |
Assigned to: | Gleb Shchepa | CPU Architecture: | Any |
[29 Jun 2007 10:37]
Gleb Shchepa
[29 Jun 2007 10:40]
Gleb Shchepa
test case
Attachment: 29442.test (application/octet-stream, text), 638 bytes.
[29 Jun 2007 13:28]
Sveta Smirnova
Thank you for the report. Verified as described.
[5 Jul 2007 16:27]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/30395 ChangeSet@1.2518, 2007-07-05 21:31:57+05:00, gshchepa@gleb.loc +3 -0 Fixed bug #29442. The SELECT INTO OUTFILE FIELDS ENCLOSED BY digit or minus sign, followed by the same LOAD DATA INFILE statement, corrupted non-string fields contained the enclosed character in their text representation.
[5 Jul 2007 22:10]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/30414 ChangeSet@1.2518, 2007-07-06 03:14:32+05:00, gshchepa@gleb.loc +4 -0 Fixed bug #29442. The SELECT INTO OUTFILE FIELDS ENCLOSED BY digit or minus sign, followed by the same LOAD DATA INFILE statement, used wrond encoding of non-string fields contained the enclosed character in their text representation. Example: SELECT 15, 9 INTO OUTFILE 'text' FIELDS ENCLOSED BY '5'; Old encoding result in the text file: 5155 595 ^ was decoded as the 1st enclosing character of the 2nd field; ^ was skipped as a garbage; ^ ^ was decoded as a pair of englosing characters of the 1st field; ^ was decoded as traling space of the first field; ^^ was decoded as a doubled enclosed character. New encoding result in the text file: 51\55 595 ^ ^ pair of enclosing characters of the 1st field; ^^ escaped enclosed character.
[5 Jul 2007 22:39]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/30415 ChangeSet@1.2518, 2007-07-06 03:43:23+05:00, gshchepa@gleb.loc +4 -0 Fixed bug #29442. The SELECT INTO OUTFILE FIELDS ENCLOSED BY digit or minus sign, followed by the same LOAD DATA INFILE statement, used wrond encoding of non-string fields contained the enclosed character in their text representation. Example: SELECT 15, 9 INTO OUTFILE 'text' FIELDS ENCLOSED BY '5'; Old encoded result in the text file: 5155 595 ^ was decoded as the 1st enclosing character of the 2nd field; ^ was skipped as garbage; ^ ^ was decoded as a pair of englosing characters of the 1st field; ^ was decoded as traling space of the first field; ^^ was decoded as a doubled enclosed character. New encoded result in the text file: 51\55 595 ^ ^ pair of enclosing characters of the 1st field; ^^ escaped enclosed character.
[8 Jul 2007 17:28]
Bugs System
Pushed into 5.1.21-beta
[8 Jul 2007 17:30]
Bugs System
Pushed into 5.0.46
[9 Jul 2007 1:10]
Paul DuBois
Noted in 5.0.46, 5.1.21 changelogs. Use of SELECT ... INTO OUTFILE 'file_name' FIELDS ENCLOSED BY 'c', where c is a digit or minus sign, followed by LOAD DATA INFILE 'file_name FIELDS ENCLOSED BY 'c', resulted in corrupt data.