diff options
author | unknown <timour@askmonty.org> | 2011-11-30 08:28:40 +0200 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2011-11-30 08:28:40 +0200 |
commit | 3a7f28793f5e65eb4b134c1a330900ccf73022e1 (patch) | |
tree | 7744092f7479c9d70d88bfff315e536bd199d975 /mysql-test/r/subselect.result | |
parent | 264aaf111d0493f0472e704ad7dda426f81376ea (diff) | |
parent | 625cdb8078550d30399209d58edcb38cdfcc411d (diff) | |
download | mariadb-git-3a7f28793f5e65eb4b134c1a330900ccf73022e1.tar.gz |
Merge the fix of bug lp:825051
Diffstat (limited to 'mysql-test/r/subselect.result')
-rw-r--r-- | mysql-test/r/subselect.result | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index e49baeadcb0..221a313968a 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -5842,5 +5842,31 @@ SELECT (SELECT f3a, f3a FROM t3 where f3a > 3) = (0, 0); (SELECT f3a, f3a FROM t3 where f3a > 3) = (0, 0) NULL drop tables t1,t2,t3; +# +# LP BUG#825051 Wrong result with date/datetime and subquery with GROUP BY and in_to_exists +# +CREATE TABLE t1 (a date, KEY (a)) ; +INSERT INTO t1 VALUES ('2009-01-01'),('2009-02-02'); +set @old_optimizer_switch = @@optimizer_switch; +SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index +2 DEPENDENT SUBQUERY t1 index NULL a 4 NULL 1 Using index +SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +a +2009-01-01 +2009-02-02 +SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index +2 SUBQUERY t1 index NULL a 4 NULL 2 Using index +SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +a +2009-01-01 +2009-02-02 +set @@optimizer_switch=@old_optimizer_switch; +drop table t1; # return optimizer switch changed in the beginning of this test set optimizer_switch=@subselect_tmp; |