From 7d77a065c3423960ab91ff5e48d053225a48139f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jul 2006 13:28:42 -0700 Subject: Bug #16881: password() and union select This was only demonstrated by the use of PASSWORD(), it was not related to that function at all. The calculation of the size of a field in the results of a UNION did not take into account the possible growth of a string field when being converted to the aggregated character set. mysql-test/r/union.result: Add new results mysql-test/t/union.test: Add new regression test sql/item.cc: Fix calculation of max_length when figuring out the type of a column in a UNION. It needs to take into account any expansion of field size due to charset conversions. --- mysql-test/t/union.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t/union.test') diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 7dfe4ac482f..b300cf91a22 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -841,3 +841,10 @@ drop table t1; (select avg(1)) union (select avg(1)) union (select avg(1)) union (select avg(1)) union (select avg(1)) union (select avg(1)); +# +# Bug #16881: password() and union select +# (The issue was poor handling of character set aggregation.) +# +select _utf8'12' union select _latin1'12345'; + +--echo End of 5.0 tests -- cgit v1.2.1