summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_sj.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-09-23 01:25:08 +0400
committerSergey Petrunya <psergey@askmonty.org>2011-09-23 01:25:08 +0400
commitebbdb14a02daf36063effc8b734028578f7e4e90 (patch)
tree4502de918c214b3ba5633d6e632cd6cd9ba258b7 /mysql-test/t/subselect_sj.test
parent42b928ca05fca3ae8858566622a3a483a70aa3fc (diff)
downloadmariadb-git-ebbdb14a02daf36063effc8b734028578f7e4e90.tar.gz
BUG#849776: Wrong result with semijoin + "Impossible where"
- Provide fix_after_pullout() function for Item_in_optimizer and other Item_XXX classes (basically, all of them that have eval_not_null_tables, which means they have special rules for calculating not_null_tables_cache value)
Diffstat (limited to 'mysql-test/t/subselect_sj.test')
-rw-r--r--mysql-test/t/subselect_sj.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index cc9518d9de7..e4e8b03f4b2 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -1735,5 +1735,26 @@ EXECUTE st1;
DROP TABLE t1, t2, t3;
+--echo #
+--echo # BUG#849776: Wrong result with semijoin + "Impossible where"
+--echo #
+CREATE TABLE t1 ( b varchar(1), a integer) ;
+INSERT INTO t1 VALUES ('z',8);
+
+CREATE TABLE t2 ( a integer, b varchar(1)) ;
+
+CREATE TABLE t4 ( a integer, b varchar(1)) ;
+
+CREATE TABLE t5 ( a integer) ;
+INSERT INTO t5 VALUES (8);
+
+select * from t5 where (a) in (
+ SELECT t1.a
+ FROM t1 LEFT JOIN t2 ON t1.a = t2.a
+ WHERE t2.b NOT IN (SELECT t4.b FROM t4 WHERE t4.b < t1.b)
+);
+
+DROP TABLE t1, t2, t4, t5;
+
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;