Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL)
-
None
Description
Run this testcase
--source include/have_partition.inc
|
--source include/have_innodb.inc
|
|
create table ten(a int); |
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); |
|
create table one_k(a int); |
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C; |
|
create table t1 ( |
ID bigint(20) NOT NULL AUTO_INCREMENT, |
part_id int, |
key_col int, |
col2 int, |
key(key_col), |
PRIMARY KEY (ID,part_id) |
) ENGINE=InnoDB
|
PARTITION BY RANGE (part_id) |
(PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB, |
PARTITION p2 VALUES LESS THAN (7) ENGINE = InnoDB, |
PARTITION p3 VALUES LESS THAN (10) ENGINE = InnoDB |
);
|
|
insert into t1 select |
A.a+10*B.a,
|
A.a,
|
B.a,
|
123456
|
from ten A, ten B; |
|
set optimizer_switch='mrr=on'; |
explain
|
select * from t1 force index (key_col) where key_col < 10; |
select * from t1 force index (key_col) where key_col < 10; |
|
drop table ten,one_k,t1; |
And it will fail with:
mysqltest: At line 35: query 'select * from t1 force index (key_col) where key_col < 10' failed: 1041: Out of memory.
|
Attachments
Issue Links
- relates to
-
MDEV-21068 Test MRR scans over partitioned tables
-
- Closed
-
The issue doesn't have anything to do with the amount of memory actually.
It fails here:
(gdb) wher
#0 ha_innobase::open (this=0x7ffe541f1598, name=0x7ffe5407fcd0 "./test/t1") at /home/psergey/dev-git/10.3/storage/innobase/handler/ha_innodb.cc:6105
#1 0x0000555555f438af in handler::ha_open (this=0x7ffe541f1598, table_arg=0x7ffe541c51e0, name=0x7ffe5407fcd0 "./test/t1", mode=33, test_if_locked=2, mem_root=0x7ffe540062a0, partitions_to_open=0x0) at /home/psergey/dev-git/10.3/sql/handler.cc:2760
#2 0x0000555555f431f9 in handler::clone (this=0x7ffe541c6688, name=0x7ffe5407fcd0 "./test/t1", mem_root=0x7ffe540062a0) at /home/psergey/dev-git/10.3/sql/handler.cc:2663
#3 0x000055555616b325 in ha_innobase::clone (this=0x7ffe541c6688, name=0x7ffe5407fcd0 "./test/t1", mem_root=0x7ffe540062a0) at /home/psergey/dev-git/10.3/storage/innobase/handler/ha_innodb.cc:6470
#4 0x0000555555de89f0 in DsMrr_impl::setup_two_handlers (this=0x7ffe541c6ad8) at /home/psergey/dev-git/10.3/sql/multi_range_read.cc:1060
#5 0x0000555555de8566 in DsMrr_impl::dsmrr_init (this=0x7ffe541c6ad8, h_arg=0x7ffe541c6688, seq_funcs=0x7ffe541c65c8, seq_init_param=0x7ffe5406d420, n_ranges=1, mode=1028, buf=0x7ffe5406cee0) at /home/psergey/dev-git/10.3/sql/multi_range_read.cc:959
#6 0x0000555556186480 in ha_innobase::multi_range_read_init (this=0x7ffe541c6688, seq=0x7ffe541c65c8, seq_init_param=0x7ffe5406d420, n_ranges=1, mode=1028, buf=0x7ffe5406cee0) at /home/psergey/dev-git/10.3/storage/innobase/handler/ha_innodb.cc:20419
#7 0x000055555676bdc6 in ha_partition::multi_range_read_init (this=0x7ffe541c5e28, seq=0x7ffff016cde0, seq_init_param=0x7ffe541ef170, n_ranges=1, mrr_mode=1028, buf=0x7ffe54261750) at /home/psergey/dev-git/10.3/sql/ha_partition.cc:6467
#8 0x00005555560c3d4f in QUICK_RANGE_SELECT::reset (this=0x7ffe541ef170) at /home/psergey/dev-git/10.3/sql/opt_range.cc:11450
#9 0x0000555555f374b2 in find_all_keys (thd=0x7ffe54000d60, param=0x7ffff016d080, select=0x7ffe541f03c8, fs_info=0x7ffe54090760, buffpek_pointers=0x7ffff016d280, tempfile=0x7ffff016d110, pq=0x0, found_rows=0x7ffe54090940) at /home/psergey/dev-git/10.3/sql/filesort.cc:763
#10 0x0000555555f35a7b in filesort (thd=0x7ffe54000d60, table=0x7ffe541c51e0, filesort=0x7ffe541f0918, tracker=0x7ffe541f0fb8, join=0x7ffe54015530, first_table_bit=1) at /home/psergey/dev-git/10.3/sql/filesort.cc:268
#11 0x0000555555ca7a61 in create_sort_index (thd=0x7ffe54000d60, join=0x7ffe54015530, tab=0x7ffe541ed268, fsort=0x7ffe541f0918) at /home/psergey/dev-git/10.3/sql/sql_select.cc:22714
#12 0x0000555555ca1d06 in st_join_table::sort_table (this=0x7ffe541ed268) at /home/psergey/dev-git/10.3/sql/sql_select.cc:20480
#13 0x0000555555ca18e1 in join_init_read_record (tab=0x7ffe541ed268) at /home/psergey/dev-git/10.3/sql/sql_select.cc:20421
#14 0x0000555555c9f679 in sub_select (join=0x7ffe54015530, join_tab=0x7ffe541ed268, end_of_records=false) at /home/psergey/dev-git/10.3/sql/sql_select.cc:19502
#15 0x0000555555c9eb65 in do_select (join=0x7ffe54015530, procedure=0x0) at /home/psergey/dev-git/10.3/sql/sql_select.cc:19045
#16 0x0000555555c75eba in JOIN::exec_inner (this=0x7ffe54015530) at /home/psergey/dev-git/10.3/sql/sql_select.cc:4044