diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2014-02-17 23:20:07 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2014-02-17 23:20:07 +0400 |
commit | fd9e34ffd7712723b17a6eb2ae7c267a882ad4e9 (patch) | |
tree | 8f5f7354a1cf4008176b44dd4bb80e6b0e4b825e /sql/ha_partition.cc | |
parent | b594e31b6bd12cce22e8cd2b2a1eb097260f9470 (diff) | |
download | mariadb-git-fd9e34ffd7712723b17a6eb2ae7c267a882ad4e9.tar.gz |
Post-merge fixes: merge MariaDB's fix for MDEV-5177 and MDEV-5555
with Oracle's fix for Bug#17588348 by reverting Oracle's fix.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 5d5eccc42bb..0d30265ce9a 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -7711,29 +7711,19 @@ uint ha_partition::min_record_length(uint options) const int ha_partition::cmp_ref(const uchar *ref1, const uchar *ref2) { - int cmp; + uint part_id; my_ptrdiff_t diff1, diff2; + handler *file; DBUG_ENTER("ha_partition::cmp_ref"); - cmp = m_file[0]->cmp_ref((ref1 + PARTITION_BYTES_IN_POS), - (ref2 + PARTITION_BYTES_IN_POS)); - if (cmp) - DBUG_RETURN(cmp); - if ((ref1[0] == ref2[0]) && (ref1[1] == ref2[1])) { - /* This means that the references are same and are in same partition.*/ - DBUG_RETURN(0); + part_id= uint2korr(ref1); + file= m_file[part_id]; + DBUG_ASSERT(part_id < m_tot_parts); + DBUG_RETURN(file->cmp_ref((ref1 + PARTITION_BYTES_IN_POS), + (ref2 + PARTITION_BYTES_IN_POS))); } - - /* - In Innodb we compare with either primary key value or global DB_ROW_ID so - it is not possible that the two references are equal and are in different - partitions, but in myisam it is possible since we are comparing offsets. - Remove this assert if DB_ROW_ID is changed to be per partition. - */ - DBUG_ASSERT(!m_innodb); - diff1= ref2[1] - ref1[1]; diff2= ref2[0] - ref1[0]; if (diff1 > 0) |