summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorAshish Agarwal <ashish.y.agarwal@oracle.com>2011-10-21 16:19:58 +0530
committerAshish Agarwal <ashish.y.agarwal@oracle.com>2011-10-21 16:19:58 +0530
commitce33b1fafeccd1ddd800ed67c9b739830a8dc6df (patch)
tree201708165cf0deb16a2e827d1d75d50c8b4ffd7f /storage
parente5c43f5835208502810958d7c2602afa11ad2b64 (diff)
downloadmariadb-git-ce33b1fafeccd1ddd800ed67c9b739830a8dc6df.tar.gz
bug#11758979 - 51252: ARCHIVE TABLES STILL FAIL UNDER STRESS
TESTS: CRASH, CORRUPTION, 4G MEMOR Issue: Valgrind errors due to checksum and optimize query angaist archive tables with null columns. Table record buffer was not initialized. Solution: Initialize the record buffer.
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 345c1b6835f..b6947688768 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -819,6 +819,7 @@ uint32 ha_archive::max_row_length(const uchar *buf)
ptr != end ;
ptr++)
{
+ if (!table->field[*ptr]->is_null())
length += 2 + ((Field_blob*)table->field[*ptr])->get_length();
}
@@ -1178,6 +1179,17 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record)
/* Copy null bits */
const uchar *ptr= record_buffer->buffer;
+ /*
+ Field::unpack() is not called when field is NULL. For VARCHAR
+ Field::unpack() only unpacks as much bytes as occupied by field
+ value. In these cases respective memory area on record buffer is
+ not initialized.
+
+ These uninitialized areas may be accessed by CHECKSUM TABLE or
+ by optimizer using temporary table (BUG#12997905). We may remove
+ this memset() when they're fixed.
+ */
+ memset(record, 0, table->s->reclength);
memcpy(record, ptr, table->s->null_bytes);
ptr+= table->s->null_bytes;
for (Field **field=table->field ; *field ; field++)