summaryrefslogtreecommitdiff
path: root/sql/ha_partition.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2012-08-15 14:56:55 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2012-08-15 14:56:55 +0200
commit404cce0ff82402c24c869a75606f329bfe9da9e9 (patch)
tree260d78771471eaa7564ad7b038429d2ab252b628 /sql/ha_partition.h
parent94bd7bd6b7687cf654df90b22a85425cf72af55c (diff)
parentbcee9f1896ab6015e77ea88fde5317f50edaead7 (diff)
downloadmariadb-git-404cce0ff82402c24c869a75606f329bfe9da9e9.tar.gz
manual merge 5.1->5.5
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r--sql/ha_partition.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 220af4d4e89..2142fd27a7f 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -511,6 +511,8 @@ public:
virtual int read_range_next();
private:
+ bool init_record_priority_queue();
+ void destroy_record_priority_queue();
int common_index_read(uchar * buf, bool have_start_key);
int common_first_last(uchar * buf);
int partition_scan_set_up(uchar * buf, bool idx_read_flag);
@@ -518,8 +520,15 @@ private:
int handle_unordered_scan_next_partition(uchar * buf);
uchar *queue_buf(uint part_id)
{
- return (m_ordered_rec_buffer +
- (part_id * (m_rec_length + PARTITION_BYTES_IN_POS)));
+ uint16 *part_id_map= (uint16*) m_ordered_rec_buffer;
+ /* Offset to the partition's record buffer in number of partitions. */
+ uint offset= part_id_map[part_id];
+ /*
+ Return the pointer to the partition's record buffer.
+ First skip the partition id map, and then add the offset.
+ */
+ return (m_ordered_rec_buffer + m_tot_parts * PARTITION_BYTES_IN_POS +
+ (offset * (m_rec_length + PARTITION_BYTES_IN_POS)));
}
uchar *rec_buf(uint part_id)
{