summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc38
1 files changed, 32 insertions, 6 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index bff94da63bb..88e5eecc94f 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3235,14 +3235,9 @@ end_dont_reset_start_part:
void ha_partition::position(const uchar *record)
{
- handler *file;
+ handler *file= m_file[m_last_part];
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,
@@ -3257,6 +3252,7 @@ void ha_partition::position(const uchar *record)
DBUG_VOID_RETURN;
}
+
/*
Read row using position
@@ -3292,6 +3288,36 @@ int ha_partition::rnd_pos(uchar * buf, uchar *pos)
}
+/*
+ Read row using position using given record to find
+
+ SYNOPSIS
+ rnd_pos_by_record()
+ record Current record in MySQL Row Format
+
+ RETURN VALUE
+ >0 Error code
+ 0 Success
+
+ DESCRIPTION
+ this works as position()+rnd_pos() functions, but does some extra work,
+ calculating m_last_part - the partition to where the 'record'
+ should go.
+
+ called from replication (log_event.cc)
+*/
+
+int ha_partition::rnd_pos_by_record(uchar *record)
+{
+ DBUG_ENTER("ha_partition::rnd_pos_by_record");
+
+ if (unlikely(get_part_for_delete(record, m_rec0, m_part_info, &m_last_part)))
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(handler::rnd_pos_by_record(record));
+}
+
+
/****************************************************************************
MODULE index scan
****************************************************************************/