Skip to content

Commit da322f1

Browse files
committed
MDEV-26459 Assertion `block_size <= 0xFFFFFFFFL' failed in calculate_block_sizes for 10.7 only
Limit default allocation block in tree of Unique class
1 parent dd5ce6b commit da322f1

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

mysql-test/main/delete.result

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,3 +557,14 @@ having t3.a > any (select t2.b from t2
557557
where t2.b*10 < sum(t3.b)));
558558
drop table t1,t2,t3;
559559
End of 10.4 tests
560+
#
561+
# MDEV-26459: Assertion `block_size <= 0xFFFFFFFFL' failed
562+
# in calculate_block_sizes for 10.7 only
563+
#
564+
SET @sort_buffer_size_save= @@sort_buffer_size;
565+
SET sort_buffer_size=1125899906842624;
566+
CREATE TABLE t1 (a INT,b CHAR,KEY(a,b));
567+
DELETE a1 FROM t1 AS a1,t1 AS a2 WHERE a1.a=a2.a;
568+
DROP TABLE t1;
569+
SET sort_buffer_size= @sort_buffer_size_save;
570+
# End of 10.11 tests

mysql-test/main/delete.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,3 +625,17 @@ update t1 set t1.a=t1.a+10
625625
drop table t1,t2,t3;
626626

627627
--echo End of 10.4 tests
628+
629+
--echo #
630+
--echo # MDEV-26459: Assertion `block_size <= 0xFFFFFFFFL' failed
631+
--echo # in calculate_block_sizes for 10.7 only
632+
--echo #
633+
634+
SET @sort_buffer_size_save= @@sort_buffer_size;
635+
SET sort_buffer_size=1125899906842624;
636+
CREATE TABLE t1 (a INT,b CHAR,KEY(a,b));
637+
DELETE a1 FROM t1 AS a1,t1 AS a2 WHERE a1.a=a2.a;
638+
DROP TABLE t1;
639+
SET sort_buffer_size= @sort_buffer_size_save;
640+
641+
--echo # End of 10.11 tests

sql/uniques.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
9090
if (min_dupl_count_arg)
9191
full_size+= sizeof(element_count);
9292
with_counters= MY_TEST(min_dupl_count_arg);
93-
init_tree(&tree, (max_in_memory_size / 16), 0, size, comp_func,
94-
NULL, comp_func_fixed_arg, MYF(MY_THREAD_SPECIFIC));
93+
94+
init_tree(&tree, MY_MIN(max_in_memory_size / 16, UINT_MAX32),
95+
0, size, comp_func, NULL, comp_func_fixed_arg,
96+
MYF(MY_THREAD_SPECIFIC));
9597
/* If the following fail's the next add will also fail */
9698
my_init_dynamic_array(PSI_INSTRUMENT_ME, &file_ptrs, sizeof(Merge_chunk), 16,
9799
16, MYF(MY_THREAD_SPECIFIC));

0 commit comments

Comments
 (0)