summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqldump.test
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2010-05-07 00:41:37 +0400
committerGleb Shchepa <gshchepa@mysql.com>2010-05-07 00:41:37 +0400
commitbd2a517b2381465eb2cf366fb5d4ad08d6770708 (patch)
treea947e154dfe6fb69c896b08add4f0bf0ee891961 /mysql-test/t/mysqldump.test
parentaddd0a3e67164037149140b71c027272ecbaee49 (diff)
downloadmariadb-git-bd2a517b2381465eb2cf366fb5d4ad08d6770708.tar.gz
Bug #53088: mysqldump with -T & --default-character-set set
truncates text/blob to 766 chars mysqldump and SELECT ... INTO OUTFILE truncated long BLOB/TEXT values to size of 766 bytes (MAX_FIELD_WIDTH or 255 * 3 + 1). The select_export::send_data method has been modified to reallocate a conversion buffer for long field data. mysql-test/r/mysqldump.result: Test case for bug #53088. mysql-test/r/outfile_loaddata.result: Test case for bug #53088. mysql-test/t/mysqldump.test: Test case for bug #53088. mysql-test/t/outfile_loaddata.test: Test case for bug #53088. sql/sql_class.cc: Bug #53088: mysqldump with -T & --default-character-set set truncates text/blob to 766 chars The select_export::send_data method has been modified to reallocate a conversion buffer for long field data.
Diffstat (limited to 'mysql-test/t/mysqldump.test')
-rw-r--r--mysql-test/t/mysqldump.test29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 07ab9cecd28..0bf9916dcd5 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2132,6 +2132,35 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
SET NAMES default;
DROP TABLE t1, t2;
+###########################################################################
+
+--echo #
+--echo # Bug #53088: mysqldump with -T & --default-character-set set
+--echo # truncates text/blob to 766 chars
+--echo #
+--echo # Also see outfile_loaddata.test
+--echo #
+
+CREATE TABLE t1 (a BLOB) CHARSET latin1;
+CREATE TABLE t2 LIKE t1;
+
+let $table= t1;
+let $dir= $MYSQLTEST_VARDIR/tmp;
+let $file= $dir/$table.txt;
+let $length= 800;
+
+--eval INSERT INTO t1 VALUES (REPEAT('.', $length))
+
+--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$dir/ test $table
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+
+--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET latin1
+--remove_file $file
+
+--echo # should be $length
+SELECT LENGTH(a) FROM t2;
+
+DROP TABLE t1, t2;
###########################################################################
--echo #