diff options
author | unknown <gshchepa/uchum@gleb.loc> | 2007-11-20 20:15:20 +0400 |
---|---|---|
committer | unknown <gshchepa/uchum@gleb.loc> | 2007-11-20 20:15:20 +0400 |
commit | 0a91f285ad4a8d017a508e32a1c5d4deb7e0203a (patch) | |
tree | 4f93f42481705c3afd38cbab8849361c80133400 /mysql-test/t/outfile_loaddata.test | |
parent | 4b48eb6f1e4565ba31982f73908664108ba0fb7b (diff) | |
download | mariadb-git-0a91f285ad4a8d017a508e32a1c5d4deb7e0203a.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/outfile_loaddata.test')
-rw-r--r-- | mysql-test/t/outfile_loaddata.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/outfile_loaddata.test b/mysql-test/t/outfile_loaddata.test index 2f6ac998b3d..2a120871e7d 100644 --- a/mysql-test/t/outfile_loaddata.test +++ b/mysql-test/t/outfile_loaddata.test @@ -86,4 +86,28 @@ DROP TABLE t2; DROP TABLE t1; +--echo # +--echo # Bug#32533: SELECT INTO OUTFILE never escapes multibyte character +--echo # + +CREATE TABLE t1 (c1 VARCHAR(256)); +INSERT INTO t1 VALUES (0xC3); +SELECT HEX(c1) FROM t1; + +--let $file=$MYSQLTEST_VARDIR/tmp/bug32533.txt + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval SELECT * INTO OUTFILE '$file' FIELDS ENCLOSED BY 0xC3 FROM t1 +TRUNCATE t1; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval SELECT HEX(LOAD_FILE('$file')) + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval LOAD DATA INFILE '$file' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3 +SELECT HEX(c1) FROM t1; + +--remove_file $file +DROP TABLE t1; + --echo # End of 5.0 tests. |