summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorunknown <mikael/pappa@dator5.(none)>2006-09-19 02:56:02 -0400
committerunknown <mikael/pappa@dator5.(none)>2006-09-19 02:56:02 -0400
commit392c3122f6d7931c39d66062acfe4ea265b4ba5c (patch)
tree2f53555c5e7a34d20a1af2e5344759e5aa1c2dce /sql/ha_partition.cc
parentc690c11feb18e43b87cffb6d95d8e34a110d94d7 (diff)
downloadmariadb-git-392c3122f6d7931c39d66062acfe4ea265b4ba5c.tar.gz
BUG#22178: Scan ordered performed also on engines not supporting ordered scans
Scan of ranges without start key should not use ordered scans unless it is requested. sql/ha_partition.cc: Scan of ranges without start key should not use ordered scans unless it is requested. sql/ha_partition.h: Scan of ranges without start key should not use ordered scans unless it is requested.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index e435b356def..6b08d42edce 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3655,7 +3655,10 @@ int ha_partition::read_range_first(const key_range *start_key,
if (!start_key) // Read first record
{
- m_index_scan_type= partition_index_first;
+ if (m_ordered)
+ m_index_scan_type= partition_index_first;
+ else
+ m_index_scan_type= partition_index_first_unordered;
error= common_first_last(m_rec0);
}
else
@@ -3869,6 +3872,18 @@ int ha_partition::handle_unordered_scan_next_partition(byte * buf)
DBUG_PRINT("info", ("index_first on partition %d", i));
error= file->index_first(buf);
break;
+ case partition_index_first_unordered:
+ /*
+ We perform a scan without sorting and this means that we
+ should not use the index_first since not all handlers
+ support it and it is also unnecessary to restrict sort
+ order.
+ */
+ DBUG_PRINT("info", ("read_range_first on partition %d", i));
+ table->record[0]= buf;
+ error= file->read_range_first(0, end_range, eq_range, 0);
+ table->record[0]= m_rec0;
+ break;
default:
DBUG_ASSERT(FALSE);
DBUG_RETURN(1);