mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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.
This commit is contained in:
@@ -238,3 +238,17 @@ f1
|
||||
1
|
||||
2
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
|
||||
INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3 c4
|
||||
10 1970-02-01 01:02:03 1.1e-100 1.1e+100
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
|
||||
-10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e+100-
|
||||
EOF
|
||||
TRUNCATE t1;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3 c4
|
||||
10 1970-02-01 01:02:03 1.1e-100 1.1e+100
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user