Cursor::index_read_idx_map() violates blobs memory rules

Bug #585252 reported by Stewart Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Triaged
Low
Stewart Smith

Bug Description

nt Cursor::index_read_idx_map(unsigned char * buf, uint32_t index,
                                const unsigned char * key,
                                key_part_map keypart_map,
                                enum ha_rkey_function find_flag)
{
  int error, error1;
  error= doStartIndexScan(index, 0);
  if (!error)
  {
    error= index_read_map(buf, key, keypart_map, find_flag);
    error1= doEndIndexScan();
  }
  return error ? error : error1;
}

The doEndIndexScan() call tells the Engine that it can free the BLOB records.

this query from type_blob.test can show this (when run with an appropriate engine):

select replace(t3._field_140, "\r","^M"),t3_id,min(t3._field_131), min(t3._field_135), min(t3._field_139), min(t3._field_137), min(link_alias_142._field_165), min(link_alias_133._field_72), min(t3._field_145), min(link_alias_148._field_156), replace(min(t3._field_140), "\r","^M"),t3.t3_id from t3 left join t4 on t4.seq_0_id = t3.t3_id left join t7 link_alias_142 on t4.seq_1_id = link_alias_142.t7_id left join t6 on t6.seq_0_id = t3.t3_id left join t1 link_alias_133 on t6.seq_1_id = link_alias_133.t1_id left join t2 on t2.seq_0_id = t3.t3_id left join t5 link_alias_148 on t2.seq_1_id = link_alias_148.t5_id where t3.t3_id in (1) group by t3.t3_id order by link_alias_142._field_166, _field_139, link_alias_133._field_72, _field_135, link_alias_148._field_156;

Stewart Smith (stewart)
Changed in drizzle:
status: New → Confirmed
Stewart Smith (stewart)
tags: added: storage-engine-api
Stewart Smith (stewart)
Changed in drizzle:
importance: Undecided → Low
Changed in drizzle:
assignee: nobody → Stewart Smith (stewart)
Stewart Smith (stewart)
Changed in drizzle:
status: Confirmed → In Progress
Revision history for this message
Stewart Smith (stewart) wrote :

I don't have a good solution to this yet. Spent a while looking, but the best way is to go for a more complete and better set of blob memory management rules, which is beyond the scope of this week at least.

Changed in drizzle:
status: In Progress → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.