summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/hfmain.(none)>2007-08-23 23:34:48 +0500
committerunknown <holyfoot/hf@mysql.com/hfmain.(none)>2007-08-23 23:34:48 +0500
commitf0d1ac25c349f09f2512d75f4e12f39d3a7729c3 (patch)
tree6da59a685857cfe6fb8a911fadf83d4e2b2869b4 /sql/ha_partition.cc
parent4512a993c52479b8d83644bdee8db14912ecfba9 (diff)
downloadmariadb-git-f0d1ac25c349f09f2512d75f4e12f39d3a7729c3.tar.gz
Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format.
In the ha_partition::position() we didn't calculate the number of the partition of the record. We used m_last_part value instead, relying on that it is set in other place like previous call of a method like ::write_row(). In replication we don't call any of these befor position(). Delete_rows_log_event::do_exec_row calls find_and_fetch_row. In case of InnoDB-based PARTITION table, we have HA_PRIMARY_KEY_REQUIRED_FOR_POSITION enabled, so use position() / rnd_pos() calls to fetch the record. Fixed by adding partition_id calculation to the ha_partition::position() sql/ha_partition.h: Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format. column_bitmaps_signal interface added sql/ha_partition.cc: Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format. Calculate the number of the partition in ha_partition::position(). ha_partition::column_bitmaps_signal() implemented mysql-test/r/partition_pruning.result: Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format. test result fixed
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 2c28d5087d4..91eaf66e4e3 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3235,9 +3235,14 @@ end_dont_reset_start_part:
void ha_partition::position(const uchar *record)
{
- handler *file= m_file[m_last_part];
+ handler *file;
DBUG_ENTER("ha_partition::position");
+ if (unlikely(get_part_for_delete(record, m_rec0, m_part_info, &m_last_part)))
+ m_last_part= 0;
+
+ file= m_file[m_last_part];
+
file->position(record);
int2store(ref, m_last_part);
memcpy((ref + PARTITION_BYTES_IN_POS), file->ref,
@@ -5587,6 +5592,13 @@ int ha_partition::indexes_are_disabled(void)
}
+void ha_partition::column_bitmaps_signal()
+{
+ handler::column_bitmaps_signal();
+ bitmap_union(table->read_set, &m_part_info->full_part_field_set);
+}
+
+
/****************************************************************************
MODULE Partition Share
****************************************************************************/