summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_if.test
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2008-10-12 11:57:24 +0300
committerMichael Widenius <monty@mysql.com>2008-10-12 11:57:24 +0300
commit5d2a1425d77f927066e14490b0c037fd892eaf17 (patch)
tree926617b5e4d9f2596e46175b1a593966317ecef3 /mysql-test/t/func_if.test
parent57c1a63d49a4729e417102b48d4b5c0ca31c4585 (diff)
parent0e43d765573ececac5c0b013235f11aa3c66fbda (diff)
downloadmariadb-git-5d2a1425d77f927066e14490b0c037fd892eaf17.tar.gz
(Mostly) automatic merge
Fixed also some failing tests after merge. The files that was touched outside of the merge has a more explicit comment include/my_global.h: Remove 'register' from 'swap_variables' as this gives a warnings when the variables are structs. Compilers should also now be smart enough to figure out this themselves mysql-test/t/subselect_debug.test: Reset value of the debug variable; Without setting this the subselect_innodb test will fail when run after this one sql/mysqld.cc: Fix for Bug #39987 main.partition_not_windows fails under debug build The problem was that when compiling for purify/valgrind realpath() is not used, which causes test_if_data_home_dir to fail when it shouldn't unittest/mysys/waiting_threads-t.c: Remove not needed 'volatile' to get rid of compiler warnings on windows
Diffstat (limited to 'mysql-test/t/func_if.test')
-rw-r--r--mysql-test/t/func_if.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 5373ca3fec6..8da10f36cbe 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -108,3 +108,46 @@ drop table t1;
select if(0, 18446744073709551610, 18446744073709551610);
+#
+# Bug #37662: nested if() inside sum() is parsed in exponential time
+#
+
+CREATE TABLE t1(a DECIMAL(10,3));
+
+# check : should be fast. more than few secs means failure.
+SELECT t1.a,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1
+FROM t1;
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests