Aria now marks not used varchar space with MEM_UNDEFINED on read.
This commit is contained in:
parent
15d2a6cfa3
commit
8d37ef2999
@ -4912,9 +4912,11 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
|
||||
case FIELD_VARCHAR:
|
||||
{
|
||||
ulong length;
|
||||
uint pack_length __attribute__((unused));
|
||||
if (column->length <= 256)
|
||||
{
|
||||
length= (uint) (uchar) (*field_pos++= *field_length_data++);
|
||||
pack_length= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4923,14 +4925,16 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
|
||||
field_pos[1]= field_length_data[1];
|
||||
field_pos+= 2;
|
||||
field_length_data+= 2;
|
||||
pack_length= 2;
|
||||
}
|
||||
#ifdef SANITY_CHECKS
|
||||
if (length > column->length)
|
||||
if (length > column->length - pack_length)
|
||||
goto err;
|
||||
#endif
|
||||
if (read_long_data(info, field_pos, length, &extent, &data,
|
||||
&end_of_data))
|
||||
DBUG_RETURN(my_errno);
|
||||
MEM_UNDEFINED(field_pos + length, column->length - length - pack_length);
|
||||
break;
|
||||
}
|
||||
case FIELD_BLOB:
|
||||
|
@ -1297,6 +1297,8 @@ size_t _ma_rec_unpack(register MARIA_HA *info, register uchar *to, uchar *from,
|
||||
if (from+length > from_end)
|
||||
goto err;
|
||||
memcpy(to+pack_length, from, length);
|
||||
MEM_UNDEFINED(to+pack_length + length,
|
||||
column_length - length - pack_length);
|
||||
from+= length;
|
||||
min_pack_length--;
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user