summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 1400d9da753..5abdf873c81 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3983,7 +3983,8 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same)
}
else if (!(error= file->index_next(buf)))
{
- if (compare_key(end_range) <= 0)
+ if (!(file->table_flags() & HA_READ_ORDER) ||
+ compare_key(end_range) <= 0)
{
m_last_part= m_part_spec.start_part;
DBUG_RETURN(0); // Row was in range
@@ -4060,7 +4061,8 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
}
if (!error)
{
- if (compare_key(end_range) <= 0)
+ if (!(file->table_flags() & HA_READ_ORDER) ||
+ compare_key(end_range) <= 0)
{
m_last_part= i;
DBUG_RETURN(0);