summaryrefslogtreecommitdiff
path: root/mysql-test/main/subselect_sj.result
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-10-31 10:58:06 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-10-31 10:58:06 +0100
commit55b2281a5da38f66dca5e2180672f570c33676df (patch)
tree9cbb719b71ff8f29e657ff1d468f4270c714d5b5 /mysql-test/main/subselect_sj.result
parentd6d621cec18251b55202bbd362315b3c1ed90181 (diff)
parent259edb1f60b5d4e9061a81e90c5a8ec9d0741751 (diff)
downloadmariadb-git-55b2281a5da38f66dca5e2180672f570c33676df.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/main/subselect_sj.result')
-rw-r--r--mysql-test/main/subselect_sj.result26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/main/subselect_sj.result b/mysql-test/main/subselect_sj.result
index ea0f139ed0c..af602c26060 100644
--- a/mysql-test/main/subselect_sj.result
+++ b/mysql-test/main/subselect_sj.result
@@ -3259,6 +3259,32 @@ create table t1 (a1 varchar(25));
create table t2 (a2 varchar(25)) ;
insert into t1 select 'xxx' from dual where 'xxx' in (select a2 from t2);
drop table t1,t2;
+#
+# MDEV-13172: Wrong result / SELECT ... WHERE EXISTS ... (with UNIQUE Key)
+#
+CREATE TABLE `t1` (
+`Id` int(11) NOT NULL,
+PRIMARY KEY (`Id`)
+);
+INSERT INTO `t1` (`Id`) VALUES (1);
+CREATE TABLE `t2` (
+`t1_Id` int(11) NOT NULL DEFAULT 0,
+`col1` int(11) DEFAULT NULL,
+UNIQUE KEY `col1` (`col1`)
+);
+INSERT INTO `t2` (`t1_Id`, `col1`) VALUES (1, NULL), (1, NULL);
+SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
+Id
+1
+explain extended
+SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 MATERIALIZED t2 ref col1 col1 5 const 1 100.00 Using index condition; Using where
+Warnings:
+Note 1003 select 1 AS `Id` from (`test`.`t2`) where `test`.`t2`.`t1_Id` = 1 and `test`.`t2`.`col1` is null
+DROP TABLE t1, t2;
# End of 5.5 test
#
# MDEV-20109: Optimizer ignores distinct key created for materialized