summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/derived_split_innodb.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
commit347c164c35eddab388009470e6848cb361ac93f8 (patch)
tree2c0c44eac690f510bb0a35b2a13b36d606b77b6b /mysql-test/main/derived_split_innodb.test
parentReleasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff)
downloadmariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz
mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/derived_split_innodb.test')
-rw-r--r--mysql-test/main/derived_split_innodb.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test
index 075d6e81..67db02f7 100644
--- a/mysql-test/main/derived_split_innodb.test
+++ b/mysql-test/main/derived_split_innodb.test
@@ -505,6 +505,48 @@ SELECT * FROM t1 WHERE t1.a IN (SELECT b FROM
DROP TABLE t1, t2, t3;
+--echo #
+--echo # MDEV-23878: Wrong result with semi-join and splittable derived table
+--echo #
+
+CREATE TABLE t1 (
+ groupId int,
+ id int unsigned,
+ PRIMARY KEY (groupId, id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO t1 VALUES
+ (8,1),(8,2),(8,3),(8,4),(8,5),(8,6),(8,7),(8,8),(8,9),(8,10),
+ (8,11),(8,12),(8,13),(8,14),(8,15),(8,16),(8,17),(8,18),(8,19);
+
+let $query=
+SELECT COUNT(*) AS cnt FROM t1
+JOIN
+(
+ SELECT groupId, id
+ FROM t1
+ WHERE id IN (1,2,3,4,5,6)
+ GROUP BY groupId, id
+) AS t2
+USING (groupId, id)
+WHERE id IN (1,2,3,4,5,6,7,8);
+
+let $tvc_conversion_threshold =
+ set statement in_predicate_conversion_threshold=2 for;
+
+eval $tvc_conversion_threshold $query;
+eval $tvc_conversion_threshold EXPLAIN $query;
+
+let $no_split_materialized_loosescan=
+ set statement optimizer_switch='split_materialized=off, loosescan=off' for;
+
+# Correct result with split materializied optimization disabled
+eval $no_split_materialized_loosescan
+ $tvc_conversion_threshold
+ $query;
+
+DROP TABLE t1;
+
--echo # End of 10.4 tests
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;