summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect_no_mat.result
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2011-11-29 23:06:39 +0200
committerunknown <timour@askmonty.org>2011-11-29 23:06:39 +0200
commit625cdb8078550d30399209d58edcb38cdfcc411d (patch)
treee56a27a1d6213a6b593d050f085f249bbe894a93 /mysql-test/r/subselect_no_mat.result
parentcdde6187d1d2e7f407043f73376c266f540217d9 (diff)
downloadmariadb-git-625cdb8078550d30399209d58edcb38cdfcc411d.tar.gz
Fixed bug lp:825051
The cause of the wrong result was that Item_ref_null_helper::get_date() didn't use a method of the *_result() family, and fetched the data for the field from the current row instead of result_field. Changed to use the correct *_result() method, like to all other similar methods of Item_ref_null_helper.
Diffstat (limited to 'mysql-test/r/subselect_no_mat.result')
-rw-r--r--mysql-test/r/subselect_no_mat.result26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index a7625db5ff3..792d75f8d7c 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -5826,6 +5826,32 @@ 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;
set optimizer_switch=default;