Commit 8d37ef29 authored by Monty's avatar Monty

Aria now marks not used varchar space with MEM_UNDEFINED on read.

parent 15d2a6cf
...@@ -4912,9 +4912,11 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record, ...@@ -4912,9 +4912,11 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
case FIELD_VARCHAR: case FIELD_VARCHAR:
{ {
ulong length; ulong length;
uint pack_length __attribute__((unused));
if (column->length <= 256) if (column->length <= 256)
{ {
length= (uint) (uchar) (*field_pos++= *field_length_data++); length= (uint) (uchar) (*field_pos++= *field_length_data++);
pack_length= 1;
} }
else else
{ {
...@@ -4923,14 +4925,16 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record, ...@@ -4923,14 +4925,16 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
field_pos[1]= field_length_data[1]; field_pos[1]= field_length_data[1];
field_pos+= 2; field_pos+= 2;
field_length_data+= 2; field_length_data+= 2;
pack_length= 2;
} }
#ifdef SANITY_CHECKS #ifdef SANITY_CHECKS
if (length > column->length) if (length > column->length - pack_length)
goto err; goto err;
#endif #endif
if (read_long_data(info, field_pos, length, &extent, &data, if (read_long_data(info, field_pos, length, &extent, &data,
&end_of_data)) &end_of_data))
DBUG_RETURN(my_errno); DBUG_RETURN(my_errno);
MEM_UNDEFINED(field_pos + length, column->length - length - pack_length);
break; break;
} }
case FIELD_BLOB: case FIELD_BLOB:
......
...@@ -1297,6 +1297,8 @@ size_t _ma_rec_unpack(register MARIA_HA *info, register uchar *to, uchar *from, ...@@ -1297,6 +1297,8 @@ size_t _ma_rec_unpack(register MARIA_HA *info, register uchar *to, uchar *from,
if (from+length > from_end) if (from+length > from_end)
goto err; goto err;
memcpy(to+pack_length, from, length); memcpy(to+pack_length, from, length);
MEM_UNDEFINED(to+pack_length + length,
column_length - length - pack_length);
from+= length; from+= length;
min_pack_length--; min_pack_length--;
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment