summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <evgen@sunlight.local>2006-07-29 23:59:53 +0400
committerunknown <evgen@sunlight.local>2006-07-29 23:59:53 +0400
commit08be4e96a953a883240e9eebb38a9e8b965d3b1d (patch)
tree4f4d9327b2482d563e3733ac9d995fd0b7f9155e /mysql-test/t
parent667c73be65bc1c1a6f77d6e2bb140cdddae9ec73 (diff)
parent9c7a329ebac9ae1da05e0c427d1f46094c2c8b7e (diff)
downloadmariadb-git-08be4e96a953a883240e9eebb38a9e8b965d3b1d.tar.gz
Merge sunlight.local:/local_work/tmp_merge-4.1-opt-mysql
into sunlight.local:/local_work/tmp_merge-5.0-opt-mysql mysql-test/t/select.test: Auto merged sql/sql_select.cc: Auto merged mysql-test/r/func_group.result: Manual merge mysql-test/r/select.result: Manual merge mysql-test/r/subselect.result: Manual merge
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/select.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index a55645bcc7c..197d89d02d5 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2319,6 +2319,36 @@ SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NUL
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
DROP TABLE IF EXISTS t1,t2;
+#
+# Bug #20954 "avg(keyval) retuns 0.38 but max(keyval) returns an empty set"
+#
+--disable_ps_protocol
+CREATE TABLE t1 (key1 float default NULL, UNIQUE KEY key1 (key1));
+CREATE TABLE t2 (key2 float default NULL, UNIQUE KEY key2 (key2));
+INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941);
+INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941);
+
+explain select max(key1) from t1 where key1 <= 0.6158;
+explain select max(key2) from t2 where key2 <= 1.6158;
+explain select min(key1) from t1 where key1 >= 0.3762;
+explain select min(key2) from t2 where key2 >= 1.3762;
+explain select max(key1), min(key2) from t1, t2
+where key1 <= 0.6158 and key2 >= 1.3762;
+explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
+explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
+
+select max(key1) from t1 where key1 <= 0.6158;
+select max(key2) from t2 where key2 <= 1.6158;
+select min(key1) from t1 where key1 >= 0.3762;
+select min(key2) from t2 where key2 >= 1.3762;
+select max(key1), min(key2) from t1, t2
+where key1 <= 0.6158 and key2 >= 1.3762;
+select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
+select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
+
+DROP TABLE t1,t2;
+--enable_ps_protocol
+
# End of 4.1 tests
#