mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed bug #32533.
8bit escape characters, termination and enclosed characters were silently ignored by SELECT INTO query, but LOAD DATA INFILE algorithm is 8bit-clean, so data was corrupted during encoding. sql/sql_class.cc: Fixed bug #32533. SELECT INTO OUTFILE encoding was not 8bit clear, it has been fixed for a symmetry with the LOAD DATA INFILE decoding algorithm. mysql-test/t/outfile_loaddata.test: Added test case for bug #32533. mysql-test/r/outfile_loaddata.result: Added test case for bug #32533.
This commit is contained in:
@ -82,4 +82,22 @@ c1 c2
|
||||
-r- =raker=
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#32533: SELECT INTO OUTFILE never escapes multibyte character
|
||||
#
|
||||
CREATE TABLE t1 (c1 VARCHAR(256));
|
||||
INSERT INTO t1 VALUES (0xC3);
|
||||
SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' FIELDS ENCLOSED BY 0xC3 FROM t1;
|
||||
TRUNCATE t1;
|
||||
SELECT HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'));
|
||||
HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'))
|
||||
C35CC3C30A
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3;
|
||||
SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
DROP TABLE t1;
|
||||
# End of 5.0 tests.
|
||||
|
Reference in New Issue
Block a user