summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-04-29 09:54:12 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-04-29 09:54:12 +0200
commita742526980c197d391dfca6766cc2d9d120df7de (patch)
tree1965709a3c0332414adbaafd3f82936a3d4bc9d6 /sql/ha_partition.cc
parent843cee8a30341a7152b523b24559df35e2de31bf (diff)
parenta40826acf7c814de5635f14d131f981b4c3fb698 (diff)
downloadmariadb-git-a742526980c197d391dfca6766cc2d9d120df7de.tar.gz
merge
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index c82b96f4fc4..c4f22614529 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2739,7 +2739,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
(PARTITION_ENABLED_TABLE_FLAGS));
while (*(++file))
{
- DBUG_ASSERT(ref_length >= (*file)->ref_length);
+ /* MyISAM can have smaller ref_length for partitions with MAX_ROWS set */
set_if_bigger(ref_length, ((*file)->ref_length));
/*
Verify that all partitions have the same set of table flags.
@@ -4089,12 +4089,15 @@ end_dont_reset_start_part:
void ha_partition::position(const uchar *record)
{
handler *file= m_file[m_last_part];
+ uint pad_length;
DBUG_ENTER("ha_partition::position");
file->position(record);
int2store(ref, m_last_part);
- memcpy((ref + PARTITION_BYTES_IN_POS), file->ref,
- (ref_length - PARTITION_BYTES_IN_POS));
+ memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, file->ref_length);
+ pad_length= m_ref_length - PARTITION_BYTES_IN_POS - file->ref_length;
+ if (pad_length)
+ memset((ref + PARTITION_BYTES_IN_POS + file->ref_length), 0, pad_length);
#ifdef SUPPORTING_PARTITION_OVER_DIFFERENT_ENGINES
#ifdef HAVE_purify