summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-09-15 12:38:22 -0700
committerIgor Babaev <igor@askmonty.org>2013-09-15 12:38:22 -0700
commit996f6194c69b556e37a143a6a175e60a9f57ab47 (patch)
treec7a5f792b386bf119c2c2d6074916456f9b16f18 /mysql-test/t
parentcf9cc19e910f3621661de6a9384a18aacf84a8dd (diff)
downloadmariadb-git-996f6194c69b556e37a143a6a175e60a9f57ab47.tar.gz
Fixed bug mdev-5015.
The patch for mdev-4355 had a defect: the cached values for bitmaps of used tables were not updated when processing degenerate OR formulas.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/func_group.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 9f0d7e102da..e61962bc8a4 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1403,4 +1403,24 @@ select z from (select count(*) as z from t1) v;
select z from (select count(*) as z from t1) v group by 1;
drop table t1;
+#
+# Bug mdev-5015: Degenerate OR condition in an aggregated join
+#
+
+CREATE TABLE t1 (i1 int, INDEX(i1));
+INSERT INTO t1 VALUES (9),(8);
+
+CREATE TABLE t2 (i2 int);
+INSERT INTO t2 VALUES (8),(4);
+
+
+CREATE TABLE t3 (i3 int, INDEX(i3));
+INSERT INTO t3 VALUES (9),(8);
+
+SELECT MAX(t3.i3) FROM t3, t2, t1 WHERE t1.i1 = t2.i2 AND ( 0 OR t3.i3 = t2.i2 );
+
+SELECT MAX(t3.i3) FROM t3, t2, t1 WHERE t1.i1 = t2.i2 AND t3.i3 = t2.i2;
+
+DROP TABLE t1,t2,t3;
+
--echo # end of 5.3 tests