summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-04-27 17:51:06 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-04-27 17:51:06 +0200
commit401941c25898300462b1adbd9886c8d55e92f7f2 (patch)
tree33ae50afb43a86095bf82aaeeadea452a4cb50fc /sql
parenta1f7ceb281f9d87c9baea125ebab26f99a0370f8 (diff)
downloadmariadb-git-401941c25898300462b1adbd9886c8d55e92f7f2.tar.gz
Post push fix for bug#11766249 bug#59316
Partitions can have different ref_length (position data length). Removed DBUG_ASSERT which crashed debug builds when using MAX_ROWS on some partitions.
Diffstat (limited to 'sql')
-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 460d5826a91..4883e0a0571 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2697,7 +2697,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.
@@ -3957,12 +3957,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