summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-07-16 03:29:12 +0400
committerunknown <evgen@moonbone.local>2005-07-16 03:29:12 +0400
commit0f41fb4234c58d9f17385c8f77fe02aa6a1f5b96 (patch)
tree64606741d37005b7ae298d28019e32fa16916379 /mysql-test/t/select.test
parentdba319047450dde32b21a30aa8c66ee1f4468c92 (diff)
downloadmariadb-git-0f41fb4234c58d9f17385c8f77fe02aa6a1f5b96.tar.gz
Fix bug#11482 4.1.12 produces different resultset for a complex query
than in previous 4.1.x Wrongly applied optimization were adding NOT NULL constraint which results in rejecting valid rows and reduced result set. The problem was that add_notnull_conds() while checking subquery were adding NOT NULL constraint to left joined table, to which, normally, optimization don't have to be applied. sql/sql_select.cc: Fix bug #11482 Wrongly applied optimization was erroneously rejecting valid rows Constraint were added to optimization appliance test. mysql-test/t/select.test: Test case for bug #11482 Wrongly applied optimization was erroneously rejecting valid rows mysql-test/r/select.result: Test case for bug #11482 Wrongly applied optimization was erroneously rejecting valid rows
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 37e4324152b..2e261d0611f 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2116,3 +2116,14 @@ WHERE
drop table t1,t2,t3;
+#
+# Bug #11482 4.1.12 produces different resultset for a complex query
+# than in previous 4.1.x
+create table t1 (f1 int);
+insert into t1 values (1),(NULL);
+create table t2 (f2 int, f3 int, f4 int);
+create index idx1 on t2 (f4);
+insert into t2 values (1,2,3),(2,4,6);
+select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3)
+from t2 C where A.f4 = C.f4) or A.f3 IS NULL;
+drop table t1,t2;