Commit 6f835378 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-24283 Assertion `bitmap_is_set(&m_part_info->read_partitions,...

MDEV-24283 Assertion `bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)' failed in ha_partition::handle_ordered_index_scan

ha_partition should not try to search the index
if all partitions were pruned away.

The fix originally by Nayuta Yanagisawa
parent 81c88ab7
......@@ -3529,3 +3529,17 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t3 p3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 10 Using where; Using join buffer (incremental, BNL join)
drop table t0,t1,t2,t3;
#
# End of 10.3 tests
#
#
# MDEV-24283 Assertion `bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)' failed in ha_partition::handle_ordered_index_scan
#
create table t1 (c int key) partition by list (c) (partition p values in (0));
select max(c) from t1 where c>0;
max(c)
NULL
drop table t1;
#
# End of 10.4 tests
#
......@@ -1583,3 +1583,18 @@ select * from t1 left join (t3 join t2) on (t1.a=t3.a and t3.a=t2.b and t3.part_
drop table t0,t1,t2,t3;
--echo #
--echo # End of 10.3 tests
--echo #
--echo #
--echo # MDEV-24283 Assertion `bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)' failed in ha_partition::handle_ordered_index_scan
--echo #
create table t1 (c int key) partition by list (c) (partition p values in (0));
select max(c) from t1 where c>0;
drop table t1;
--echo #
--echo # End of 10.4 tests
--echo #
......@@ -5896,6 +5896,9 @@ int ha_partition::common_first_last(uchar *buf)
{
int error;
if (table->all_partitions_pruned_away)
return HA_ERR_END_OF_FILE; // No rows matching WHERE
if (unlikely((error= partition_scan_set_up(buf, FALSE))))
return error;
if (!m_ordered_scan_ongoing &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment