Skip to content

Commit 3739298

Browse files
committed
Merge branch '10.9' into 10.10
2 parents 83fa033 + 2871a05 commit 3739298

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

mysql-test/main/derived_split_innodb.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,5 +823,21 @@ a b a b a b grp_id count(*)
823823
5 5 5 2 5 3 5 100
824824
drop table t1,t2,t3;
825825
drop table t10, t11;
826+
#
827+
# MDEV-31194: Server crash or assertion failure with join_cache_level=4
828+
# (a followup to the above bug, MDEV-26301)
829+
#
830+
CREATE TABLE t1 (a INT);
831+
INSERT INTO t1 VALUES (3),(4);
832+
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=Aria;
833+
INSERT INTO t2 VALUES (1),(2);
834+
set @tmp1= @@optimizer_switch, @tmp2= @@join_cache_level;
835+
set
836+
optimizer_switch= 'derived_with_keys=off',
837+
join_cache_level= 4;
838+
SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id= t1.a;
839+
a
840+
set optimizer_switch= @tmp1, join_cache_level= @tmp2;
841+
DROP TABLE t1, t2;
826842
# End of 10.4 tests
827843
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;

mysql-test/main/derived_split_innodb.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,29 @@ eval $q;
443443
drop table t1,t2,t3;
444444
drop table t10, t11;
445445

446+
447+
--echo #
448+
--echo # MDEV-31194: Server crash or assertion failure with join_cache_level=4
449+
--echo # (a followup to the above bug, MDEV-26301)
450+
--echo #
451+
CREATE TABLE t1 (a INT);
452+
INSERT INTO t1 VALUES (3),(4);
453+
454+
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=Aria;
455+
INSERT INTO t2 VALUES (1),(2);
456+
457+
set @tmp1= @@optimizer_switch, @tmp2= @@join_cache_level;
458+
set
459+
optimizer_switch= 'derived_with_keys=off',
460+
join_cache_level= 4;
461+
462+
SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id= t1.a;
463+
464+
set optimizer_switch= @tmp1, join_cache_level= @tmp2;
465+
466+
# Cleanup
467+
DROP TABLE t1, t2;
468+
446469
--echo # End of 10.4 tests
447470

448471
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;

sql/sql_select.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13863,7 +13863,7 @@ uint check_join_cache_usage(JOIN_TAB *tab,
1386313863
join->return_tab= 0;
1386413864

1386513865
if (tab->no_forced_join_cache)
13866-
return 0;
13866+
goto no_join_cache;
1386713867

1386813868
/*
1386913869
Don't use join cache if @@join_cache_level==0 or this table is the first

0 commit comments

Comments
 (0)