summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <sergefp@pylon.mylan>2007-03-29 12:24:23 +0400
committerunknown <sergefp@pylon.mylan>2007-03-29 12:24:23 +0400
commit94069acc2ffb4941daf9d6f3561ff0792f4ea714 (patch)
tree899f2fd8517100118e0727eb54ee00cb8ac31524 /mysql-test/t
parent689910ac9c21e7e117a6fd28fb39233edb07fda4 (diff)
parentbedd5b8766a680539f11ee3f437e4ee1d75b8a87 (diff)
downloadmariadb-git-94069acc2ffb4941daf9d6f3561ff0792f4ea714.tar.gz
Merge mysql.com:/home/psergey/mysql-5.0-merge
into mysql.com:/home/psergey/mysql-5.1-merge BitKeeper/deleted/.del-mysqld.cc.rej: Auto merged mysql-test/r/range.result: Auto merged mysql-test/t/range.test: Auto merged sql/item_sum.cc: Auto merged sql/sql_list.h: Auto merged mysql-test/r/subselect.result: Manual merge mysql-test/t/subselect.test: Manual merge sql/opt_range.cc: Manual merge
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/range.test32
-rw-r--r--mysql-test/t/subselect.test25
2 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index b1cec049ab2..68bab0c50a2 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -568,6 +568,38 @@ SELECT s.oxid FROM t1 v, t1 s
DROP TABLE t1;
+# BUG#26624 high mem usage (crash) in range optimizer (depends on order of fields in where)
+create table t1 (
+ c1 char(10), c2 char(10), c3 char(10), c4 char(10),
+ c5 char(10), c6 char(10), c7 char(10), c8 char(10),
+ c9 char(10), c10 char(10), c11 char(10), c12 char(10),
+ c13 char(10), c14 char(10), c15 char(10), c16 char(10),
+ index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16)
+);
+
+insert into t1 (c1) values ('1'),('1'),('1'),('1');
+
+# This must run without crash and fast:
+select * from t1 where
+ c1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c4 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c5 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c6 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c7 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c8 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c9 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c10 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c11 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c12 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c13 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c14 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c15 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+ and c16 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh")
+;
+drop table t1;
+
--echo End of 4.1 tests
#
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 0ecf0641c5b..88c34bdb9b9 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2784,6 +2784,31 @@ SELECT COUNT(*) c, a,
DROP table t1,t2;
#
+# Bug #27348: SET FUNCTION used in a subquery from WHERE condition
+#
+
+CREATE TABLE t1 (a int, b int);
+INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
+
+SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
+SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
+
+SELECT a FROM t1 t0
+ WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
+
+SET @@sql_mode='ansi';
+--error 1111
+SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
+--error 1111
+SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
+
+--error 1111
+SELECT a FROM t1 t0
+ WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
+
+SET @@sql_mode=default;
+DROP TABLE t1;
+
# Bug#20835 (literal string with =any values)
#
CREATE TABLE t1 (s1 char(1));