summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-10-28 18:12:57 -0700
committerunknown <jimw@mysql.com>2005-10-28 18:12:57 -0700
commitae683ae87d6f86bf4404ad52f409b315d48fa002 (patch)
tree0ecd7190c09834d899b776fddb2abdee55622205 /mysql-test/t/union.test
parent984400fcfedec847bd4a3ff921b94c1c36172cab (diff)
downloadmariadb-git-ae683ae87d6f86bf4404ad52f409b315d48fa002.tar.gz
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
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test18
1 files changed, 18 insertions, 0 deletions
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