From ae683ae87d6f86bf4404ad52f409b315d48fa002 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Oct 2005 18:12:57 -0700 Subject: Fix bug in handling of decimal fields in UNION statements that could cause a crash or write to an incorrect memory location. (Bug #14216) mysql-test/r/union.result: Update results mysql-test/t/union.test: Add regression test sql/item.cc: Set max_length for decimal fields correctly --- mysql-test/t/union.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/t/union.test') diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 6a54909536a..1f6fc2c8d3b 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -756,4 +756,22 @@ select 99 union all select id from t1 order by 1; select id from t1 union all select 99 order by 1; drop table t1; +# +# Bug #14216: UNION + DECIMAL wrong values in result +# +create table t1 (f1 decimal(60,25), f2 decimal(60,25)); +insert into t1 values (0.0,0.0); +select f1 from t1 union all select f2 from t1; +select 'XXXXXXXXXXXXXXXXXXXX' as description, f1 from t1 +union all +select 'YYYYYYYYYYYYYYYYYYYY' as description, f2 from t1; +drop table t1; +create table t1 (f1 decimal(60,24), f2 decimal(60,24)); +insert into t1 values (0.0,0.0); +select f1 from t1 union all select f2 from t1; +select 'XXXXXXXXXXXXXXXXXXXX' as description, f1 from t1 +union all +select 'YYYYYYYYYYYYYYYYYYYY' as description, f2 from t1; +drop table t1; + # End of 4.1 tests -- cgit v1.2.1