diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-07-28 13:43:26 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-07-28 13:43:26 +0200 |
commit | 2792c6e7b057b18c19b506f37c35716529f80979 (patch) | |
tree | cead6068286ee469dbfe33a28d4585742eb26cbb /mysql-test/main/subselect_no_opts.result | |
parent | c0743e4b0056eba0b19a19458c85e52a83cef676 (diff) | |
parent | 4b5a14d0fe3d6945a0a9516261f563dcfd1f2c9c (diff) | |
download | mariadb-git-2792c6e7b057b18c19b506f37c35716529f80979.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'mysql-test/main/subselect_no_opts.result')
-rw-r--r-- | mysql-test/main/subselect_no_opts.result | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index 1937f2af8f6..b4ee1ba6287 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -1897,7 +1897,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index Warnings: Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !<in_optimizer>(1,exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null)) +Note 1003 /* select#1 */ select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where !<in_optimizer>(1,exists(/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 and `test`.`t1`.`id` = `test`.`tt`.`id` having `test`.`t1`.`id` is not null limit 1)) insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); @@ -4460,7 +4460,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`)) +Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where exists((/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) union (/* select#3 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a`) limit 1) DROP TABLE t1,t2; create table t0(a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -7255,6 +7255,37 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away drop table t1,t2; +# +# MDEV-19429: Wrong query result with EXISTS and LIMIT 0 +# +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); +a +explain select * from t10 where exists (select * from t12 order by a limit 0); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Zero limit +prepare stmt1 from "select * from t10 where exists (select * from t12 order by a limit ?)"; +set @l=1; +execute stmt1 using @l; +a +1 +2 +3 +set @l=2; +execute stmt1 using @l; +a +1 +2 +3 +set @l=0; +execute stmt1 using @l; +a +deallocate prepare stmt1; +drop table t10, t12; End of 5.5 tests # End of 10.0 tests # |