mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
BUG#20583: index_last causes crash when performed on single partition
mysql-test/r/partition.result: New test case mysql-test/t/partition.test: New test case sql/ha_partition.cc: Ensure index_last always uses ordered index scan
This commit is contained in:
parent
767cb0b4a6
commit
aa475d48a4
3 changed files with 19 additions and 1 deletions
|
|
@ -1043,4 +1043,12 @@ alter table t1 add partition (partition p2 values in (3));
|
|||
alter table t1 drop partition p2;
|
||||
use test;
|
||||
drop database db99;
|
||||
create table t1 (a int, index(a))
|
||||
partition by hash(a);
|
||||
insert into t1 values (1),(2);
|
||||
select * from t1 ORDER BY a DESC;
|
||||
a
|
||||
2
|
||||
1
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -1199,4 +1199,13 @@ alter table t1 drop partition p2;
|
|||
use test;
|
||||
drop database db99;
|
||||
|
||||
#
|
||||
# Bug 20583 Partitions: Crash using index_last
|
||||
#
|
||||
create table t1 (a int, index(a))
|
||||
partition by hash(a);
|
||||
insert into t1 values (1),(2);
|
||||
select * from t1 ORDER BY a DESC;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -3399,7 +3399,8 @@ int ha_partition::common_first_last(byte *buf)
|
|||
|
||||
if ((error= partition_scan_set_up(buf, FALSE)))
|
||||
return error;
|
||||
if (!m_ordered_scan_ongoing)
|
||||
if (!m_ordered_scan_ongoing &&
|
||||
m_index_scan_type != partition_index_last)
|
||||
return handle_unordered_scan_next_partition(buf);
|
||||
return handle_ordered_index_scan(buf);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue