summaryrefslogtreecommitdiff
path: root/mysql-test/r/case.result
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-10-29 12:20:21 +0400
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-10-29 12:20:21 +0400
commit42894ed0b870f4adfc6023404877732a08b1ec22 (patch)
treee9112ce10721f2b915b8376caddb5001056b04b1 /mysql-test/r/case.result
parenta634d1bf474aab88c44d448035b6a9a35d6e795d (diff)
downloadmariadb-git-42894ed0b870f4adfc6023404877732a08b1ec22.tar.gz
Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE,
JOIN, and ORDER BY Problem: improper maximum length calculation of the CASE function leads to decimal value truncation (storing/retrieving decimal field values). Fix: accurately calculate maximum length/unsigned flag/decimals parameters of the CASE function. mysql-test/r/case.result: Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, JOIN, and ORDER BY - test result. mysql-test/t/case.test: Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, JOIN, and ORDER BY - test case. sql/item_cmpfunc.cc: Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, JOIN, and ORDER BY - accurately calculate Item_func_case::max_length/unsigned_flag/decimals. sql/item_cmpfunc.h: Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, JOIN, and ORDER BY - accurately calculate Item_func_case::max_length/unsigned_flag/decimals.
Diffstat (limited to 'mysql-test/r/case.result')
-rw-r--r--mysql-test/r/case.result20
1 files changed, 19 insertions, 1 deletions
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index cf358e6a404..bc05edcfac1 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1, t2;
select CASE "b" when "a" then 1 when "b" then 2 END;
CASE "b" when "a" then 1 when "b" then 2 END
2
@@ -200,3 +200,21 @@ CEMPNUM EMPMUM1 EMPNUM2
0.00 0 0.00
2.00 2 NULL
DROP TABLE t1,t2;
+End of 4.1 tests
+create table t1 (a int, b bigint unsigned);
+create table t2 (c int);
+insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997),
+(3,11120436154190595086);
+insert into t2 (c) values (1), (2), (3);
+select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
+join t2 on t1.a=t2.c order by d;
+a d
+1 4572794622775114594
+3 11120436154190595086
+2 18196094287899841997
+select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
+join t2 on t1.a=t2.c where b=11120436154190595086 order by d;
+a d
+3 11120436154190595086
+drop table t1, t2;
+End of 5.0 tests