diff options
Diffstat (limited to 'mysql-test/t/derived.test')
-rw-r--r-- | mysql-test/t/derived.test | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 4cf5cccc254..381c87c635c 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -343,3 +343,18 @@ SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2); DROP TABLE t1, t2; DROP VIEW v1, v2; set optimizer_switch=@save_derived_optimizer_switch; + +# +# MDEV-614 lp:1050806 - different result for a query using subquery between 5.5.25 and 5.5.27 +# MySQL Bug#66845 Wrong result (extra row) on a FROM subquery with a variable and ORDER BY +# +create table t1 (n bigint(20) unsigned, d1 datetime, d2 datetime, key (d1)); +insert t1 values (2085,'2012-01-01 00:00:00','2013-01-01 00:00:00'); +insert t1 values (2084,'2012-02-01 00:00:00','2013-01-01 00:00:00'); +insert t1 values (2088,'2012-03-01 00:00:00','2013-01-01 00:00:00'); +select * from ( + select n, d1, d2, @result := 0 as result + from t1 + where d1 < '2012-12-12 12:12:12' and n in (2085, 2084) order by d2 asc +) as calculated_result; +drop table t1; |