summaryrefslogtreecommitdiff
path: root/sql/ha_partition.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2008-10-10 12:01:01 +0200
committerMattias Jonsson <mattias.jonsson@sun.com>2008-10-10 12:01:01 +0200
commit44630e09ee7c86e8e2a78a434b59121049c3bebc (patch)
tree26c18991c89e887e3a6c706f648f8e6be6a7803f /sql/ha_partition.h
parente300184c0179dc0b668afe085d175e8ce39f6609 (diff)
downloadmariadb-git-44630e09ee7c86e8e2a78a434b59121049c3bebc.tar.gz
Bug#37721: ORDER BY when WHERE contains non-partitioned
index column There was actually two problems 1) when clustered pk, order by non pk index should also compare with pk as last resort to differ keys from each other 2) bug in the index search handling in ha_partition (was found when extending the test case Solution to 1 was to include the pk in key compare if clustered pk and search on other index. Solution for 2 was to remove the optimization from ordered scan to unordered scan if clustered pk.
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r--sql/ha_partition.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 685f057dfce..6e52106dfa5 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -74,9 +74,16 @@ private:
handler **m_added_file; // Added parts kept for errors
partition_info *m_part_info; // local reference to partition
Field **m_part_field_array; // Part field array locally to save acc
- uchar *m_ordered_rec_buffer; // Row and key buffer for ord. idx scan
- KEY *m_curr_key_info; // Current index
- uchar *m_rec0; // table->record[0]
+ uchar *m_ordered_rec_buffer; // Row and key buffer for ord. idx scan
+ /*
+ Current index.
+ When used in key_rec_cmp: If clustered pk, index compare
+ must compare pk if given index is same for two rows.
+ So normally m_curr_key_info[0]= current index and m_curr_key[1]= NULL,
+ and if clustered pk, [0]= current index, [1]= pk, [2]= NULL
+ */
+ KEY *m_curr_key_info[3]; // Current index
+ uchar *m_rec0; // table->record[0]
QUEUE m_queue; // Prio queue used by sorted read
/*
Since the partition handler is a handler on top of other handlers, it