diff options
Diffstat (limited to 'mysql-test/t/subselect.test')
-rw-r--r-- | mysql-test/t/subselect.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index a4c4c21610e..871f5ee9622 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -6113,6 +6113,30 @@ explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3; drop table t1,t2; + +--echo # +--echo # MDEV-19429: Wrong query result with EXISTS and LIMIT 0 +--echo # +create table t10 (a int); +insert into t10 values (1),(2),(3); +create table t12 (a int); +insert into t12 values (1),(2),(3); +select * from t10 where exists (select * from t12 order by a limit 0); +explain select * from t10 where exists (select * from t12 order by a limit 0); + +prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; + +set @l=1; +execute stmt1 using @l; +set @l=2; +execute stmt1 using @l; +set @l=0; +execute stmt1 using @l; + +deallocate prepare stmt1; + +drop table t10, t12; + --echo End of 5.5 tests --echo # End of 10.0 tests |