summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_concat.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-06-07 01:10:23 +0400
committerunknown <evgen@moonbone.local>2006-06-07 01:10:23 +0400
commit6e80e9a4f93180f680b5d908e47221af67d7a3d6 (patch)
tree2558020fb28cfef9d7c7d41a6a13608b7e7724d7 /mysql-test/r/func_concat.result
parent63d6336465c13c010977c04a037468e55b68e9e0 (diff)
downloadmariadb-git-6e80e9a4f93180f680b5d908e47221af67d7a3d6.tar.gz
Fixed bug#15962: CONCAT() in UNION may lead to a data trucation.
To calculate its max_length the CONCAT() function is simply sums max_lengths of its arguments but when the collation of an argument differs from the collation of the CONCAT() max_length will be wrong. This may lead to a data truncation when a tmp table is used, in UNIONS for example. The Item_func_concat::fix_length_and_dec() function now recalculates the max_length of an argument when the mbmaxlen of the argument differs from the mbmaxlen of the CONCAT(). mysql-test/t/func_concat.test: Added test case for bug#15962:CONCAT() in UNION may lead to a data trucation. mysql-test/r/func_concat.result: Added test case for bug#15962:CONCAT() in UNION may lead to a data trucation. sql/item_strfunc.cc: Fixed bug#15962: CONCAT() in UNION may lead to a data trucation. The Item_func_concat::fix_length_and_dec() function now recalculates the max_length of an argument when the mbmaxlen of the argument differs from the mbmaxlen of the CONCAT().
Diffstat (limited to 'mysql-test/r/func_concat.result')
-rw-r--r--mysql-test/r/func_concat.result7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result
index 0bd53b32dd7..712f0c0495e 100644
--- a/mysql-test/r/func_concat.result
+++ b/mysql-test/r/func_concat.result
@@ -68,3 +68,10 @@ select 'a' union select concat('a', -0.0000);
a
a
a0.0000
+create table t1(f1 varchar(6)) charset=utf8;
+insert into t1 values ("123456");
+select concat(f1, 2) a from t1 union select 'x' a from t1;
+a
+1234562
+x
+drop table t1;